Bug 22015: Move DataTables CSS to global include
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-detail.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE AuthorisedValues %]
7 [% USE Price %]
8 [% USE ColumnsSettings %]
9 [% SET footerjs = 1 %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Koha &rsaquo; Serials &rsaquo; Details for subscription #[% subscriptionid | html %]</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
14 </head>
15
16 <body id="ser_subscription-detail" class="ser">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'serials-search.inc' %]
19
20 <div id="breadcrumbs">
21     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22     &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
23     [% UNLESS blocking_error %]&rsaquo; Details for subscription #[% subscriptionid | html %][% END %]
24 </div>
25
26 <div class="main container-fluid">
27     <div class="row">
28         <div class="col-sm-10 col-sm-push-2">
29             <main>
30
31     [% INCLUDE 'serials-toolbar.inc' %]
32
33     <h1>Subscription for [% bibliotitle | html %] [% IF closed %](closed)[% END %]</h1>
34     [% IF ( abouttoexpire ) %]
35       [% UNLESS closed %]
36         <div class="dialog message">Subscription will expire [% enddate | html %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>
37       [% END %]
38     [% END %]
39     [% IF ( NEEDSCONFIRMATION ) %]
40     <div id="circ_needsconfirmation" class="dialog alert">
41         <h3>Please confirm subscription deletion</h3>
42
43                         <ul>
44                         [% IF ( NOTEXPIRED ) %] <li>The subscription has not expired yet</li> [% END %] 
45                         [% IF ( LINKEDISSUES ) %] <li>The subscription has linked issues</li> [% END %]
46                         [% IF ( LINKEDITEMS ) %] <li>The subscription has linked items<br /> Those items won't be deleted</li> [% END %]
47                         </ul>
48                         <form method="post" action="/cgi-bin/koha/serials/subscription-detail.pl">
49                         <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
50                         <input type="hidden" name="issueconfirmed" value="1" />
51                         <input type="hidden" name="op" value="del" />
52             <button type="submit" class="approve" accesskey="y"><i class="fa fa-fw fa-check"></i> Yes, delete (Y)</button>
53                         </form>
54                         <form method="get" action="/cgi-bin/koha/serials/subscription-detail.pl">
55                         <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
56             <button type="submit" class="deny" accesskey="n"><i class="fa fa-fw fa-remove"></i> No, don't delete (N)</button>
57                         </form>
58
59         </div>
60     [% END %] <!-- NEEDSCONFIRMATION -->
61     [% IF mana_code.defined %]
62         <div id="alert-community" class="dialog message">
63             <p>
64                 [% mana_code | html %]
65             </p>
66         </div>
67     [% END %]
68
69 <div id="subscription_description" class="toptabs">
70 <ul class="ui-tabs-nav">
71     <li><a href="#subscription_info">Information</a></li>
72     <li><a href="#subscription_planning">Planning</a></li>
73     <li><a href="#subscription_issues">Issues</a></li>
74     <li><a href="#subscription_summary">Summary</a></li>
75     [% IF orders_grouped.size %]
76         <li>
77             <a href="#acquisition_details">Acquisition details</a>
78         </li>
79     [% END %]
80 </ul>
81
82 <div id="subscription_info">
83     <div class="row">
84     <div class="col-sm-6">
85     <div class="rows">
86                 <ol>
87                 <li><span class="label">Subscription ID: </span>[% subscriptionid | html %]</li>
88         <li><span class="label">Librarian identity:</span> [% librarian | html %]</li>
89         <li><span class="label">Vendor:</span> <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% aqbooksellerid | uri %]">[% aqbooksellername | html %]</a></li>
90         <li><span class="label">Biblio:</span>  <a href="/cgi-bin/koha/catalogue/[% default_bib_view | uri %].pl?biblionumber=[% bibnum | uri %]">[% bibliotitle | html %]</a> <i>([% bibnum | html %])</i></li>
91         [% IF ( OPACBaseURL ) %]
92             <li>
93                 <span class="label">OPAC view:</span>
94                 <a id="view-subscription-in-opac" target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">Open in new window.</a>
95             </li>
96         [% END %]
97 [% IF ( branchcode ) %]<li><span class="label">Library:</span> [% Branches.GetName( branchcode ) | html %]</li>[% END %]
98         [% IF ( serialsadditems ) %]
99             <li><span class="label">Items:</span> Serial receipt creates an item record.</li>
100         [% ELSE %]
101             <li><span class="label">Items:</span> Serial receipt does not create an item record.</li>
102         [% END %]
103         <li>
104             <span class="label">Serial number:</span>
105             [% IF skip_serialseq %]
106                 Serial number is skipped when an irregularity is found.
107             [% ELSE %]
108                 Serial number is kept when an irregularity is found.
109             [% END %]
110         </li>
111         <li><span class="label">Grace period:</span> [% graceperiod | html %]</li>
112         </ol>
113     </div>
114     </div>
115     <div class="col-sm-6">
116     <div class="rows">
117         <ol>
118         [% IF ( location ) %]<li><span class="label">Location:</span> [% location | html %]</li>[% END %]
119         [% IF ( callnumber ) %]<li><span class="label">Call number:</span> [% callnumber | html %]</li>[% END %]
120                 [% IF ( staffdisplaycount ) %]<li><span class="label">Number of issues to display to staff:</span>[% staffdisplaycount | html %]</li>[% END %]
121         [% IF ( opacdisplaycount ) %]<li><span class="label">Number of issues to display in OPAC:</span>[% opacdisplaycount | html %]</li>[% END %]
122         [% IF ( letter ) %]
123             <li>
124                 <span class="label">Patron notification:</span> [% letter | html %]
125                 (<a href="/cgi-bin/koha/serials/viewalerts.pl?subscriptionid=[% subscriptionid | uri %]">subscribers</a>)
126             </li>
127         [% END %]
128         [% IF ( hasRouting ) %]<li><span class="label">Routing:</span> yes</li>[% END %]
129      </ol>
130      </div>
131      </div>
132      </div>
133
134     [% IF additional_fields_for_subscription %]
135     <hr>
136     <div class="row">
137       <div class="col-sm-6">
138         <h3>Additional fields:</h3>
139         <div class="rows">
140           <ol>
141             [% FOR field IN additional_fields_for_subscription %]
142               <li>
143                 <span class="label">[% field.name | html %]:</span>
144                 [% IF field.authorised_value_category %]
145                   [% AuthorisedValues.GetByCode( field.authorised_value_category, additional_fields.${field.name} ) | html %]
146                 [% ELSE %]
147                   [% additional_fields.${field.name} | html %]
148                 [% END %]
149               </li>
150             [% END %]
151           </ol>
152         </div>
153       </div>
154       </div>
155      [% END %]
156 </div>
157
158     <div id="subscription_planning">
159     <div class="row">
160     <div class="col-sm-12">
161     <div class="rows">
162         <ol>
163             <li><span class="label">Beginning date:</span> [% startdate | html %]
164             </li>
165             <li><span class="label">Frequency:</span>
166                 [% frequency.description | html %]
167             </li>
168             <li>
169               <span class="label">Manual history: </span>
170                 [% IF ( manualhistory ) %]
171                     Enabled <a href="/cgi-bin/koha/serials/subscription-history.pl?subscriptionid=[% subscriptionid | uri %]">Edit history</a>
172                 [% ELSE %]
173                     Disabled
174                 [% END %]
175             </li>
176             <li><span class="label">Number pattern:</span>
177                 [% numberpattern.label | html %]
178             </li>
179             <li><table>
180             <tr>
181                 <td>Starting with:</td>
182                 [% IF (has_X) %]
183                     <td align="center">[% lastvalue1 | html %]</td>
184                 [% END %]
185                 [% IF (has_Y) %]
186                     <td align="center">[% lastvalue2 | html %]</td>
187                 [% END %]
188                 [% IF (has_Z) %]
189                     <td align="center">[% lastvalue3 | html %]</td>
190                 [% END %]
191             </tr>
192             <tr>
193                 <td>Rollover:</td>
194                 [% IF (has_X) %]
195                     <td align="center">[% numberpattern.whenmorethan1 | html %]</td>
196                 [% END %]
197                 [% IF (has_Y) %]
198                     <td align="center">[% numberpattern.whenmorethan2 | html %]</td>
199                 [% END %]
200                 [% IF (has_Z) %]
201                     <td align="center">[% numberpattern.whenmorethan3 | html %]</td>
202                 [% END %]
203             </tr>
204             </table></li>
205             [% IF ( irregular_issues ) %]
206             <li><span class="label">Irregularity:</span> [% irregular_issues | html %] issues
207             </li>
208             [% END %]
209             <li><span class="label">First arrival:</span> [% firstacquidate | html %]
210             </li>
211         [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength | html %]</li>[% END %]
212         [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength | html %]</li>[% END %]
213         [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength | html %]</li>[% END %]
214         </ol>
215     </div>
216     </div>
217     </div>
218     </div>
219     <div id="subscription_numbering" style="display:none;">
220         <h3>Numbering calculation</h3>
221         <p><label>Numbering formula:</label> [% numberingmethod | html %]</p>
222         <table>
223             <tr>
224                 <th>&nbsp;</th>
225                 <th>X</th>
226                 <th>Y</th>
227                 <th>Z</th>
228                 </tr>
229                 <tr>
230                     <td>Add</td>
231                     <td>
232                         [% add1 | html %]
233                     </td>
234                     <td>
235                         [% add2 | html %]
236                     </td>
237                     <td>
238                         [% add3 | html %]
239                     </td>
240                 </tr>
241                 <tr>
242                     <td>once every</td>
243                     <td>[% every1 | html %]</td>
244                     <td>[% every2 | html %]</td>
245                     <td>[% every3 | html %]</td>
246                 </tr>
247                 <tr>
248                     <td>When more than</td>
249                     <td>[% whenmorethan1 | html %] [% IF ( innerloop1 ) %]<br />
250                         <i>(is [% innerloop1 | html %])</i>[% END %]</td>
251                     <td>[% whenmorethan2 | html %] [% IF ( innerloop2 ) %]<br />
252                         <i>(is [% innerloop2 | html %])</i>[% END %]</td>
253                     <td>[% whenmorethan3 | html %] [% IF ( innerloop3 ) %]<br />
254                         <i>(is [% innerloop3 | html %])</i>[% END %]</td>
255                 </tr>
256                 <tr>
257                     <td>Set back to</td>
258                     <td>[% setto1 | html %]</td>
259                     <td>[% setto2 | html %]</td>
260                     <td>[% setto3 | html %]</td>
261                 </tr>
262                 <tr>
263                     <td>
264                             Inner counter
265                     </td>
266                     <td>[% innerloop1 | html %]</td>
267                     <td>[% innerloop2 | html %]</td>
268                     <td>[% innerloop3 | html %]</td>
269                 </tr>
270                 <tr>
271                     <td>
272                             Last value
273                     </td>
274                     <td>[% lastvalue1 | html %]</td>
275                     <td>[% lastvalue2 | html %]</td>
276                     <td>[% lastvalue3 | html %]</td>
277                 </tr>
278             </table>
279     </div>
280     <div id="subscription_issues">
281         <table>
282         <tr>
283             <th>Issue number</th>
284             <th>Planned date</th>
285             <th>Published date</th>
286             <th>Published date (text)</th>
287             <th>Status</th>
288         </tr>
289         [% FOREACH serialslis IN serialslist %]
290             <tr>
291                 <td>
292                     [% serialslis.serialseq | html %]
293                 </td>
294                 <td>
295                     [% IF serialslis.planneddate %]
296                       [% serialslis.planneddate | html %]
297                     [% ELSE %]
298                       Unknown
299                     [% END %]
300                 </td>
301                 <td>
302                     [% IF serialslis.publisheddate %]
303                       [% serialslis.publisheddate | html %]
304                     [% ELSE %]
305                       Unknown
306                     [% END %]
307                 </td>
308                 <td>
309                     [% serialslis.publisheddatetext | html %]
310                 </td>
311                 <td>
312                     [% IF ( serialslis.status1 ) %]Expected[% END %]
313                     [% IF ( serialslis.status2 ) %]Arrived[% END %]
314                     [% IF ( serialslis.status3 ) %]Late[% END %]
315                     [% IF ( serialslis.status4 ) %]Missing[% END %]
316                     [% IF ( serialslis.status41 ) %]Missing (never received)[% END %]
317                     [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %]
318                     [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %]
319                     [% IF ( serialslis.status44 ) %]Missing (lost)[% END %]
320                     [% IF ( serialslis.status5 ) %]Not issued[% END %]
321                     [% IF ( serialslis.status6 ) %]Delete[% END %]
322                     [% IF ( serialslis.status7 ) %]
323                       Claimed
324                       [% IF ( serialslis.claimdate ) %]
325                         [% serialslis.claimdate | html %]
326                       [% END %]
327                     [% END %]
328                     [% IF ( serialslis.status8 ) %]Stopped[% END %]
329                 </td>
330             </tr>
331         [% END %]
332         </table>
333     </div>
334     <div id="subscription_summary">
335     <div class="row">
336     <div class="col-sm-12">
337     <div class="rows">
338         <ol>
339             <li><span class="label">Start date:</span> [% startdate | html %] </li>
340             <li><span class="label">End date:</span> [% enddate | html %]</li>
341             <li><span class="label">History start date:</span> [% histstartdate | html %] </li>
342             <li><span class="label">History end date:</span> [% histenddate | html %]</li>
343             <li><span class="label">Received issues:</span>[% recievedlist | html %]</li>
344             <li><span class="label">Missing issues:</span>[% missinglist | html %]</li>
345             <li><span class="label">Nonpublic note:</span>[% internalnotes | html | html_line_break %]</li>
346             <li><span class="label">Public note:</span>[% notes | html | html_line_break %]</li>
347             <li><span class="label">History staff note:</span>[% librariannote | html | html_line_break %]</li>
348             <li><span class="label">History OPAC note:</span>[% opacnote | html | html_line_break %]</li>
349         </ol>
350     </div>
351     </div>
352     </div>
353     </div>
354
355     [% IF orders_grouped.size %]
356         <div id="acquisition_details">
357             <h2>Acquisition details</h2>
358             <table id="orders">
359                 <caption>
360                   <span class="actions">
361                   <a href="#" id="hide_received_orders">Hide already received orders</a>
362                   | <a href="#" id="show_all_orders">Show all orders</a></span>
363                 </caption>
364
365                 <thead>
366                     <tr>
367                         <th>Invoice</th>
368                         <th>Basket</th>
369                         <th>Order number</th>
370                         <th class="title-string">Creation date</th>
371                         <th class="title-string">Receive date</th>
372                         <th class="title-string">Status</th>
373                         <th>Internal note</th>
374                         <th>Vendor note</th>
375                         <th>Fund</th>
376                         <th>Quantity</th>
377                         <th title="ecost tax exc. / ecost tax inc.">Ordered</th>
378                         <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
379                     </tr>
380                 </thead>
381                 <tbody>
382                 [% FOR ordernumber IN orders_grouped.keys %]
383                     [% SET parent_tree_id = loop.count %]
384                     [% SET parent_order = orders_grouped.$ordernumber %]
385                     <tr data-tt-id="[% parent_tree_id | html %]" class="highlighted-row">
386                         <td></td> [%# invoice %]
387                         <td>
388                             [% IF CAN_user_acquisition_order_manage %]
389                                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basket.basketno | uri %]">[% parent_order.basket.basketname | html %] ([% parent_order.basket.basketno | html %])</a>
390                             [% ELSE %]
391                                 [% parent_order.basket.basketname | html %] ([% parent_order.basket.basketno | html %])
392                             [% END %]
393                         </td>
394                         <td></td> [%# ordernumber %]
395                         <td>[% parent_order.basket.creationdate | $KohaDates %]</td>
396                         <td>[% parent_order.datereceived | $KohaDates %]</td>
397                         <td>
398                           [% SWITCH parent_order.orderstatus %]
399                             [% CASE 'new' %]<span title="status_1">New</span>
400                             [% CASE 'ordered' %]<span title="status_2">Ordered</span>
401                             [% CASE 'partial' %]<span title="status_3">Partial</span>
402                             [% CASE 'complete' %]<span title="status_4">Complete</span>
403                             [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
404                           [% END %]
405                         </td>
406                         <td></td> [%# internalnote %]
407                         <td></td> [%# vendornote %]
408                         <td></td> [%# fund %]
409                         <td>[% parent_order.quantity | html %]</td>
410                         <td>[% parent_order.ecost_tax_excluded | $Price %] / [% parent_order.ecost_tax_included | $Price %]</td>
411                         <td>[% parent_order.unitprice_tax_excluded | $Price %] / [% parent_order.unitprice_tax_included | $Price %]</td>
412                     </tr>
413                     [% FOR order IN parent_order.orders %]
414                         <tr data-tt-id="0" data-tt-parent-id="[% parent_tree_id | html %]">
415                         <td>
416                         [% IF order.invoice %]
417                             [% IF CAN_user_acquisition %]
418                                 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]" title="Invoice detail page">
419                                    [% order.invoice.invoicenumber | html %]</a>
420                             [% ELSE %]
421                                 [% order.invoice.invoicenumber | html %]
422                             [% END %]
423                         [% END %]
424                         </td>
425                         <td></td> [%# basket %]
426                         <td>[% order.ordernumber | html %]</td>
427                         <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
428                         <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
429                         <td>
430                           [% SWITCH order.orderstatus %]
431                             [% CASE 'new' %]<span title="status_1">New</span>
432                             [% CASE 'ordered' %]<span title="status_2">Ordered</span>
433                             [% CASE 'partial' %]<span title="status_3">Partial</span>
434                             [% CASE 'complete' %]<span title="status_4">Complete</span>
435                             [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
436                           [% END %]
437                         </td>
438                         <td>[% order.order_internalnote | html %]</td>
439                         <td>[% order.order_vendornote | html %]</td>
440                         <td>[% order.fund.budget_name | html %]</td>
441                         <td>[% order.quantity | html %]</td>
442                         <td>
443                             [% UNLESS order.datereceived %]
444                                 [% order.ecost_tax_excluded * order.quantity | $Price %] / [% order.ecost_tax_included * order.quantity | $Price %]
445                             [% END %]
446                         </td>
447                         <td>
448                             [% IF order.datereceived %]
449                                 [%# FIXME What if unitprice has not been filled? %]
450                                 [% order.unitprice_tax_excluded * order.quantity | $Price %] / [% order.unitprice_tax_included * order.quantity | $Price %]
451                             [% END %]
452                         </td>
453                     </tr>
454                     [% END %]
455                 [% END %]
456                 </tbody>
457             </table>
458           </div>
459       [% END %]
460
461             </main>
462         </div> <!-- /.col-sm-10.col-sm-push-2 -->
463
464         <div class="col-sm-2 col-sm-pull-10">
465             <aside>
466                 [% INCLUDE 'serials-menu.inc' %]
467             </aside>
468         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
469      </div> <!-- /.row -->
470
471 [% MACRO jsinclude BLOCK %]
472     <script>
473         var subscriptionid = "[% subscriptionid | html %]";
474         var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
475         var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
476         var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
477     </script>
478     [% INCLUDE 'mana.inc' %]
479     [% Asset.js("js/serials-toolbar.js") | $raw %]
480     [% INCLUDE 'datatables.inc' %]
481     [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
482     [% INCLUDE 'columns_settings.inc' %]
483     <script>
484         // the english words used in display purposes
485         var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern",
486         "Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
487         $(document).ready(function() {
488             $("#subscription_description").tabs();
489             $("#renewsub").click(function(){
490                 popup([% subscriptionid | html %]);
491                 return false;
492             })
493
494             var columns_settings = [% ColumnsSettings.GetColumns( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
495             var table = KohaTable("orders", {
496                 "aoColumnDefs": [
497                     { "bVisible": false, "aTargets": [ 'NoVisible' ] },
498                     { "bSortable": false, "aTargets": ["_all"] },
499                     { "aTargets": "title-string", "sType": "title-string" }
500                 ],
501
502                 'bPaginate': false,
503                 'bAutoWidth': false,
504                 'bSort': false,
505             }, columns_settings);
506
507             [% IF orders_grouped.size %]
508                 $(table).treetable({
509                     expandable: true
510                 });
511                 $(table).treetable('expandAll');
512             [% END %]
513
514             $("#hide_received_orders").click(function(e){
515                 e.preventDefault();
516                 table.fnFilter( '^$', 4, true ); // Not empty "Receive date" columns
517             });
518             $("#show_all_orders").click(function(e){
519                 e.preventDefault();
520                 table.fnFilter( '', 4 ); // Not filter, display all columns
521             });
522             $("#show_all_orders").click();
523
524
525         });
526     </script>
527 [% END %]
528
529 [% INCLUDE 'intranet-bottom.inc' %]