Bug 29394: Remove flatpickr instantiations from most of the tt files
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation_batch_checkouts.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% USE Koha %]
5 [% USE KohaDates %]
6 [% USE Price %]
7 [% USE AuthorisedValues %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 [% SET destination = "circ" %]
11 <title>
12     [% IF patron %]
13         Batch check out to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %] &rsaquo;
14     [% END %]
15
16     Circulation &rsaquo; Koha
17 </title>
18 [% INCLUDE 'doc-head-close.inc' %]
19 </head>
20
21 <body id="circ_circulation_batch_checkouts" class="circ">
22
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'circ-search.inc' %]
25
26 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
27     <ol>
28         <li>
29             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
30         </li>
31         <li>
32             <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
33         </li>
34
35         [% IF patron %]
36             <li>
37                 <a href="/cgi-bin/koha/circ/circulation.pl">Batch check out</a>
38             </li>
39             <li>
40                 <a href="#" aria-current="page">
41                     [% INCLUDE 'patron-title.inc' %]
42                 </a>
43             </li>
44         [% ELSE %]
45             <li>
46                 <a href="#" aria-current="page">
47                     Batch check out
48                 </a>
49             </li>
50         [% END %]
51     </ol>
52 </nav>
53
54 <div class="main container-fluid">
55     <div class="row">
56         [% IF patron %]
57             <div class="col-sm-10 col-sm-push-2">
58         [% ELSE %]
59             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
60         [% END %]
61             <main>
62
63 [% IF patron %]
64 [% INCLUDE 'members-toolbar.inc' %]
65 [% END %]
66
67 [% IF patron and not batch_allowed %]
68   <div class="dialog alert">You are not allowed to use batch checkout for this patron</div>
69 [% ELSIF patron and noissues and not checkout_infos %]
70   <div class="dialog alert">
71       Cannot check out!
72       [% IF ( charges ) %]
73           [% INCLUDE 'blocked-fines.inc' fines = chargesamount %]
74       [% END %]
75       [% IF ( charges_guarantors_guarantees ) %]
76           <li>
77               <span class="circ-hlt">Charges:</span> Patron's guarantors and their other guarantees collectively owe [% charges_guarantors_guarantees | $Price %].
78               [% IF noissues %]
79                   <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
80               [% END %]
81           </li>
82       [% END %]
83       [% IF ( charges_guarantees ) %]
84           <li>
85               <span class="circ-hlt">Charges:</span> Patron's guarantees collectively owe [% chargesamount_guarantees | $Price %].
86               [% IF noissues %]
87                   <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
88               [% END %]
89           </li>
90       [% END %]
91   </div>
92 [% ELSIF patron and not checkout_infos %]
93   <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
94     <fieldset id="circ_circulation_issue">
95       <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
96       <fieldset class="rows">
97         <legend>Use a file</legend>
98         <ol>
99           <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
100         </ol>
101       </fieldset>
102       <fieldset class="rows">
103         <legend>Or list barcodes one by one</legend>
104         <ol>
105           <li>
106             <label for="barcodelist">Barcode list (one barcode per line): </label>
107             <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
108           </li>
109         </ol>
110       </fieldset>
111       [% IF Koha.Preference('SpecifyDueDate') %]
112           <fieldset class="rows">
113               <legend>Due date: </legend>
114               <label for="duedatespec">Hard due date [% INCLUDE 'date-format.inc' %]:</label>
115               [% IF Koha.Preference('SpecifyDueDate') %]
116                   <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" class="flatpickr" data-flatpickr-enable-time="true" />
117               [% ELSE %]
118                   <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
119               [% END %]
120           </fieldset>
121       [% END %]
122       <input type="hidden" name="op" value="show" />
123       <fieldset class="action">
124         <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
125         <input type="hidden" name="branch" value="[% branch | html %]" />
126         <input type="hidden" name="batch" value="1" />
127         <input type="submit" value="Check out" class="button" />
128       </fieldset>
129     </fieldset>
130   </form>
131
132 [% ELSIF patron %]
133   [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
134     <h3>Batch checkout confirmation [% IF patron %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
135     <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
136   [% ELSE %]
137     <h3>Batch checkout information [% IF patron.borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] |[% batch | html %]|[% END %]</h3>
138   [% END %]
139     <table id="checkout_infos">
140       <thead>
141         <tr>
142           [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
143             <th class="NoSort"></th>
144           [% END %]
145           <th>Barcode</th>
146           <th class="anti-the">Title</th>
147           <th>Information</th>
148         </tr>
149       </thead>
150       <tbody>
151         [% FOR checkout_info IN checkout_infos %]
152           <tr>
153             [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
154               <td>
155                 [% IF checkout_info.NEEDSCONFIRMATION %]
156                   <input type="checkbox" name="barcodes" value="[% checkout_info.barcode | html %]" checked="checked" />
157                 [% END %]
158               </td>
159             [% END %]
160             <td>[% checkout_info.barcode | html %]</td>
161             <td>
162                 [% INCLUDE 'biblio-title.inc' biblio=checkout_info.biblio link = 1 %] [% IF checkout_info.biblio.author %], by [% checkout_info.biblio.author | html %][% END %][% IF ( checkout_info.item.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes | $raw %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.biblio.biblionumber | uri %]&amp;itemnumber=[% checkout_info.item.itemnumber | uri %]#item[% checkout_info.item.itemnumber | uri %]">[% checkout_info.item.barcode | html %]</a>
163             </td>
164             <td>
165               [% IF checkout_info.NEEDSCONFIRMATION %]
166                 <ul class="fa-ul warn">
167                   [% IF checkout_info.AGE_RESTRICTION %]
168                       <li><i class="fa fa-li fa-warning"></i>Age restriction [% checkout_info.AGE_RESTRICTION | html %].</li>
169                   [% END %]
170                   [% IF checkout_info.RENEW_ISSUE %]
171                       <li><i class="fa fa-li fa-warning"></i>This item is currently checked out to this patron. Renew?</li>
172                   [% END %]
173                   [% IF checkout_info.RESERVE_WAITING %]
174                       <li><i class="fa fa-li fa-warning"></i>This item is waiting for another patron.</li>
175                   [% END %]
176                   [% IF checkout_info.TRANSFERRED %]
177                       <li><i class="fa fa-li fa-warning"></i>This item is on hold and being transferred for another patron.</li>
178                   [% END %]
179                   [% IF checkout_info.PROCESSING %]
180                       <li><i class="fa fa-li fa-warning"></i>This item is on hold and being processed for another patron.</li>
181                   [% END %]
182                   [% IF checkout_info.ISSUED_TO_ANOTHER %]
183                       <li><i class="fa fa-li fa-warning"></i>This item is checked out to another patron.
184                     [% IF CAN_user_circulate_force_checkout %]
185                       Check in and check out?
186                       [% END %]</li>
187                   [% END %]
188                   [% IF checkout_info.TOO_MANY %]
189                       <li><i class="fa fa-li fa-warning"></i>Too many checked out.</li>
190                   [% END %]
191                   [% IF checkout_info.BORRNOTSAMEBRANCH %]
192                       <li><i class="fa fa-li fa-warning"></i>This patron is from a different library ([% Branches.GetName( checkout_info.BORRNOTSAMEBRANCH ) | html %]).</li>
193                   [% END %]
194                   [% IF checkout_info.PATRON_CANT %]
195                       <li><i class="fa fa-li fa-warning"></i>This patron can't check out this item per library circulation policy.</li>
196                   [% END %]
197                   [% IF checkout_info.NOT_FOR_LOAN_FORCING %]
198                     [% IF checkout_info.itemtype_notforloan %]
199                         <li><i class="fa fa-li fa-warning"></i>Item type is normally not for loan.</li>
200                     [% ELSIF checkout_info.item_notforloan %]
201                       [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => checkout_info.item_notforloan ) %]
202                         <li><i class="fa fa-li fa-warning"></i>Item is normally not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib | html %])[% END %].</li>
203                     [% END %]
204                   [% END %]
205                   [% IF checkout_info.USERBLOCKEDOVERDUE %]
206                       <li><i class="fa fa-li fa-warning"></i>Patron has [% checkout_info.USERBLOCKEDOVERDUE | html %] overdue item(s).</li>
207                   [% END %]
208                   [% IF checkout_info.ITEM_LOST %]
209                       <li><i class="fa fa-li fa-warning"></i>This item has been lost with a status of "[% checkout_info.ITEM_LOST | html %]."</li>
210                   [% END %]
211                   [% IF checkout_info.HIGHHOLDS %]
212                       <li><i class="fa fa-li fa-warning"></i>High demand item. Loan period shortened to [% checkout_info.HIGHHOLDS.duration | html %] days (due [% checkout_info.HIGHHOLDS.returndate | html %]).</li>
213                   [% END %]
214                   [% IF checkout_info.HIGHHOLDS %] <!-- FIXME -->
215                       <script>
216                           $(document).ready(function() {
217                               $("input[name=duedatespec]:hidden").val('[% checkout_info.HIGHHOLDS.returndate | html %]');
218                           });
219                       </script>
220                   [% END %]
221
222                   [% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout || checkout_info.HIGHHOLDS ) && ( checkout_info.RESERVED || checkout_info.RESERVE_WAITING || checkout_info.TRANSFERRED || checkout_info.PROCESSING ) %] <!-- arbitrary choice, revert the reserve is not possible-->
223                       <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron. The hold will be overridden, but not cancelled.</li>
224                   [% ELSIF checkout_info.RESERVED %]
225                       <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron.</li>
226                   [% END %]
227
228                   [% IF checkout_info.PREVISSUE %]
229                       <li>This item has previously been checked out to this patron.</li>
230                   [% END %]
231                 </ul>
232               [% END %]
233
234
235               [% IF checkout_info.alert.ITEM_LOST || checkout_info.alert.OTHER_CHARGES %]
236                 <ul class="info">
237                   [% IF checkout_info.alert.ITEM_LOST %]
238                       <li>This item has been lost with a status of "[% checkout_info.alert.ITEM_LOST | html %]."</li>
239                   [% END %]
240                   [% IF checkout_info.alert.OTHER_CHARGES %]
241                       <li>The patron has unpaid charges for holds, rentals etc of [% checkout_info.alert.OTHER_CHARGES | $Price %].</li>
242                   [% END %]
243                 </ul>
244               [% END %]
245
246               [% IF checkout_info.alert.RETURNED_FROM_ANOTHER %]
247                   <div class="dialog alert">Item was checked out to [% INCLUDE 'patron-title.inc' patron = checkout_info.alert.RETURNED_FROM_ANOTHER.patron %] and was returned automatically.</div>
248               [% END %]
249
250               [% IF checkout_info.IMPOSSIBLE %]
251                 <ul class="fa-ul error">
252                   [% IF checkout_info.STATS  %]
253                       <li><i class="fa fa-li fa-exclamation"></i>Local use recorded.</li>
254                   [% END %]
255
256                   [% IF checkout_info.NOT_FOR_LOAN %]
257                     [% IF checkout_info.itemtype_notforloan %]
258                        <li><i class="fa fa-li fa-exclamation"></i>Item type not for loan.</li>
259                     [% ELSIF checkout_info.item_notforloan %]
260                       [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => checkout_info.item_notforloan ) %]
261                         <li><i class="fa fa-li fa-exclamation"></i>Item not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib | html %])[% END %].</li>
262                     [% END %]
263                   [% END %]
264                   [% IF checkout_info.WTHDRAWN %]
265                       <li><i class="fa fa-li fa-exclamation"></i>Item has been withdrawn.</li>
266                   [% END %]
267                   [% IF checkout_info.RESTRICTED %]
268                       <li><i class="fa fa-li fa-exclamation"></i>Item is restricted.</li>
269                   [% END %]
270                   [% IF checkout_info.GNA %]
271                       <li><i class="fa fa-li fa-exclamation"></i>Patron's address is in doubt.</li>
272                   [% END %]
273                   [% IF checkout_info.CARD_LOST %]
274                       <li><i class="fa fa-li fa-exclamation"></i>Patron's card is lost.</li>
275                   [% END %]
276                   [% IF checkout_info.DEBARRED %]
277                       <li><i class="fa fa-li fa-exclamation"></i>Patron is restricted.</li>
278                   [% END %]
279                   [% IF checkout_info.NO_MORE_RENEWALS %]
280                       <li><i class="fa fa-li fa-exclamation"></i>No more renewals possible.</li>
281                   [% END %]
282                   [% IF checkout_info.EXPIRED %]
283                       <li><i class="fa fa-li fa-exclamation"></i>Patron's card is expired.</li>
284                   [% END %]
285                   [% IF checkout_info.ITEMNOTSAMEBRANCH %]
286                       <li><i class="fa fa-li fa-exclamation"></i>This item belongs to [% Branches.GetName( checkout_info.itemhomebranch ) | html %] and cannot be checked out from this location.</li>
287                   [% END %]
288                   [% IF checkout_info.USERBLOCKEDREMAINING %]
289                       <li><i class="fa fa-li fa-exclamation"></i>Patron has had overdue items and is blocked for [% checkout_info.USERBLOCKEDREMAINING | html %] day(s).</li>
290                   [% END %]
291                   [% IF checkout_info.USERBLOCKEDOVERDUE %]
292                       <li><i class="fa fa-li fa-exclamation"></i>Checkouts are BLOCKED because patron has overdue items.</li>
293                   [% END %]
294                   [% IF checkout_info.TOO_MANY %]
295                       <li><i class="fa fa-li fa-exclamation"></i>Too many checked out.</li>
296                   [% END %]
297                   [% IF checkout_info.UNKNOWN_BARCODE %]
298                       <li><i class="fa fa-li fa-exclamation"></i>The barcode was not found [% checkout_info.barcode | html %].</li>
299                   [% END %]
300                   [% IF checkout_info.DEBT %]
301                       <li><i class="fa fa-li fa-exclamation"></i>The patron has a debt of [% checkout_info.DEBT | $Price %].</li> <!-- Need debt_confirmed -->
302                   [% END %]
303                 </p>
304               [% END %]
305
306               [% IF checkout_info.issue.date_due %]
307                 <li>Due on [% checkout_info.issue.date_due | $KohaDates as_due_date => 1 %]</li>
308               [% END %]
309             </td>
310           </tr>
311         [% END %]
312       </tbody>
313     </table>
314
315     [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
316         <fieldset>
317             <legend>Please confirm checkout</legend>
318       <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
319       <input type="hidden" name="issueconfirmed" value="1" />
320       <input type="hidden" name="debt_confirmed" value="1" />
321       <input type="hidden" name="branch" value="[% branch | html %]" />
322       <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
323       <input type="hidden" name="batch" value="1" />
324       <input type="submit" id="checkoutrenew" class="approve" value="Checkout or renew" />
325         </fieldset>
326     </form>
327     [% END %]
328
329 [% ELSE %]
330     <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
331 [% END %]
332
333                   </main>
334                       </div> <!-- /.col-sm-10.col-sm-push-2 -->
335                       [% IF patron %]
336                           <div class="col-sm-2 col-sm-pull-10">
337                               <aside>
338                                   [% INCLUDE 'circ-menu.inc' %]
339                               </aside>
340                           </div> <!-- /.col-sm-2.col-sm-pull-10 -->
341                       [% END %]
342                   </div> <!-- /.row -->
343
344 [% MACRO jsinclude BLOCK %]
345     [% INCLUDE 'calendar.inc' %]
346     [% INCLUDE 'datatables.inc' %]
347     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
348     <script>
349         $(document).ready(function() {
350             if($('#barcodelist').length) {
351                 $('#barcodelist').focus();
352             } else if ($('#checkoutrenew').length) {
353                 $('#checkoutrenew').focus();
354             }
355             $("#checkout_infos").dataTable($.extend(true, {}, dataTablesDefaults, {
356                 "sDom": 't',
357                 "aaSorting": [],
358                 "aoColumnDefs": [
359                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
360                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
361                 ],
362                 "bPaginate": false
363             }));
364         });
365
366     </script>
367     [% INCLUDE 'str/members-menu.inc' %]
368     [% Asset.js("js/members-menu.js") | $raw %]
369 [% END %]
370
371 [% INCLUDE 'intranet-bottom.inc' %]