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