Bug 27846: (follow-up) Add id back to breadcrumbs container
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / serials-collection.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Serials &rsaquo; Serial collection information for [% bibliotitle | html %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="ser_serials-collection" class="ser">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'serials-search.inc' %]
15
16 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
17     <ol>
18         <li>
19             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
20         </li>
21         <li>
22             <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
23         </li>
24         <li>
25             <a href="#" aria-current="page">
26                 Serial collection information for <em>[% bibliotitle | html %]</em>
27             </a>
28         </li>
29     </ol>
30 </nav>
31
32 <div class="main container-fluid">
33     <div class="row">
34         <div class="col-sm-10 col-sm-push-2">
35             <main>
36
37     [% INCLUDE 'modals/serials_multi_receiving.inc' %]
38
39 [% UNLESS ( popup ) %]
40         [% INCLUDE 'serials-toolbar.inc' %]
41
42     <h1>Serial collection information for  <em>[% bibliotitle | html %]</em>
43         [% IF location %] ([% AuthorisedValues.GetByCode( 'LOC', location ) | html %]) [% END %]
44                 [% IF ( callnumber ) %]callnumber: [% callnumber | html %][% END %]</h1>
45 [% END %]
46
47 [% IF ( delete ) %]
48     <div class="dialog alert">
49         <h3>You are about to delete [% serialnumber | html %] serial(s). Do you want to continue?</h3>
50         <form action="/cgi-bin/koha/serials/serials-collection.pl/#">
51             [% IF countitems > 0 %]
52                 <h5>Number of items available: [% countitems | html %]</h5>
53                 <p>
54                   <label>Delete associated items? <input type="checkbox" name="delitems" value="Yes" />Yes</label>
55                 </p>
56             [% END %]
57             <input type="hidden" name="op" value="delete_confirmed" />
58             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
59             <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
60             [% FOREACH serialid IN serialsid %]
61                 <input type="hidden" name="serialid" value="[% serialid | html %]" />
62             [% END %]
63             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
64         </form>
65         <form action="/cgi-bin/koha/serials/serials-collection.pl">
66             <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
67             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
68         </form>
69     </div>
70 [% END %]
71
72 [% IF ( error_delitem ) %]
73     <div class="dialog alert">
74         <p><strong>Error</strong>: one or more associated items could not be deleted at this time.</p>
75     </div>
76 [% END %]
77
78 [% IF ( subscriptions ) %]
79 <table>
80 [% IF ( subscriptions.size == 1 ) %]
81 <caption> Subscription summary</caption>
82 [% ELSE %]
83 <caption> Subscription summaries</caption>
84 [% END %]
85 <tr>
86   <th>Subscription num.</th>
87   <th>Frequency</th>
88   <th>Numbering pattern</th>
89   <th>Library</th>
90   <th>Call number</th>
91   <th>Notes</th>
92   <th>&nbsp;</th>
93 </tr>
94 [% FOREACH subscription IN subscriptions %]
95     <tr>
96         <td><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]"># [% subscription.subscriptionid | html %]</a> </td>
97         <td>[% subscription.frequency.description | html %]</td>
98         <td>[% subscription.numberpattern.label | html %]</td>
99         <td>[% IF subscription.branchcode %][% Branches.GetName( subscription.branchcode ) | html %][% END %]</td>
100         <td> [% subscription.callnumber | html %]</td>
101         <td> [% subscription.notes | html | html_line_break %]
102             [% UNLESS subscription.closed %]
103                 [% IF ( subscription.subscriptionexpired ) %]
104                     <br /><span class="problem"> Subscription expired</span>
105                 [% END %]
106             [% ELSE %]
107                 <br /> Subscription closed
108             [% END %]
109         </td>
110         [% IF ( subscription.abouttoexpire ) || ( subscription.subscriptionexpired ) %]<td class="problem actions">[% ELSE %]<td class="actions">[% END %]
111         [% UNLESS subscription.closed %]
112             [% IF ( routing && CAN_user_serials_routing ) %]
113                 [% IF ( subscription.hasRouting ) %]
114                     <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | html %]"><i class="fa fa-pencil"></i> Edit routing list</a>
115                 [% ELSE %]
116                     <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | html %]&amp;op=new"><i class="fa fa-plus"></i> Create routing list</a>
117                 [% END %]
118             [% END %]
119             [% IF ( subscription.abouttoexpire || subscription.subscriptionexpired) %]
120                 <a class="btn btn-default btn-xs subscription_renew" data-subscriptionid="[% subscription.subscriptionid | html %]" href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid | html %]"><i class="fa fa-refresh"></i> Renew</a>
121             [% END %]
122         [% ELSE %]
123             &nbsp;
124         [% END %]
125         </td>
126       </tr>
127 [% END %]
128 [% IF ( subscr ) %]
129 [% IF ( subscriptioncount > 1 ) %]
130 <tr ><td colspan="8">  <a href="serials-collection.pl?biblionumber=[% biblionumber | uri %]">See any subscription attached to this biblio</a></td>
131 </tr>
132 [% END %]
133 [% END %]
134 </table>
135 [% END %]
136
137
138 [% IF ( years ) %]<form name="edition" action="serials-edit.pl" method="post">
139 <div id="subscription_years" class="toptabs numbered">
140 <ul>
141         [% FOREACH year IN years %]
142         [% IF ( year.year ) %]
143             [% IF year.year == 'manage' %]
144                 <li><a href="#subscription-year-manage">Manage</a></li>
145             [% ELSE %]
146                 <li><a href="#subscription-year-[% year.year | uri %]">[% year.year | html %]</a></li>
147             [% END %]
148         [% END %]
149     [% END %]
150 </ul>
151
152  [% FOREACH year IN years %]
153 <div id="subscription-year-[% year.year | html %]">
154     [% IF ( CAN_user_serials_receive_serials ) %]
155         <p>
156             <div class="btn-group"><input type="submit" value="Edit serials" class="btn btn-default btn-sm" /></div>
157             [% UNLESS subscription.closed %]
158                 <div class="btn-group">
159                     <input type="button" value="Generate next" data-subscriptionid="[% subscriptionidlist | html %]" class="btn btn-default btn-sm generatenext" />
160                 </div>
161                 [% IF ( subscriptions.size == 1 and !serialsadditems ) %]&nbsp;
162                     <div class="btn-group"><input type="button" value="Multi receiving" href="#multi_receiving" class="btn btn-default btn-sm" data-toggle="modal"></div>
163                 [% END %]
164             [% END %]
165             <input type="button" value="Delete selected issues" class="delete-issues btn btn-default btn-sm" data-subscriptionids="[% subscriptionidlist | html %]" />
166         </p>
167     [% END %]
168       <span class="checkall">
169         <a class="CheckAll" href="#" data-year="[% year.year | html %]">Select all</a>
170       </span> |
171       <span class="clearall">
172         <a class="CheckNone" href="#" data-year="[% year.year | html %]">Clear all</a>
173       </span>
174         <table class="subscription-year-table">
175           <thead>
176             <tr>
177                 [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
178 [% IF ( subscriptions.size > 1 ) %]
179                 <th># Subs</th>
180 [% END %]
181                 <th class="title-string">Date published
182                 </th>
183                 <th class="title-string">Date published (text)
184                 </th>
185                 <th class="title-string">Date received
186                 </th>
187                 <th>Number
188                 </th>
189                 <th>Status
190                 </th>
191                 <th>Notes
192                 </th>
193                 <th>Library
194                 </th>
195                 [% IF ( routing ) %]<th>Routing</th>[% END %]
196             </tr>
197           </thead>
198           <tbody>
199       [% FOREACH serial IN year.serials %]
200         <tr>
201             [% IF ( CAN_user_serials_receive_serials ) %]
202                 <td>
203                   [% UNLESS CAN_user_serials_receive_serials %]
204                     disabled
205                   [% ELSE %]
206                     [% IF ( serial.subscriptionexpired ) %]
207                     <input type="checkbox" name="serialid" value="[% serial.serialid | html %]" disabled="disabled" />
208                     [% ELSE %]
209                       [% IF ( delete ) %]
210                         [% IF serialsid.grep("${serial.serialid}").size %]
211                           <input type="checkbox" name="serialid" value="[% serial.serialid | html %]" disabled checked />
212                         [% ELSE %]
213                           <input type="checkbox" name="serialid" value="[% serial.serialid | html %]" disabled />
214                         [% END %]
215                       [% ELSE %]
216                         [% IF serial.checked %]
217                           <input type="checkbox" name="serialid" value="[% serial.serialid | html %]" checked />
218                         [% ELSE %]
219                           <input type="checkbox" name="serialid" value="[% serial.serialid | html %]" />
220                         [% END %]
221                       [% END %]
222                     [% END %]
223                   [% END %]
224                 </td>
225             [% END %]
226 [% IF ( subscriptions.size > 1 ) %]
227                  <td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid | uri %]">[% serial.subscriptionid | html %]</a></td>
228 [% END %]
229                 <td>
230                     <span title="[% serial.publisheddate | html %]">
231                       [% IF serial.publisheddate %]
232                         [% serial.publisheddate | $KohaDates %]
233                       [% ELSE %]
234                         Unknown
235                       [% END %]
236                     </span>
237                 </td>
238                 <td>
239                    [% IF serial.publisheddatetext %]
240                       <span title="[% serial.publisheddatetext | html %]">
241                         [% serial.publisheddatetext | html %]
242                       </span>
243                    [% END %]
244                 </td>
245                 <td>
246                     <span title="[% serial.planneddate | html %]">
247                       [% IF serial.planneddate %]
248                         [% serial.planneddate | $KohaDates %]
249                       [% ELSE %]
250                         Unknown
251                       [% END %]
252                     </span>
253                 </td>
254                 <td>
255                     [% IF ( matches = serial.serialseq.match('(.*)Spring(.*)') ) %]
256                         [% matches.0 | html %]Spring[% matches.1 | html %]
257                     [% ELSIF ( matches = serial.serialseq.match('(.*)Summer(.*)') ) %]
258                         [% matches.0 | html %]Summer[% matches.1 | html %]
259                     [% ELSIF ( matches = serial.serialseq.match('(.*)Fall(.*)') ) %]
260                         [% matches.0 | html %]Fall[% matches.1 | html %]
261                     [% ELSIF ( matches = serial.serialseq.match('(.*)Winter(.*)') ) %]
262                         [% matches.0 | html %]Winter[% matches.1 | html %]
263                     [% ELSIF ( matches = prediction.number.match('(.*)Spr(.*)') ) %]
264                         [% matches.0 | html %]Spr[% matches.1 | html %]
265                     [% ELSIF ( matches = prediction.number.match('(.*)Sum(.*)') ) %]
266                         [% matches.0 | html %]Sum[% matches.1 | html %]
267                     [% ELSIF ( matches = prediction.number.match('(.*)Fal(.*)') ) %]
268                         [% matches.0 | html %]Fal[% matches.1 | html %]
269                     [% ELSIF ( matches = prediction.number.match('(.*)Win(.*)') ) %]
270                         [% matches.0 | html %]Win[% matches.1 | html %]
271                     [% ELSE %]
272                         [% serial.serialseq | html %]
273                     [% END %]
274                 </td>
275                 <td>
276                     [% IF ( serial.status1 ) %]Expected[% END %]
277                     [% IF ( serial.status2 ) %]Arrived[% END %]
278                     [% IF ( serial.status3 ) %]Late[% END %]
279                     [% IF ( serial.status4 ) %]Missing[% END %]
280                     [% IF ( serial.status41 ) %]Missing (never received)[% END %]
281                     [% IF ( serial.status42 ) %]Missing (sold out)[% END %]
282                     [% IF ( serial.status43 ) %]Missing (damaged)[% END %]
283                     [% IF ( serial.status44 ) %]Missing (lost)[% END %]
284                     [% IF ( serial.status5 ) %]Not issued[% END %]
285                     [% IF ( serial.status6 ) %]Delete[% END %]
286                     [% IF ( serial.status7 ) %]Claimed[% END %]
287                     [% IF ( serial.status8 ) %]Stopped[% END %]
288                 </td>
289                 <td>
290                     [% serial.notes | html %]
291                 </td>
292                 <td>
293                     [% Branches.GetName( serial.branchcode ) | html %]
294                 </td>
295                 [% IF ( routing ) %]
296                 <td class="actions">
297                     <a href="/cgi-bin/koha/serials/routing-preview.pl?ok=1&amp;subscriptionid=[% serial.subscriptionid | uri %]&amp;issue=[% serial.serialseq.replace("'", "\\'") | uri %]%20([% serial.publisheddate | $KohaDates %])" class="btn btn-default btn-xs print_list"><i class="fa fa-print"></i> Print list</a>
298                 </td>
299                 [% END %]
300             </tr>
301           [% END %]
302         </tbody>
303       </table>
304     </div>
305     [% END %]
306   <input type="hidden" name="subscriptionid" value="[% subscriptionidlist | html %]" />
307
308 </div>
309 </form>
310 [% END %]
311
312             </main>
313         </div> <!-- /.col-sm-10.col-sm-push-2 -->
314
315         <div class="col-sm-2 col-sm-pull-10">
316             <aside>
317                 [% INCLUDE 'serials-menu.inc' %]
318             </aside>
319         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
320      </div> <!-- /.row -->
321
322 [% MACRO jsinclude BLOCK %]
323     [% INCLUDE 'datatables.inc' %]
324     <script>
325         var subscriptionid = "[% subscriptionid | html %]";
326     </script>
327     [% Asset.js("js/serials-toolbar.js") | $raw %]
328
329     <script>
330
331         function deleteIssues(subscriptionid) {
332             var serialschecked = $("form[name='edition'] input[name='serialid']:checked");
333             if (serialschecked.length > 0) {
334                 var location = 'serials-collection.pl?subscriptionid='+subscriptionid+'&op=delete_confirm';
335                 for (i=0; i < serialschecked.length; i++) {
336                     location += '&serialid=' + serialschecked[i].value;
337                 }
338                 document.location = location;
339             } else {
340                 alert(_("No serials selected"));
341             }
342         }
343
344         function generateNext(subscriptionid) {
345             if(confirm(_("Do you really want to generate next serial?"))){
346                 document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid;
347             }
348         }
349
350         $(document).ready(function() {
351             $('#subscription_years').tabs();
352             $(".subscription-year-table").dataTable($.extend(true, {}, dataTablesDefaults, {
353                 "aoColumnDefs": [
354                     { "aTargets": [ 0,-1 ], "bSortable": false, "bSearchable": false },
355                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
356                 ],
357                 "aaSorting": [[0, 'desc']],
358                 "sDom": 't',
359                 "bAutoWidth": false,
360                 "bPaginate": false,
361                 "bInfo": false,
362                 "bFilter": false,
363             } ));
364
365             $(".CheckAll").on("click", function(e){
366                 e.preventDefault();
367                 var years = $(this).data("year");
368                 $("#subscription-year-" + years + " input:checkbox").prop("checked", true );
369             });
370
371             $(".CheckNone").on("click", function(e){
372                 e.preventDefault();
373                 var years = $(this).data("year");
374                 $("#subscription-year-" + years + " input:checkbox").prop("checked", false );
375             });
376
377             $(".generatenext").on("click", function(e){
378                 e.preventDefault();
379                 var subscriptionid = $(this).data("subscriptionid");
380                 generateNext( subscriptionid );
381             });
382
383             $(".subscription_renew").on("click", function(e){
384                 e.preventDefault();
385                 var subscriptionid = $(this).data("subscriptionid");
386                 popup( subscriptionid );
387             });
388
389             $(".print_list").on("click", function(e){
390                 e.preventDefault();
391                 var url = $(this).attr("href");
392                 window.open( url,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
393             });
394
395             $('#multi_receiving').on('show', function () {
396                $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
397             });
398
399             $("form[name='edition']").on('submit', function(e){
400                 if ( $(this).find("input[name='serialid']:checked").size() == 0 ) {
401                     e.preventDefault();
402                     alert(_("You must select at least one serial to edit"));
403                     return 0;
404                 }
405                 return 1;
406             });
407
408             $(".delete-issues").on("click", function(e){
409                 e.preventDefault();
410                 deleteIssues("[% subscriptionidlist | html %]");
411             });
412         });
413
414     </script>
415 [% END %]
416
417 [% INCLUDE 'intranet-bottom.inc' %]