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