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