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