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