Bug 15766: DBRev 18.06.00.044
[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 </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
62 <div id="subscription_description" class="toptabs">
63 <ul class="ui-tabs-nav">
64     <li><a href="#subscription_info">Information</a></li>
65     <li><a href="#subscription_planning">Planning</a></li>
66     <li><a href="#subscription_issues">Issues</a></li>
67     <li><a href="#subscription_summary">Summary</a></li>
68 </ul>
69
70 <div id="subscription_info">
71     <div class="row">
72     <div class="col-sm-6">
73     <div class="rows">
74                 <ol>
75                 <li><span class="label">Subscription ID: </span>[% subscriptionid | html %]</li>
76         <li><span class="label">Librarian identity:</span> [% librarian | html %]</li>
77         <li><span class="label">Vendor:</span> <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% aqbooksellerid | html %]">[% aqbooksellername | html %]</a></li>
78         <li><span class="label">Biblio:</span>  <a href="/cgi-bin/koha/catalogue/[% default_bib_view | html %].pl?biblionumber=[% bibnum | html %]">[% bibliotitle | html %]</a> <i>([% bibnum | html %])</i></li>
79         [% IF ( OPACBaseURL ) %]
80             <li>
81                 <span class="label">OPAC view:</span>
82                 <a id="view-subscription-in-opac" target="_blank" href="[% Koha.Preference('OPACBaseURL') | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]">Open in new window.</a>
83             </li>
84         [% END %]
85 [% IF ( branchcode ) %]<li><span class="label">Library:</span> [% Branches.GetName( branchcode ) | html %]</li>[% END %]
86         [% IF ( serialsadditems ) %]
87             <li><span class="label">Items:</span> Serial receipt creates an item record.</li>
88         [% ELSE %]
89             <li><span class="label">Items:</span> Serial receipt does not create an item record.</li>
90         [% END %]
91         <li>
92             <span class="label">Serial number:</span>
93             [% IF skip_serialseq %]
94                 Serial number is skipped when an irregularity is found.
95             [% ELSE %]
96                 Serial number is kept when an irregularity is found.
97             [% END %]
98         </li>
99         <li><span class="label">Grace period:</span> [% graceperiod | html %]</li>
100         </ol>
101     </div>
102     </div>
103     <div class="col-sm-6">
104     <div class="rows">
105         <ol>
106         [% IF ( location ) %]<li><span class="label">Location:</span> [% location | html %]</li>[% END %]
107         [% IF ( callnumber ) %]<li><span class="label">Call number:</span> [% callnumber | html %]</li>[% END %]
108                 [% IF ( staffdisplaycount ) %]<li><span class="label">Number of issues to display to staff:</span>[% staffdisplaycount | html %]</li>[% END %]
109         [% IF ( opacdisplaycount ) %]<li><span class="label">Number of issues to display in OPAC:</span>[% opacdisplaycount | html %]</li>[% END %]
110         [% IF ( letter ) %]
111             <li>
112                 <span class="label">Patron notification:</span> [% letter | html %]
113                 (<a href="/cgi-bin/koha/serials/viewalerts.pl?subscriptionid=[% subscriptionid | html %]">subscribers</a>)
114             </li>
115         [% END %]
116         [% IF ( hasRouting ) %]<li><span class="label">Routing:</span> yes</li>[% END %]
117      </ol>
118      </div>
119      </div>
120      </div>
121
122     [% IF additional_fields_for_subscription %]
123     <hr>
124     <div class="row">
125       <div class="col-sm-6">
126         <h3>Additional fields:</h3>
127         <div class="rows">
128           <ol>
129             [% FOR field IN additional_fields_for_subscription %]
130               <li>
131                 <span class="label">[% field.name | html %]:</span>
132                 [% IF field.authorised_value_category %]
133                   [% AuthorisedValues.GetByCode( field.authorised_value_category, additional_fields.${field.name} ) | html %]
134                 [% ELSE %]
135                   [% additional_fields.${field.name} | html %]
136                 [% END %]
137               </li>
138             [% END %]
139           </ol>
140         </div>
141       </div>
142       </div>
143      [% END %]
144 </div>
145
146     <div id="subscription_planning">
147     <div class="row">
148     <div class="col-sm-12">
149     <div class="rows">
150         <ol>
151             <li><span class="label">Beginning date:</span> [% startdate | html %]
152             </li>
153             <li><span class="label">Frequency:</span>
154                 [% frequency.description | html %]
155             </li>
156             <li>
157               <span class="label">Manual history: </span>
158                 [% IF ( manualhistory ) %]
159                     Enabled <a href="/cgi-bin/koha/serials/subscription-history.pl?subscriptionid=[% subscriptionid | html %]">Edit history</a>
160                 [% ELSE %]
161                     Disabled
162                 [% END %]
163             </li>
164             <li><span class="label">Number pattern:</span>
165                 [% numberpattern.label | html %]
166             </li>
167             <li><table>
168             <tr>
169                 <td>Starting with:</td>
170                 [% IF (has_X) %]
171                     <td align="center">[% lastvalue1 | html %]</td>
172                 [% END %]
173                 [% IF (has_Y) %]
174                     <td align="center">[% lastvalue2 | html %]</td>
175                 [% END %]
176                 [% IF (has_Z) %]
177                     <td align="center">[% lastvalue3 | html %]</td>
178                 [% END %]
179             </tr>
180             <tr>
181                 <td>Rollover:</td>
182                 [% IF (has_X) %]
183                     <td align="center">[% numberpattern.whenmorethan1 | html %]</td>
184                 [% END %]
185                 [% IF (has_Y) %]
186                     <td align="center">[% numberpattern.whenmorethan2 | html %]</td>
187                 [% END %]
188                 [% IF (has_Z) %]
189                     <td align="center">[% numberpattern.whenmorethan3 | html %]</td>
190                 [% END %]
191             </tr>
192             </table></li>
193             [% IF ( irregular_issues ) %]
194             <li><span class="label">Irregularity:</span> [% irregular_issues | html %] issues
195             </li>
196             [% END %]
197             <li><span class="label">First arrival:</span> [% firstacquidate | html %]
198             </li>
199         [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength | html %]</li>[% END %]
200         [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength | html %]</li>[% END %]
201         [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength | html %]</li>[% END %]
202         </ol>
203     </div>
204     </div>
205     </div>
206     </div>
207     <div id="subscription_numbering" style="display:none;">
208         <h3>Numbering calculation</h3>
209         <p><label>Numbering formula:</label> [% numberingmethod | html %]</p>
210         <table>
211             <tr>
212                 <th>&nbsp;</th>
213                 <th>X</th>
214                 <th>Y</th>
215                 <th>Z</th>
216                 </tr>
217                 <tr>
218                     <td>Add</td>
219                     <td>
220                         [% add1 | html %]
221                     </td>
222                     <td>
223                         [% add2 | html %]
224                     </td>
225                     <td>
226                         [% add3 | html %]
227                     </td>
228                 </tr>
229                 <tr>
230                     <td>once every</td>
231                     <td>[% every1 | html %]</td>
232                     <td>[% every2 | html %]</td>
233                     <td>[% every3 | html %]</td>
234                 </tr>
235                 <tr>
236                     <td>When more than</td>
237                     <td>[% whenmorethan1 | html %] [% IF ( innerloop1 ) %]<br />
238                         <i>(is [% innerloop1 | html %])</i>[% END %]</td>
239                     <td>[% whenmorethan2 | html %] [% IF ( innerloop2 ) %]<br />
240                         <i>(is [% innerloop2 | html %])</i>[% END %]</td>
241                     <td>[% whenmorethan3 | html %] [% IF ( innerloop3 ) %]<br />
242                         <i>(is [% innerloop3 | html %])</i>[% END %]</td>
243                 </tr>
244                 <tr>
245                     <td>Set back to</td>
246                     <td>[% setto1 | html %]</td>
247                     <td>[% setto2 | html %]</td>
248                     <td>[% setto3 | html %]</td>
249                 </tr>
250                 <tr>
251                     <td>
252                             Inner counter
253                     </td>
254                     <td>[% innerloop1 | html %]</td>
255                     <td>[% innerloop2 | html %]</td>
256                     <td>[% innerloop3 | html %]</td>
257                 </tr>
258                 <tr>
259                     <td>
260                             Last value
261                     </td>
262                     <td>[% lastvalue1 | html %]</td>
263                     <td>[% lastvalue2 | html %]</td>
264                     <td>[% lastvalue3 | html %]</td>
265                 </tr>
266             </table>
267     </div>
268     <div id="subscription_issues">
269         <table>
270         <tr>
271             <th>Issue number</th>
272             <th>Planned date</th>
273             <th>Published date</th>
274             <th>Published date (text)</th>
275             <th>Status</th>
276         </tr>
277         [% FOREACH serialslis IN serialslist %]
278             <tr>
279                 <td>
280                     [% serialslis.serialseq | html %]
281                 </td>
282                 <td>
283                     [% IF serialslis.planneddate %]
284                       [% serialslis.planneddate | html %]
285                     [% ELSE %]
286                       Unknown
287                     [% END %]
288                 </td>
289                 <td>
290                     [% IF serialslis.publisheddate %]
291                       [% serialslis.publisheddate | html %]
292                     [% ELSE %]
293                       Unknown
294                     [% END %]
295                 </td>
296                 <td>
297                     [% serialslis.publisheddatetext | html %]
298                 </td>
299                 <td>
300                     [% IF ( serialslis.status1 ) %]Expected[% END %]
301                     [% IF ( serialslis.status2 ) %]Arrived[% END %]
302                     [% IF ( serialslis.status3 ) %]Late[% END %]
303                     [% IF ( serialslis.status4 ) %]Missing[% END %]
304                     [% IF ( serialslis.status41 ) %]Missing (never received)[% END %]
305                     [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %]
306                     [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %]
307                     [% IF ( serialslis.status44 ) %]Missing (lost)[% END %]
308                     [% IF ( serialslis.status5 ) %]Not issued[% END %]
309                     [% IF ( serialslis.status6 ) %]Delete[% END %]
310                     [% IF ( serialslis.status7 ) %]
311                       Claimed
312                       [% IF ( serialslis.claimdate ) %]
313                         [% serialslis.claimdate | html %]
314                       [% END %]
315                     [% END %]
316                     [% IF ( serialslis.status8 ) %]Stopped[% END %]
317                 </td>
318             </tr>
319         [% END %]
320         </table>
321     </div>
322     <div id="subscription_summary">
323     <div class="row">
324     <div class="col-sm-12">
325     <div class="rows">
326         <ol>
327             <li><span class="label">Start date:</span> [% startdate | html %] </li>
328             <li><span class="label">End date:</span> [% enddate | html %]</li>
329             <li><span class="label">History start date:</span> [% histstartdate | html %] </li>
330             <li><span class="label">History end date:</span> [% histenddate | html %]</li>
331             <li><span class="label">Received issues:</span>[% recievedlist | html %]</li>
332             <li><span class="label">Missing issues:</span>[% missinglist | html %]</li>
333             <li><span class="label">Nonpublic note:</span>[% internalnotes FILTER html_line_break | html %]</li>
334             <li><span class="label">Public note:</span>[% notes FILTER html_line_break | html %]</li>
335             <li><span class="label">History staff note:</span>[% librariannote FILTER html_line_break | html %]</li>
336             <li><span class="label">History OPAC note:</span>[% opacnote FILTER html_line_break | html %]</li>
337         </ol>
338     </div>
339     </div>
340     </div>
341     </div>
342
343     [% IF orders %]
344         <div id="acquisition_details">
345             <h2>Acquisition details</h2>
346             <table id="orders">
347                 <caption>
348                   <span class="actions">
349                   <a href="#" id="hide_received_orders">Hide already received orders</a>
350                   | <a href="#" id="show_all_orders">Show all orders</a></span>
351                 </caption>
352
353                 <thead>
354                     <tr>
355                         <th>Invoice</th>
356                         <th>Basket</th>
357                         <th>Order number</th>
358                         <th class="title-string">Creation date</th>
359                         <th class="title-string">Receive date</th>
360                         <th class="title-string">Status</th>
361                         <th>Internal note</th>
362                         <th>Vendor note</th>
363                         <th>Fund</th>
364                         <th title="ecost tax exc. / ecost tax inc.">Ordered</th>
365                         <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
366                     </tr>
367                 </thead>
368                 <tbody>
369                 [% FOR order IN orders %]
370                     <tr>
371                         <td>
372                         [% IF order.invoice %]
373                             [% IF CAN_user_acquisition %]
374                                 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | html %]" title="Invoice detail page">
375                                    [% order.invoice.invoicenumber | html %]</a>
376                             [% ELSE %]
377                                 [% order.invoice.invoicenumber | html %]
378                             [% END %]
379                         [% END %]
380                         </td>
381                         <td>[% IF CAN_user_acquisition_order_manage %]
382                             <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno | uri %]">[% order.basket.basketname | html %] ([% order.basketno | html %])</a>
383                         [% ELSE %]
384                             [% order.basket.basketname | html %] ([% order.basketno | html %])
385                         [% END %]</td>
386                         <td>[% order.ordernumber | html %]</td>
387                         <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
388                         <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
389                         <td>
390                           [% SWITCH order.orderstatus %]
391                             [% CASE 'new' %]<span title="status_1">New</span>
392                             [% CASE 'ordered' %]<span title="status_2">Ordered</span>
393                             [% CASE 'partial' %]<span title="status_3">Partial</span>
394                             [% CASE 'complete' %]<span title="status_4">Complete</span>
395                             [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
396                           [% END %]
397                         </td>
398                         <td>[% order.order_internalnote | html %]</td>
399                         <td>[% order.order_vendornote | html %]</td>
400                         <td>[% order.fund.budget_name | html %]</td>
401                         <td>
402                             [% UNLESS order.datereceived %]
403                                 [% order.ecost_tax_excluded | $Price %] / [% order.ecost_tax_included | $Price %]
404                             [% END %]
405                         </td>
406                         <td>
407                             [% IF order.datereceived %]
408                                 [%# FIXME What if unitprice has not been filled? %]
409                                 [% order.unitprice_tax_excluded | $Price %] / [% order.unitprice_tax_included | $Price %]
410                             [% END %]
411                         </td>
412                     </tr>
413                 [% END %]
414                 </tbody>
415             </table>
416           </div>
417       [% END %]
418
419             </main>
420         </div> <!-- /.col-sm-10.col-sm-push-2 -->
421
422         <div class="col-sm-2 col-sm-pull-10">
423             <aside>
424                 [% INCLUDE 'serials-menu.inc' %]
425             </aside>
426         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
427      </div> <!-- /.row -->
428
429 [% MACRO jsinclude BLOCK %]
430     <script>
431         var subscriptionid = "[% subscriptionid | html %]";
432         var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
433         var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
434         var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
435     </script>
436     [% Asset.js("js/serials-toolbar.js") | $raw %]
437     [% INCLUDE 'datatables.inc' %]
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             $("#subscription_description").tabs();
445             $("#renewsub").click(function(){
446                 popup([% subscriptionid | html %]);
447                 return false;
448             })
449
450             var columns_settings = [% ColumnsSettings.GetColumns( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
451             var table = KohaTable("orders", {
452                 'bPaginate': false,
453                 'bAutoWidth': false,
454                 "aaSorting": [[ 5, "asc" ], [ 2, "desc" ]], // Order by status then ordernumber
455                 "aoColumnDefs": [
456                     { "aTargets": "title-string", "sType": "title-string" }
457                 ]
458             }, columns_settings);
459
460             $("#hide_received_orders").click(function(e){
461                 e.preventDefault();
462                 table.fnFilter( '^$', 4, true ); // Not empty "Receive date" columns
463             });
464             $("#show_all_orders").click(function(e){
465                 e.preventDefault();
466                 table.fnFilter( '', 4 ); // Not filter, display all columns
467             });
468             $("#show_all_orders").click();
469
470
471         });
472     </script>
473 [% END %]
474
475 [% INCLUDE 'intranet-bottom.inc' %]