Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / routing.tt
1 [% USE raw %]
2 [% USE KohaDates %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %] &rsaquo; [% title | html %] &rsaquo; Serials &rsaquo; Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8 <body id="ser_routing" class="ser">
9 [% WRAPPER 'header.inc' %]
10     [% INCLUDE 'serials-search.inc' %]
11 [% END %]
12
13 [% WRAPPER 'sub-header.inc' %]
14     [% WRAPPER breadcrumbs %]
15         [% WRAPPER breadcrumb_item %]
16             <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
17         [% END %]
18         [% UNLESS ( blocking_error ) %]
19             [% WRAPPER breadcrumb_item %]
20                 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid | uri %]"><em>[% title | html %]</em></a>
21             [% END %]
22             [% WRAPPER breadcrumb_item bc_active= 1 %]
23                 [% IF ( op ) %]
24                     <span>Create routing list</span>
25                 [% ELSE %]
26                     <span>Edit routing list</span>
27                 [% END %]
28             [% END %]
29         [% END # UNLESS blocking_error %]
30     [% END #/ WRAPPER breadcrumbs %]
31 [% END #/ WRAPPER sub-header.inc %]
32
33 <div class="main container-fluid">
34     <div class="row">
35         <div class="col-sm-10 col-sm-push-2">
36             <main>
37
38 [% IF ( op ) %]
39 <h1>Create routing list for <em>[% title | html %]</em></h1>
40 [% ELSE %]
41 <h1>Edit routing list for <em>[% title | html %]</em></h1>
42 [% END %]
43
44 [% INCLUDE 'blocking_errors.inc' %]
45 <form method="post" action="routing.pl">
46 <input type="hidden" name="op" value="save" />
47 <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
48 <fieldset class="rows">
49         <ol>
50                 <li><label for="date_selected">Issue: </label>
51 <select name="date_selected" id="date_selected">
52     [% FOREACH date IN dates %]
53         [% IF ( date.selected ) %]
54             <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
55         [% ELSE %]
56             <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
57         [% END %]
58 [% END %]
59 </select> [% issue | html %]</li>
60
61 <li>
62     <span class="label">Recipients:</span>
63     [% IF memberloop %]
64         <table style="clear:none;margin:0;">
65             <tr><th>Name</th>
66                 <th>Rank</th>
67                 <th>Delete</th>
68             </tr>
69             [% USE m_loop = iterator(memberloop) %]
70             [% FOREACH member IN m_loop %]
71             <tr><td>[% member.name | html %]</td>
72                 <td>
73                     <select name="itemrank" class="itemrank" data-subscriptionid="[% subscriptionid | html %]" data-routingid="[% member.routingid | html %]">
74                     [% rankings = [1 .. m_loop.size] %]
75                     [% SET cur_rank = loop.count() %]
76                     [% FOREACH r IN rankings %]
77                         [% IF r == cur_rank %]
78                           <option selected="selected" value="[% r | html %]">[% r | html %]</option>
79                         [% ELSE %]
80                           <option value="[% r | html %]">[% r | html %]</option>
81                         [% END %]
82                     [% END %]
83                     </select>
84                 </td>
85                 <td><a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?routingid=[% member.routingid | html %]&amp;subscriptionid=[% subscriptionid | html %]&amp;op=delete"><i class="fa fa-trash-can"></i> Delete</a></td>
86             </tr>
87             [% END %]
88         </table>
89     [% END %]
90
91     <p style="margin-left:10em;">
92         <a href="#" id="add_recipients"><i class="fa fa-plus"></i> Add recipients</a>
93         [% IF memberloop %]
94             <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid | uri %]&amp;op=delete"><i class="fa fa-trash-can"></i> Delete all</a>
95         [% END %]
96     </p>
97 </li>
98
99         <li><label for="notes">Notes:</label><textarea name="notes" id="notes" rows="3" cols="50">[% routingnotes | html %]</textarea></li>
100         </ol>
101
102 </fieldset>
103 <fieldset class="action"><input type="submit" name="submit" class="btn btn-primary" value="Save" /></fieldset>
104 </form>
105
106             </main>
107         </div> <!-- /.col-sm-10.col-sm-push-2 -->
108
109         <div class="col-sm-2 col-sm-pull-10">
110             <aside>
111                 [% INCLUDE 'serials-menu.inc' %]
112             </aside>
113         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
114      </div> <!-- /.row -->
115 [% MACRO jsinclude BLOCK %]
116     <script>
117         $(document).ready(function(){
118             $("#add_recipients").on("click",function(e){
119                 e.preventDefault();
120                 userPopup();
121             });
122             $(".itemrank").on("change",function(){
123                 var subscriptionid = $(this).data("subscriptionid");
124                 var routingid = $(this).data("routingid");
125                 reorder_item( subscriptionid, routingid, $(this).val());
126             });
127         });
128         function reorder_item(sid,rid,rank){
129             var mylocation = 'reorder_members.pl?subscriptionid='+sid+'&routingid='+rid+'&rank='+rank;
130             window.location.href=mylocation;
131         }
132
133         function userPopup() {
134             window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,category,branch,action&selection_type=add",
135                 'PatronPopup',
136                 'width=1024,height=768,scrollbars=yes,toolbar=no,'
137                 + 'scrollbars=yes,resize=yes'
138             );
139         }
140
141         function add_user(borrowernumber) {
142             var myurl = "/cgi-bin/koha/serials/routing.pl?subscriptionid="+[% subscriptionid | html %]+"&borrowernumber="+borrowernumber+"&op=add";
143             window.location.href = myurl;
144         }
145     </script>
146 [% END %]
147
148 [% INCLUDE 'intranet-bottom.inc' %]