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