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