Bug 20351: Shortcut serials scripts if a blocking error appeared
[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 id="doc3" class="yui-t2">
27    
28    <div id="bd">
29         <div id="yui-main">
30         <div class="yui-b">
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="yui-g">
72     <div class="yui-u first">
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="yui-u">
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     <div class="yui-g">
124       <div class="yui-u first">
125         <div class="rows">
126           <legend>Additional fields:</legend>
127           <ol>
128             [% FOR field IN additional_fields_for_subscription %]
129               <li>
130                 <span class="label">[% field.name | html %]:</span>
131                 [% IF field.authorised_value_category %]
132                   [% AuthorisedValues.GetByCode( field.authorised_value_category, additional_fields.${field.name} ) | html %]
133                 [% ELSE %]
134                   [% additional_fields.${field.name} | html %]
135                 [% END %]
136               </li>
137             [% END %]
138           </ol>
139         </div>
140       </div>
141       </div>
142      [% END %]
143 </div>
144
145     <div id="subscription_planning">
146     <div class="yui-g">
147     <div class="rows">
148         <ol>
149             <li><span class="label">Beginning date:</span> [% startdate | html %]
150             </li>
151             <li><span class="label">Frequency:</span>
152                 [% frequency.description | html %]
153             </li>
154             <li>
155               <span class="label">Manual history: </span>
156                 [% IF ( manualhistory ) %]
157                     Enabled <a href="/cgi-bin/koha/serials/subscription-history.pl?subscriptionid=[% subscriptionid | html %]">Edit history</a>
158                 [% ELSE %]
159                     Disabled
160                 [% END %]
161             </li>
162             <li><span class="label">Number pattern:</span>
163                 [% numberpattern.label | html %]
164             </li>
165             <li><table>
166             <tr>
167                 <td>Starting with:</td>
168                 [% IF (has_X) %]
169                     <td align="center">[% lastvalue1 | html %]</td>
170                 [% END %]
171                 [% IF (has_Y) %]
172                     <td align="center">[% lastvalue2 | html %]</td>
173                 [% END %]
174                 [% IF (has_Z) %]
175                     <td align="center">[% lastvalue3 | html %]</td>
176                 [% END %]
177             </tr>
178             <tr>
179                 <td>Rollover:</td>
180                 [% IF (has_X) %]
181                     <td align="center">[% numberpattern.whenmorethan1 | html %]</td>
182                 [% END %]
183                 [% IF (has_Y) %]
184                     <td align="center">[% numberpattern.whenmorethan2 | html %]</td>
185                 [% END %]
186                 [% IF (has_Z) %]
187                     <td align="center">[% numberpattern.whenmorethan3 | html %]</td>
188                 [% END %]
189             </tr>
190             </table></li>
191             [% IF ( irregular_issues ) %]
192             <li><span class="label">Irregularity:</span> [% irregular_issues | html %] issues
193             </li>
194             [% END %]
195             <li><span class="label">First arrival:</span> [% firstacquidate | html %]
196             </li>
197         [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength | html %]</li>[% END %]
198         [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength | html %]</li>[% END %]
199         [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength | html %]</li>[% END %]
200         </ol>
201     </div>
202     </div>
203     </div>
204     <div id="subscription_numbering" style="display:none;">
205         <h3>Numbering calculation</h3>
206         <p><label>Numbering formula:</label> [% numberingmethod | html %]</p>
207         <table>
208             <tr>
209                 <th>&nbsp;</th>
210                 <th>X</th>
211                 <th>Y</th>
212                 <th>Z</th>
213                 </tr>
214                 <tr>
215                     <td>Add</td>
216                     <td>
217                         [% add1 | html %]
218                     </td>
219                     <td>
220                         [% add2 | html %]
221                     </td>
222                     <td>
223                         [% add3 | html %]
224                     </td>
225                 </tr>
226                 <tr>
227                     <td>once every</td>
228                     <td>[% every1 | html %]</td>
229                     <td>[% every2 | html %]</td>
230                     <td>[% every3 | html %]</td>
231                 </tr>
232                 <tr>
233                     <td>When more than</td>
234                     <td>[% whenmorethan1 | html %] [% IF ( innerloop1 ) %]<br />
235                         <i>(is [% innerloop1 | html %])</i>[% END %]</td>
236                     <td>[% whenmorethan2 | html %] [% IF ( innerloop2 ) %]<br />
237                         <i>(is [% innerloop2 | html %])</i>[% END %]</td>
238                     <td>[% whenmorethan3 | html %] [% IF ( innerloop3 ) %]<br />
239                         <i>(is [% innerloop3 | html %])</i>[% END %]</td>
240                 </tr>
241                 <tr>
242                     <td>Set back to</td>
243                     <td>[% setto1 | html %]</td>
244                     <td>[% setto2 | html %]</td>
245                     <td>[% setto3 | html %]</td>
246                 </tr>
247                 <tr>
248                     <td>
249                             Inner counter
250                     </td>
251                     <td>[% innerloop1 | html %]</td>
252                     <td>[% innerloop2 | html %]</td>
253                     <td>[% innerloop3 | html %]</td>
254                 </tr>
255                 <tr>
256                     <td>
257                             Last value
258                     </td>
259                     <td>[% lastvalue1 | html %]</td>
260                     <td>[% lastvalue2 | html %]</td>
261                     <td>[% lastvalue3 | html %]</td>
262                 </tr>
263             </table>
264     </div>
265     <div id="subscription_issues">
266         <table>
267         <tr>
268             <th>Issue number</th>
269             <th>Planned date</th>
270             <th>Published date</th>
271             <th>Published date (text)</th>
272             <th>Status</th>
273         </tr>
274         [% FOREACH serialslis IN serialslist %]
275             <tr>
276                 <td>
277                     [% serialslis.serialseq | html %]
278                 </td>
279                 <td>
280                     [% IF serialslis.planneddate %]
281                       [% serialslis.planneddate | html %]
282                     [% ELSE %]
283                       Unknown
284                     [% END %]
285                 </td>
286                 <td>
287                     [% IF serialslis.publisheddate %]
288                       [% serialslis.publisheddate | html %]
289                     [% ELSE %]
290                       Unknown
291                     [% END %]
292                 </td>
293                 <td>
294                     [% serialslis.publisheddatetext | html %]
295                 </td>
296                 <td>
297                     [% IF ( serialslis.status1 ) %]Expected[% END %]
298                     [% IF ( serialslis.status2 ) %]Arrived[% END %]
299                     [% IF ( serialslis.status3 ) %]Late[% END %]
300                     [% IF ( serialslis.status4 ) %]Missing[% END %]
301                     [% IF ( serialslis.status41 ) %]Missing (never received)[% END %]
302                     [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %]
303                     [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %]
304                     [% IF ( serialslis.status44 ) %]Missing (lost)[% END %]
305                     [% IF ( serialslis.status5 ) %]Not issued[% END %]
306                     [% IF ( serialslis.status6 ) %]Delete[% END %]
307                     [% IF ( serialslis.status7 ) %]
308                       Claimed
309                       [% IF ( serialslis.claimdate ) %]
310                         [% serialslis.claimdate | html %]
311                       [% END %]
312                     [% END %]
313                     [% IF ( serialslis.status8 ) %]Stopped[% END %]
314                 </td>
315             </tr>
316         [% END %]
317         </table>
318     </div>
319     <div id="subscription_summary">
320     <div class="yui-g">
321     <div class="rows">
322         <ol>
323             <li><span class="label">Start date:</span> [% startdate | html %] </li>
324             <li><span class="label">End date:</span> [% enddate | html %]</li>
325             <li><span class="label">History start date:</span> [% histstartdate | html %] </li>
326             <li><span class="label">History end date:</span> [% histenddate | html %]</li>
327             <li><span class="label">Received issues:</span>[% recievedlist | html %]</li>
328             <li><span class="label">Missing issues:</span>[% missinglist | html %]</li>
329             <li><span class="label">Nonpublic note:</span>[% internalnotes FILTER html_line_break | html %]</li>
330             <li><span class="label">Public note:</span>[% notes FILTER html_line_break | html %]</li>
331             <li><span class="label">History staff note:</span>[% librariannote FILTER html_line_break | html %]</li>
332             <li><span class="label">History OPAC note:</span>[% opacnote FILTER html_line_break | html %]</li>
333         </ol>
334     </div>
335     </div>
336     </div>
337     </div>
338
339     [% IF orders %]
340         <div id="acquisition_details">
341             <h2>Acquisition details</h2>
342             <table id="orders">
343                 <caption>
344                   <span class="actions">
345                   <a href="#" id="hide_received_orders">Hide already received orders</a>
346                   | <a href="#" id="show_all_orders">Show all orders</a></span>
347                 </caption>
348
349                 <thead>
350                     <tr>
351                         <th>Invoice</th>
352                         <th>Basket</th>
353                         <th>Order number</th>
354                         <th class="title-string">Creation date</th>
355                         <th class="title-string">Receive date</th>
356                         <th class="title-string">Status</th>
357                         <th>Internal note</th>
358                         <th>Vendor note</th>
359                         <th>Fund</th>
360                         <th title="ecost tax exc. / ecost tax inc.">Ordered</th>
361                         <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
362                     </tr>
363                 </thead>
364                 <tbody>
365                 [% FOR order IN orders %]
366                     <tr>
367                         <td>
368                         [% IF order.invoice %]
369                             [% IF CAN_user_acquisition %]
370                                 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | html %]" title="Invoice detail page">
371                                    [% order.invoice.invoicenumber | html %]</a>
372                             [% ELSE %]
373                                 [% order.invoice.invoicenumber | html %]
374                             [% END %]
375                         [% END %]
376                         </td>
377                         <td>[% IF CAN_user_acquisition_order_manage %]
378                             <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno | uri %]">[% order.basket.basketname | html %] ([% order.basketno | html %])</a>
379                         [% ELSE %]
380                             [% order.basket.basketname | html %] ([% order.basketno | html %])
381                         [% END %]</td>
382                         <td>[% order.ordernumber | html %]</td>
383                         <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
384                         <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
385                         <td>
386                           [% SWITCH order.orderstatus %]
387                             [% CASE 'new' %]<span title="status_1">New</span>
388                             [% CASE 'ordered' %]<span title="status_2">Ordered</span>
389                             [% CASE 'partial' %]<span title="status_3">Partial</span>
390                             [% CASE 'complete' %]<span title="status_4">Complete</span>
391                             [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
392                           [% END %]
393                         </td>
394                         <td>[% order.order_internalnote | html %]</td>
395                         <td>[% order.order_vendornote | html %]</td>
396                         <td>[% order.fund.budget_name | html %]</td>
397                         <td>
398                             [% UNLESS order.datereceived %]
399                                 [% order.ecost_tax_excluded | $Price %] / [% order.ecost_tax_included | $Price %]
400                             [% END %]
401                         </td>
402                         <td>
403                             [% IF order.datereceived %]
404                                 [%# FIXME What if unitprice has not been filled? %]
405                                 [% order.unitprice_tax_excluded | $Price %] / [% order.unitprice_tax_included | $Price %]
406                             [% END %]
407                         </td>
408                     </tr>
409                 [% END %]
410                 </tbody>
411             </table>
412           </div>
413       [% END %]
414
415 </div>
416 </div>
417
418 <div class="yui-b">
419 [% INCLUDE 'serials-menu.inc' %]
420 </div>
421 </div>
422
423 [% MACRO jsinclude BLOCK %]
424     <script type="text/javascript">
425         var subscriptionid = "[% subscriptionid | html %]";
426         var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
427         var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
428         var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
429     </script>
430     [% Asset.js("js/serials-toolbar.js") | $raw %]
431     [% INCLUDE 'datatables.inc' %]
432     [% INCLUDE 'columns_settings.inc' %]
433     <script type="text/javascript">
434         // the english words used in display purposes
435         var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern",
436         "Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
437         $(document).ready(function() {
438             $("#subscription_description").tabs();
439             $("#renewsub").click(function(){
440                 popup([% subscriptionid | html %]);
441                 return false;
442             })
443
444             var columns_settings = [% ColumnsSettings.GetColumns( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
445             var table = KohaTable("orders", {
446                 'bPaginate': false,
447                 'bAutoWidth': false,
448                 "aaSorting": [[ 5, "asc" ], [ 2, "desc" ]], // Order by status then ordernumber
449                 "aoColumnDefs": [
450                     { "aTargets": "title-string", "sType": "title-string" }
451                 ]
452             }, columns_settings);
453
454             $("#hide_received_orders").click(function(e){
455                 e.preventDefault();
456                 table.fnFilter( '^$', 4, true ); // Not empty "Receive date" columns
457             });
458             $("#show_all_orders").click(function(e){
459                 e.preventDefault();
460                 table.fnFilter( '', 4 ); // Not filter, display all columns
461             });
462             $("#show_all_orders").click();
463
464
465         });
466     </script>
467 [% END %]
468
469 [% INCLUDE 'intranet-bottom.inc' %]