Bug 22119: Add price formatting in more places in circulation
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% USE Categories %]
7 [% USE ColumnsSettings %]
8 [% USE ItemTypes %]
9 [% USE Price %]
10 [% USE AuthorisedValues %]
11 [% SET footerjs = 1 %]
12 [% INCLUDE 'doc-head-open.inc' %]
13 [% SET destination = "circ" %]
14 <title>Koha &rsaquo; Circulation
15 [% IF patron %]
16   &rsaquo; Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %]
17 [% END %]
18 </title>
19 [% INCLUDE 'doc-head-close.inc' %]
20 [% Asset.css("css/datatables.css") | $raw %]
21 </head>
22
23 <body id="circ_circulation" class="circ">
24
25 [% INCLUDE 'header.inc' %]
26 [% INCLUDE 'circ-search.inc' %]
27
28 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo;
29 [% IF patron %]
30     <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> &rsaquo; [% INCLUDE 'patron-title.inc' %]
31 [% ELSE %]
32     <strong>Checkouts</strong>
33 [% END %]
34 </div>
35 [% IF ( $borrowers ) %]
36 <div id="doc" class="yui-t7">
37
38    <div id="bd">
39         <div id="yui-main">
40         <div class="yui-g">
41 [% ELSE %]
42 <div id="doc3" class="yui-t2">
43
44    <div id="bd">
45         <div id="yui-main">
46         <div class="yui-b">
47 [% END %]
48
49 [% IF patron %]
50 [% INCLUDE 'members-toolbar.inc' %]
51 [% END %]
52
53 <!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
54 [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>[% END %]
55
56 [% IF autoswitched %]
57     <div id="autoswitched" class="dialog message">Patron was automatically switched by reading the patron card during checking out. Ensure you are working with the right patron.</div>
58 [% END %]
59
60 [% IF additional_materials %]
61     <div id="materials" class="dialog message">Note about the accompanying materials: <br />
62     [% additional_materials | html %]
63     </div>
64 [% END %]
65
66 [% IF ( alert.ITEM_LOST ) %]
67     <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST | html %]".</div>
68 [% END %]
69
70 [% IF ( alert.OTHER_CHARGES ) %]
71     <div class="dialog message">The patron has unpaid charges for holds, rentals etc of [% alert.OTHER_CHARGES | $Price %]</div>
72 [% END %]
73
74 [% IF alert.HIGHHOLDS %]
75     <div class="dialog message">High demand item. <b>Loan period was not shortened due to override.</b> Shortened due date would have been [% alert.HIGHHOLDS.returndate | $KohaDates %] ([% alert.HIGHHOLDS.duration  | html %] days).</div>
76 [% END %]
77
78 [% IF ( nopermission ) %]
79     <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
80 [% END %]
81
82 [% IF ( NEEDSCONFIRMATION ) %]
83 <div class="yui-g">
84
85 <div id="circ_needsconfirmation" class="dialog alert audio-alert-action">
86 [% IF CAN_user_circulate_force_checkout %]
87   <h3>Please confirm checkout</h3>
88 [% ELSE %]
89   <h3>Cannot check out</h3>
90 [% END %]
91
92 <ul>
93 [%IF ( AGE_RESTRICTION ) %]
94     <li>Age restriction [% AGE_RESTRICTION | html %].
95       [% IF CAN_user_circulate_force_checkout %]
96         Check out anyway?
97       [% END %]
98     </li>
99 [% END %]
100
101 [% IF ( DEBT ) %]
102     <li>The patron has a debt of [% DEBT | $Price %].</li>
103 [% END %]
104
105 [% IF ( DEBT_GUARANTEES ) %]
106     <li>The patron's guarantees collectively have a debt of [% DEBT_GUARANTEES | $Price %].</li>
107 [% END %]
108
109 [% IF ( RENTALCHARGE && RENTALCHARGE > 0 ) %]
110     <li>Rental charge for this item: [% RENTALCHARGE | $Price %]</li>
111 [% END %]
112
113 [% IF ( RENEW_ISSUE ) %]
114     <li>Item <i>[% getTitleMessageIteminfo | html %]</i> ([% getBarcodeMessageIteminfo | html %]) is currently checked out to this patron.  Renew?</li>
115 [% END %]
116
117 [% IF ( RESERVE_WAITING ) %]
118     <li>Item <i>[% getTitleMessageIteminfo | html %]</i> ([% getBarcodeMessageIteminfo | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %] since [% reswaitingdate | $KohaDates %]</li>
119 [% END %]
120
121 [% IF ( RESERVED ) %]
122     <li>Item <i>[% getTitleMessageIteminfo | html %]</i> ([% getBarcodeMessageIteminfo | html %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %] since [% resreservedate | $KohaDates %]</li>
123 [% END %]
124
125 [% IF ( ISSUED_TO_ANOTHER ) %]
126     <li>Item <i>[% getTitleMessageIteminfo | html %]</i> ([% getBarcodeMessageIteminfo | html %]) is checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issued_borrowernumber | uri %]">[% issued_firstname | html %] [% issued_surname | html %]</a> ([% issued_cardnumber | html %]).
127       [% IF CAN_user_circulate_force_checkout %]
128         Check in and check out?
129       [% END %]
130     </li>
131 [% END %]
132
133 [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %]
134     <li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li>
135 [% END %]
136
137 [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %]
138     <li>Too many on-site checked out. [% current_loan_count | html %] on-site checked out, only [% max_loans_allowed | html %] are allowed.</li>
139 [% END %]
140
141 [% IF ( BORRNOTSAMEBRANCH ) %]
142     <li>This patron is from a different library ([% Branches.GetName( BORRNOTSAMEBRANCH ) | html %])</li>
143 [% END %]
144
145 [% IF ( PATRON_CANT ) %]
146     <li>This patron can't check out this item per library circulation policy.</li>
147 [% END %]
148
149 [% IF ( TOO_MANY and TOO_MANY == 'NO_RULE_DEFINED' ) %]
150     <li>No circulation rule is defined for this patron and itemtype combination.</li>
151 [% END %]
152
153 [% IF ( NOT_FOR_LOAN_FORCING ) %]
154     <li>
155     [% IF ( itemtype_notforloan ) %]
156         Item type is normally not for loan.
157     [% ELSIF ( item_notforloan ) %]
158         [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
159         Item is normally not for loan[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
160     [% END %]
161       [% IF CAN_user_circulate_force_checkout %]
162         Check out anyway?
163       [% END %]
164     </li>
165 [% END %]
166
167 [% IF ( USERBLOCKEDOVERDUE ) %]
168     <li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s).
169       [% IF CAN_user_circulate_force_checkout %]
170        Check out anyway?
171       [% END %]
172     </li>
173 [% END %]
174
175 [% IF ( ITEM_LOST ) %]
176     <li>This item has been lost with a status of "[% ITEM_LOST | html %]".
177       [% IF CAN_user_circulate_force_checkout %]
178         Check out anyway?
179       [% END %]
180     </li>
181 [% END %]
182
183 [% IF HIGHHOLDS %]
184     <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration | html %] days (due [% HIGHHOLDS.returndate | $KohaDates %]). Check out anyway?</li>
185 [% END %]
186
187 [% IF PREVISSUE %]
188     <li>Patron has previously checked out this title: <b>[% biblio.title | html %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</b>. Check out anyway?</li>
189 [% END %]
190
191 [% IF BIBLIO_ALREADY_ISSUED %]
192   <li>
193     Patron has already checked out another item from this record.
194     [% IF CAN_user_circulate_force_checkout %]
195       Check out anyway?
196     [% END %]
197   </li>
198 [% END %]
199 </ul>
200
201 [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
202 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
203     <input type="hidden" name="restoreduedatespec" />
204
205 [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
206
207 [% IF HIGHHOLDS %]
208     <p class="circ-override-high-holds">
209     <input type="checkbox" name="override_high_holds_tmp" id="override_high_holds_tmp" value="1" />
210     <label for="override_high_holds_tmp">Don't decrease loan length based on holds</label>
211     </p>
212 [% END %]
213
214 [% IF ( RESERVED ) %]
215     <p>
216     <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
217     <label for="cancelreserve">Cancel hold</label>
218     </p>
219 [% END %]
220
221 [% IF ( RESERVE_WAITING ) %]
222 <p>
223     <label for="cancelreserve">Cancel hold</label>
224     <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
225     <label for="revertreserve">Revert waiting status</label>
226     <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
227 </p>
228 [% END %]
229
230     <input type="hidden" name="barcode" value="[% barcode | html %]" />
231     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
232     <input type="hidden" name="issueconfirmed" value="1" />
233     <input type="hidden" name="override_high_holds" value="[% override_high_holds | html %]"/>
234     [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
235     [% IF ( INVALID_DATE ) %]
236     <p>
237     <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" />
238     <label for="duedatespec">Due date</label>
239     </p>
240     [% ELSE %]
241     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
242     [% END %]
243     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
244     <input type="hidden" name="branch" value="[% branch | html %]" />
245     [% IF ( RENEW_ISSUE ) %]
246     <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
247     [% ELSE %]
248     <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, check out (Y)</button>
249     [% END %]
250     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
251     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
252 </form>
253 [% END %]
254
255 [% IF ( RESERVED ) %]
256 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
257     <input type="hidden" name="restoreduedatespec" />
258     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
259     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
260     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
261     <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% reserveborrowernumber | html %]&amp;biblionumber=[% itembiblionumber | html %]&amp;itemnumber=[% item.itemnumber | html %]&amp;op=slip');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
262 </form>
263 [% END %]
264
265 [% IF ( RESERVE_WAITING ) %]
266 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
267     <input type="hidden" name="restoreduedatespec" />
268     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
269     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
270     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
271     <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% reserveborrowernumber | html %]&amp;biblionumber=[% itembiblionumber | html %]&amp;itemnumber=[% item.itemnumber | html %]&amp;op=slip');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
272 </form>
273 [% END %]
274
275 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
276     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
277     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
278     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
279     <input type="hidden" name="restoreduedatespec" />
280     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
281     [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
282         [% IF ( RENEW_ISSUE ) %]
283         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
284         [% ELSE %]
285         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't check out (N)</button>
286         [% END %]
287     [% ELSE %]
288         <button type="submit" class="deny"><i class="fa fa-times"></i> Continue</button>
289     [% END %]
290 </form>
291
292 [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
293     [% UNLESS noissues %]
294         <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber | html %]&borrowernumber=[% patron.borrowernumber | html %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
295     [% END %]
296 [% END %]
297 </div></div>
298 [% END %] <!-- NEEDSCONFIRMATION -->
299
300         [% IF ( IMPOSSIBLE ) %]
301
302 <div class="yui-g">
303 <div id="circ_impossible" class="dialog alert audio-alert-warning">
304     [% IF ( UNKNOWN_BARCODE ) %]
305         <h3>Barcode not found</h3>
306     [% END %]
307 <!-- RESULT OF ISSUING REQUEST -->
308         <ul>
309         [% IF ( STATS ) %]
310             <li>Local use recorded</li>
311         [% END %]
312
313         [% IF ( INVALID_DATE ) %]
314             <li>The due date &quot;[% INVALID_DATE | html %]&quot; is invalid</li>
315         [% END %]
316
317         [% IF ( UNKNOWN_BARCODE ) %]
318             <li>The barcode was not found: <span class="ex">[% barcode | html %]</span>
319
320                 <div>
321                     [% IF ( FALLBACK ) %]
322                         [% IF options %]
323                             <button type="button" class="approve" data-toggle="modal" data-target="#itemSearchFallback"><i class="fa fa-search"></i> Show matching titles</button>
324                         [% ELSE %]
325                             <div>No items were found by searching.</div>
326                         [% END %]
327                     [% END %]
328
329                     [% IF ( fast_cataloging ) %]
330                         [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
331                             <a class="approve" href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode |uri %]&amp;circborrowernumber=[% patron.borrowernumber | html %]&amp;branch=[% branch | html %]&amp;duedatespec=[% duedatespec | html %]&amp;stickyduedate=[% stickyduedate | html %]"><i class="fa fa-plus"></i> Add record using fast cataloging</a>
332                         [% END %]
333                     [% END %]
334                 </div>
335
336             </li>
337         [% END %]
338
339         [% IF ( NOT_FOR_LOAN ) %]
340             <li>
341             [% IF ( itemtype_notforloan ) %]
342                 Item type not for loan.
343             [% ELSIF ( item_notforloan ) %]
344                 [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
345                 Item not for loan[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
346             [% END %]
347             </li>
348         [% END %]
349
350         [% IF ( WTHDRAWN ) %]
351             <li>
352                 <span>Item has been withdrawn</span>
353                 [% item_withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
354                 [% IF (item_withdrawn_lib) %]<span class="co-withdrawn">([% item_withdrawn_lib | html %])</span>[% END %]
355             </li>
356         [% END %]
357
358         [% IF ( RESTRICTED ) %]
359             <li>Item is restricted</li>
360         [% END %]
361
362         [% IF ( GNA ) %]
363             <li>Patron's address is in doubt</li>
364         [% END %]
365
366         [% IF ( CARD_LOST ) %]
367             <li>Patron's card is lost</li>
368         [% END %]
369
370         [% IF ( DEBARRED ) %]
371             <li>Patron is restricted</li>
372         [% END %]
373
374         [% IF ( NO_MORE_RENEWALS ) %]
375             <li>No more renewals possible</li>
376         [% END %]
377
378         [% IF NO_RENEWAL_FOR_ONSITE_CHECKOUTS %]
379             <li>This item can not be renewed, it's an on-site checkout</li>
380         [% END %]
381
382         [%IF ( AGE_RESTRICTION ) %]
383             <li>Age restriction [% AGE_RESTRICTION | html %].</li>
384         [% END %]
385
386         [% IF ( EXPIRED ) %]
387             <li>Patron's card is expired</li>
388         [% END %]
389
390         [% IF ( TOO_MANY ) %]
391             <li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li>
392         [% END %]
393
394         [% IF ( ITEMNOTSAMEBRANCH ) %]
395             <li>This item belongs to [% Branches.GetName( itemhomebranch ) | html %] and cannot be checked out from this location.</li>
396         [% END %]
397
398         [% IF RETURN_IMPOSSIBLE %]
399             <li>This item must be returned to [% Branches.GetName( branch_to_return ) | html %].</li>
400         [% END %]
401
402         [% IF ( USERBLOCKEDWITHENDDATE ) %]
403             <li>Patron has a restriction until [% USERBLOCKEDWITHENDDATE | $KohaDates %].</li>
404         [% END %]
405
406         [% IF ( USERBLOCKEDNOENDDATE ) %]
407             <li>Patron has an indefinite restriction.</li>
408         [% END %]
409
410         [% IF ( USERBLOCKEDOVERDUE ) %]
411             <li>Checkouts are BLOCKED because patron has overdue items.</li>
412         [% END %]
413         </ul>
414
415         [% IF (forceallow) %]
416             <li>Restriction overridden temporarily.</li>
417         [% END %]
418
419 </div></div>
420
421         [% IF ( FALLBACK ) %]
422             [% IF options %]
423
424                 <!-- Modal -->
425                 <div class="modal" id="itemSearchFallback" tabindex="-1" role="dialog" aria-labelledby="itemSearchFallbackLabel">
426                     <div class="modal-dialog modal-wide" role="document">
427                         <div class="modal-content">
428                             <div class="modal-header">
429                                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
430                                 <h3 id="itemSearchFallbackLabel"><h3>Barcode not found. The following items were found by searching:</h3>
431                             </div>
432                             <div class="modal-body">
433                                 <table class="table_borrowers">
434                                     [% FOREACH book IN options %]
435                                         <tr>
436                                             <td>
437                                                 <a class="popup" target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% book.biblionumber | html %]">[% book.title | html %]</a>
438                                                 [% book.barcode | html %]
439                                             </td>
440                                             <td>
441                                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
442                                                     [% IF (forceallow) %]
443                                                         <input type="hidden" name="forceallow" value="1">
444                                                     [% END %]
445                                                     <input type="hidden" name="restoreduedatespec" />
446                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
447                                                     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
448                                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
449                                                     <input type="hidden" name="branch" value="[% branch | html %]" />
450                                                     <input type="hidden" name="barcode" value="[% book.barcode | html %]" />
451                                                     <button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
452                                                 </form>
453                                             </td>
454                                         </tr>
455                                     [% END %]
456                                 </table>
457                             </div>
458                             <div class="modal-footer">
459                                 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
460                             </div>
461                         </div>
462                     </div>
463                 </div>
464             [% END %]
465         [% END %]
466
467 [% ELSE %]
468   [% IF (forceallow) %]
469       <div id="overridden_debarment" class="dialog alert">Restriction overridden temporarily</div>
470   [% END %]
471 [% END %] <!-- /impossible -->
472
473 <span class="audio-alert-success"></span>
474
475 [% IF ( issued ) %]
476 <p>Item checked out</p>
477 [% END %]
478
479 [% IF ( message ) %]
480 [% INCLUDE 'patron-toolbar.inc' %]
481 <h4>
482 No patron matched <span class="ex">[% message | html %]</span>
483 </h4>
484 [% END %]
485
486 [% IF ( borrowers ) %]
487 [% INCLUDE 'patron-toolbar.inc' %]
488
489 <fieldset id="circ_circulation_selectborrower">
490     [% INCLUDE 'circ-patron-search-results.inc' destination = "circ" %]
491 </fieldset>
492 [% ELSE %]
493
494 <!-- BARCODE ENTRY -->
495
496 [% IF patron %]
497 <div class="yui-g">
498
499 [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
500     <div class="dialog alert"><strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.</div>
501 [% END %]
502
503 [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
504 <div class="yui-u first">
505
506 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
507     <input type="hidden" name="restoreduedatespec" />
508 [% IF ( issue ) %]
509     <fieldset id="circ_circulation_issue" class="lastchecked">
510 [% ELSE %]
511     <fieldset id="circ_circulation_issue">
512 [% END %]
513     [% IF ( DisplayClearScreenButton ) %]
514         <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
515         <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
516     [% END %]
517
518     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
519
520     <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
521
522         [% IF Koha.Preference('itemBarcodeFallbackSearch') %]
523             <div class="hint">Enter item barcode or keyword:</div>
524         [% ELSE %]
525             <div class="hint">Enter item barcode:</div>
526         [% END %]
527
528     [% IF NEEDSCONFIRMATION %]
529         <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
530     [% ELSE %]
531         <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" />
532     [% END %]
533     <button type="submit" class="btn btn-default">Check out</button>
534
535     <div id="show-checkout-settings">
536         <a href="#"><i class="fa fa-caret-right checkout-settings-icon"></i> Checkout settings</a>
537     </div>
538
539     <div class="checkout-settings">
540
541         [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
542             [% IF ( SpecifyDueDate ) %]
543                 <div id="specify-due-date" class="checkout-setting">
544                     <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
545                     [% IF ( duedatespec ) %]
546                         <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" />
547                     [% ELSE %]
548                         <input type="text" size="13" id="duedatespec" name="duedatespec" value="" />
549                     [% END %]
550                     <label for="stickyduedate"> Remember for session:</label>
551                     [% IF ( stickyduedate ) %]
552                         <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
553                     [% ELSE %]
554                         <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
555                     [% END %]
556                     <button class="btn btn-default btn-sm action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
557                 </div>
558             [% END %]
559         [% END %]
560
561         [% UNLESS ( noissues ) %]
562             <div id="set-automatic-renewal" class="checkout-setting">
563                 [% IF NEEDSCONFIRMATION %]
564                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
565                 [% ELSE %]
566                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
567                 [% END %]
568
569                 <label for="auto_renew">Automatic renewal</label>
570             </div>
571             [% IF Koha.Preference('decreaseLoanHighHolds') %]
572                 <div id="set_high_holds_overrride" class="checkout-setting">
573                     [% IF NEEDSCONFIRMATION %]
574                         [% IF override_high_holds %]
575                             <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
576                         [% ELSE %]
577                             <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
578                         [% END %]
579                     [% ELSE %]
580                         [% IF override_high_holds %]
581                             <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
582                         [% ELSE %]
583                             <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
584                         [% END %]
585                     [% END %]
586                     <label for="override_high_holds">Don't decrease checkout length based on holds</label>
587                 </div>
588             [% END %]
589         [% END %]
590
591         [% IF Koha.Preference('OnSiteCheckouts') %]
592             <div id="onsite_checkout-select" class="checkout-setting">
593                 [% IF noissues %]
594                     <div class="onsite-checkout-only">
595                         <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
596                         <input type="text" name="duedatespec" id="duedatespec" />
597                         <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
598                     </div>
599                 [% ELSE %]
600                     <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
601                 [% END %]
602             </div>
603         [% END %]
604
605     </div> <!-- /.checkout-settings -->
606
607           <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
608           <input type="hidden" name="branch" value="[% branch | html %]" />
609           <input type="hidden" name="print" value="maybe" />
610           <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
611                 [% IF ( CHARGES ) %]
612                         <input type="hidden" name="charges" value="yes" />
613                 [% END %]
614 </fieldset>
615 [% IF ( issue ) %]
616     <div class="lastchecked">
617         <p><strong>Checked out: </strong>[% issue.item.biblioitemnumber.biblionumber.title | html %] ([% issue.item.barcode | html %]). Due on [% issue.date_due | $KohaDates %]</p>
618     </div>
619 [% END %]
620 </form></div>
621
622 [% END %]<!-- /unless noissues -->
623
624 [% IF ( noissues ) %]
625     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
626         <div class="yui-u">
627     [% ELSE %]
628         <div>
629     [% END %]
630 [% ELSE %]
631     <div class="yui-u">
632 [% END %]
633
634         [% IF ( noissues ) %]
635             [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
636                 <div id="circmessages" class="circmessage attention">
637             [% ELSE %]
638                 <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
639                 <div id="circmessages" class="circmessage warning">
640             [% END %]
641             <h3>
642                 Cannot check out!
643                 [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
644                     <span class="circ-hlt">Only on-site checkouts are allowed</span>
645                 [% END %]
646             </h3>
647         [% ELSE %]
648             <div id="circmessages" class="circmessage attention">
649                 <h3>Attention:</h3>
650         [% END %]
651
652                 <ul>
653
654                    [% IF ( has_modifications ) %]
655                     <li><span class="circ-hlt">Pending modifications:</span> Patron has pending modifications.
656                             [% IF CAN_user_borrowers_edit_borrowers && ( !Koha.Preference('IndependentBranchesPatronModifications') || borrower.branch == branch ) %]
657                                     <a href="/cgi-bin/koha/members/members-update.pl">View all pending patron modifications</a>
658                             [% END %]
659                    </li>
660                   [% END %]
661
662                         [% IF ( warndeparture ) %]
663                         <li><span class="circ-hlt">Expiration:</span> Patron's card will expire soon.
664             Patron's card expires on [% expiry | $KohaDates %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;categorycode=[% categorycode | html %]">Edit details</a>
665
666                         </li>
667                         [% END %]
668
669                         [% IF ( returnbeforeexpiry ) %]
670                          <li><span class="circ-hlt">Set due date to expiry:</span> You have the ReturnBeforeExpiry system preference enabled this means if the
671                          expiry date is before the date due, the date due will be set to the expiry date
672                          </li>
673                         [% END %]
674
675                         [% IF ( expired ) %]
676                         <li><span class="circ-hlt">Expiration:</span> Patron's card has expired.
677             [% IF ( expiry ) %]Patron's card expired on [% expiry | $KohaDates %][% END %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;categorycode=[% categorycode | html %]">Edit details</a>
678
679                         </li>
680                         [% END %]
681
682             [% IF ( gna ) %]
683                         <li class="blocker"><span class="circ-hlt">Address:</span> Patron's address in doubt</li>
684                         [% END %]
685
686             [% IF ( lost ) %]
687                         <li class="blocker"><span class="circ-hlt">Lost: </span>Patron's card is lost</li>
688                         [% END %]
689
690             [% IF ( userdebarred ) %]
691                <li class="blocker">
692                    <span class="circ-hlt"> Restricted:</span> Patron's account is restricted
693
694                    [% IF ( userdebarreddate ) %]
695                        until [% userdebarreddate | $KohaDates %]
696                    [% END %]
697
698                    [% IF ( debarredcomment ) %]
699                        with the explanation: <br/><i>
700                        [% IF debarredcomment.search('OVERDUES_PROCESS') %]
701                            Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | $raw | html_line_break %]
702                        [% ELSE %]
703                            [% debarredcomment | $raw | html_line_break %]
704                        [% END %]
705                        </i>
706                    [% END %]
707                    <br/>
708                    <a class="btn btn-default btn-sm" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
709                     [% IF (noissues && patron && CAN_user_circulate_force_checkout) %]
710                         <span class="override_debarment">
711                             <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default btn-sm">Override restriction temporarily</a>
712                         </span>
713                     [% END %]
714                </li>
715             [% END %]
716
717                 [% IF ( odues ) %]<li><span class="circ-hlt">Overdues: Patron has ITEMS OVERDUE.</span> <a href="#checkouts">See highlighted items below</a></li>
718             [% END %]
719
720             [% IF ( charges ) %]
721                 [% INCLUDE 'blocked-fines.inc' fines = chargesamount %]
722             [% END %]
723
724             [% IF ( charges_guarantees ) %]
725                 <li>
726                     <span class="circ-hlt">Fees &amp; Charges:</span> Patron's guarantees collectively owe [% chargesamount_guarantees | $Price %].
727                         [% IF noissues %]
728                             <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
729                         [% END %]
730                 </li>
731             [% END %]
732
733
734             [% IF ( credits ) %]
735                 <li>
736                     <span class="circ-hlt">Credits:</span> Patron has a credit[% IF ( creditsamount ) %] of [% creditsamount | $Price %][% END %]
737                 </li>
738             [% END %]
739
740                         </ul>
741         </div>
742
743             [% IF WaitingHolds.count %]
744                 <div id="holdswaiting" class="circmessage">
745                     <h4>Holds waiting:</h4>
746                     [% FOREACH w IN WaitingHolds %]
747                         <ul>
748                             <li>
749                                 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% w.biblio.biblionumber | uri %]">[% w.biblio.title | html %]</a>
750                                 ([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]),
751                                 [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %]
752                                 [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber | html %]] [% END %]
753                                 Hold placed on [% w.reservedate | $KohaDates %].
754
755                                 <br/>
756                                 [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode()  ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]
757                                     [% SET expires_on = w.expirationdate %]
758                                     Waiting at [% w.branch.branchname | html %] [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %]
759                                 </strong>
760                             </li>
761                         </ul>
762                     [% END %]
763                 </div>
764             [% END %]
765
766         [% IF ( notes ) %]
767                         <div id="circnotes" class="circmessage">
768                         <h4>Notes:</h4>
769             <p><span class="circ-hlt">[% notesmsg | html %]</span></p>
770                         </div>
771
772
773     <!-- /If notes -->[% END %]
774
775     <div id="messages" class="circmessage">
776         <h4>Messages:</h4>
777         <ul>
778             [% FOREACH message IN messages %]
779                 <li>
780                     [% IF(message.message_type == "L") %]
781                         <span class="circ-hlt">
782                     [% ELSE %]
783                         <span>
784                     [% END %]
785                         [% message.message_date | $KohaDates %]
786                         [% Branches.GetName( message.branchcode ) | html %]
787                         [% IF message.manager_id %]
788                             ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.manager_id | uri %]">[% message.get_column('manager_firstname') | html %] [% message.get_column('manager_surname') | html %]</a> )
789                         [% END %]
790                         <i>"[% message.message | html %]"</i>
791                     </span>
792                     [% IF message.branchcode == branch OR Koha.Preference('AllowAllMessageDeletion') %]
793                         <a class="btn btn-link btn-sm" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id | html %]&amp;borrowernumber=[% message.borrowernumber | html %]" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a>
794                     [% END %]
795                 </li>
796             [% END %]
797         </ul>
798         <a id="addnewmessageLabel" href="#add_message_form" class="btn btn-link btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Add a new message</a>
799     </div>
800
801 </div>
802 </div>
803
804 <div class="yui-g"><div id="patronlists" class="toptabs">
805
806 <ul>
807     <li>
808         [% IF ( issuecount ) %]
809             <a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
810         [% ELSE %]
811             <a href="#checkouts">0 Checkouts</a>
812         [% END %]
813     </li>
814
815     [% IF relatives_issues_count %]
816         <li><a id="relatives-issues-tab" href="#relatives-issues">Relatives' checkouts</a></li>
817     [% END %]
818
819     <li>
820         [% IF ( holds_count ) %]
821             <a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a>
822         [% ELSE %]
823             <a href="#reserves" id="holds-tab">0 Holds</a>
824         [% END %]
825     </li>
826
827     [% IF Koha.Preference('ArticleRequests') %]
828         <li>
829             <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] Article requests</a>
830         </li>
831     [% END %]
832
833     <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li>
834
835     [% SET enrollments = patron.get_club_enrollments(1) %]
836     [% SET enrollable  = patron.get_enrollable_clubs(0,1) %]
837     [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
838         <li>
839             <a id="clubs-tab-link" href="#clubs-tab">
840                 Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
841             </a>
842         </li>
843     [% END %]
844
845 </ul>
846
847 <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
848
849 [% INCLUDE "checkouts-table.inc" %]
850
851 [% IF ( relatives_issues_count ) %]
852     <div id="relatives-issues">
853         <table id="relatives-issues-table">
854             <thead>
855                 <tr>
856                     <th scope="col">Due date (unformatted, hidden)</th>
857                     <th scope="col">Due date</th>
858                     <th scope="col">Title</th>
859                     <th scope="col">Item type</th>
860                     <th scope="col">Collection code</th>
861                     <th scope="col">Location</th>
862                     <th scope="col">Checked out on</th>
863                     <th scope="col">Checked out from</th>
864                     <th scope="col">Call no</th>
865                     <th scope="col">Charge</th>
866                     <th scope="col">Fine</th>
867                     <th scope="col">Price</th>
868                     <th scope="col">Patron</th>
869                 </tr>
870             </thead>
871         </table>
872     </div>
873 [% END %]
874
875 [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
876     <div id="clubs-tab">
877         Loading...
878     </div>
879 [% END %]
880
881 [% INCLUDE borrower_debarments.inc %]
882
883 <div id="reserves">
884 [% IF ( holds_count ) %]
885     <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
886         <input type="hidden" name="from" value="circ" />
887         <table id="holds-table" style="width: 100% !Important;">
888             <thead>
889                 <tr>
890                     <th>Hold date</th>
891                     <th>Title</th>
892                     <th>Call number</th>
893                     <th>Barcode</th>
894                     <th>Pickup at</th>
895                     <th>Expiration</th>
896                     <th>Priority</th>
897                     <th>Cancel?</th>
898                     <th>Suspend?</th>
899                 </tr>
900             </thead>
901         </table>
902
903         <fieldset class="action">
904             <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
905         </fieldset>
906     </form>
907
908     [% IF Koha.Preference('SuspendHoldsIntranet') %]
909     <fieldset class="action">
910         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
911             <input type="hidden" name="from" value="circ" />
912             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
913             <input type="submit" value="Suspend all holds" />
914
915             [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
916             <label for="suspend_until">until</label>
917             <input type="text" size="10" id="suspend_until" name="suspend_until" class="datepicker"/>
918             <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
919              [% END %]
920         </form>
921     </fieldset>
922
923     <fieldset class="action">
924         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
925             <input type="hidden" name="from" value="circ" />
926             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
927             <input type="hidden" name="suspend" value="0" />
928             <input type="submit" value="Resume all suspended holds" />
929         </form>
930     </fieldset>
931     [% END # IF SuspendHoldsIntranet %]
932
933 [% ELSE %]
934         <p>Patron has nothing on hold.</p>
935 [% END %]
936 </div> <!-- reservesloop -->
937
938 [% IF Koha.Preference('ArticleRequests') %]
939     [% INCLUDE 'patron-article-requests.inc' %]
940 [% END %]
941
942 [% ELSIF borrowernumber %]
943     <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
944 [% END %]
945 </div></div>
946 [% END %]
947 [% IF Koha.Preference('CircSidebar') %]
948 [% UNLESS ( borrowers ) %]
949     [% IF not( borrowernumber and patron ) %]
950         <div class="yui-b noprint">
951             [% INCLUDE 'circ-nav.inc' %]
952         </div>
953     [% END %]
954 [% END %]
955 [% END %]
956 </div>
957 </div>
958 [% UNLESS ( borrowers ) %]
959     [% IF borrowernumber and patron %]
960         <div class="yui-b">
961             [% INCLUDE 'circ-menu.inc' %]
962         </div>
963     [% END %]
964 [% END %]
965 </div>
966 <!-- Modal -->
967 <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
968     <div class="modal-dialog">
969     <div class="modal-content">
970     <div class="modal-header">
971         <h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
972     </div>
973
974     <div class="modal-body">
975         <p>You have already submitted a barcode, please wait for the checkout to process...</p>
976     </div>
977     </div>
978     </div>
979 </div>
980
981 [% MACRO jsinclude BLOCK %]
982     [% INCLUDE 'strings.inc' %]
983     [% INCLUDE 'calendar.inc' %]
984     [% INCLUDE 'datatables.inc' %]
985     [% INCLUDE 'columns_settings.inc' %]
986     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
987     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
988     [% INCLUDE 'timepicker.inc' %]
989     [% Asset.js("lib/jquery/plugins/jquery.dataTables.rowGrouping.js") | $raw %]
990     [% Asset.js("js/pages/circulation.js") | $raw %]
991     [% Asset.js("js/checkouts.js") | $raw %]
992     [% Asset.js("js/holds.js") | $raw %]
993     [% Asset.js("js/circ-patron-search-results.js") | $raw %]
994     <script type="text/javascript">
995         /* Set some variable needed in circulation.js */
996         var MSG_DT_LOADING_RECORDS = _("Loading... you may continue scanning.");
997         var interface = "[% interface | html %]";
998         var theme = "[% theme | html %]";
999         var borrowernumber = "[% patron.borrowernumber | html %]";
1000         var branchcode = "[% branch | html %]";
1001         var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]";
1002         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %];
1003         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %];
1004         var script = "circulation";
1005         var relatives_borrowernumbers = new Array();
1006         [% FOREACH b IN relatives_borrowernumbers %]
1007             relatives_borrowernumbers.push("[% b | html %]");
1008         [% END %]
1009
1010         var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
1011         var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone.");
1012
1013         columns_settings_issues_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1014         columns_settings_borrowers_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
1015
1016         [% IF borrowernumber and patron %]
1017             if($.cookie("holdfor") != [% patron.borrowernumber | html %]){
1018                 $.removeCookie("holdfor", { path: '/' });
1019             }
1020         [% ELSE %]
1021             $.removeCookie("holdfor", { path: '/' });
1022         [% END %]
1023
1024         [% UNLESS ( patron.borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
1025
1026         // On-site checkout
1027         function toggle_onsite_checkout(){
1028             if ( $("#onsite_checkout").prop('checked') ) {
1029                 $("#duedatespec").val("[% todaysdate | $KohaDates  with_hours => 1 %]")
1030                 [% IF !Koha.Preference('SpecifyDueDate') %]
1031                     $("#duedatespec").datetimepicker('destroy');
1032                 [% END %]
1033             } else {
1034                 $("#duedatespec").datetimepicker({
1035                     onClose: function(dateText, inst) {
1036                         if (validate_date(dateText, inst) ) {
1037                             $("#barcode").focus();
1038                         }
1039                     },
1040                     hour: 23,
1041                     minute: 59
1042                 }).on("change", function(e, value) {
1043                     if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
1044                 });
1045             }
1046         }
1047
1048         function Dopop(link) {
1049             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1050         }
1051         $(document).ready(function() {
1052             $('#mainform').on('submit',function() {
1053                 if ($("#barcode") && $("#barcode").val()) {
1054                     $('#barcode').on('keypress',function(event) {
1055                         $('#barcodeSubmittedModal').modal();
1056                         event.preventDefault(); }
1057                     );
1058                 }
1059             });
1060
1061             if ( $('#clubs-tab').length ) {
1062                 $('#clubs-tab-link').on('click', function() {
1063                     $('#clubs-tab').text(_("Loading..."));
1064                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber | html %]');
1065                 });
1066             }
1067
1068             [% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
1069                 // listen submit to trigger qslip on empty checkout
1070                 $('#mainform').bind('submit',function() {
1071                     if ($('#barcode').val() == '') {
1072                         return printx_window( '[% CircAutoPrintQuickSlip | html %]' );
1073                     }
1074                 });
1075             [% END %]
1076             toggle_onsite_checkout();
1077             $("#onsite_checkout").click(function(){
1078                 toggle_onsite_checkout();
1079             });
1080
1081             $("#suspend_until").datepicker({
1082                 onClose: function(dateText, inst) {
1083                     validate_date(dateText, inst);
1084                 },
1085                 minDate: 1, // require that hold suspended until date is after today
1086             });
1087
1088             [% IF HIGHHOLDS %]
1089                 [% IF !override_high_holds %]
1090                     $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]');
1091                     if ('[% duedatespec | html %]' === '') {
1092                         $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
1093                     } else {
1094                         $("input[name=restoreduedatespec]:hidden").val('[% duedatespec | html %]');
1095                     }
1096                 [% END %]
1097
1098                 $("#override_high_holds_tmp").on( 'change', function() {
1099                     if ( this.checked ) {
1100                         $("input[name=duedatespec]:hidden").val('');
1101                     }
1102                 });
1103             [% END %]
1104         });
1105     </script>
1106     [% INCLUDE 'str/members-menu.inc' %]
1107     [% Asset.js("js/members-menu.js") | $raw %]
1108 [% END %]
1109
1110 [% INCLUDE 'intranet-bottom.inc' %]