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