Bug 12001: Format DEBT correctly
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
1 [% USE Koha %]
2 [% USE Branches %]
3 [% USE KohaDates %]
4 [% USE Categories %]
5 [% USE ColumnsSettings %]
6 [% USE ItemTypes %]
7 [% USE Price %]
8 [% USE AuthorisedValues %]
9 [% SET footerjs = 1 %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 [% SET destination = "circ" %]
12 <title>Koha &rsaquo; Circulation
13 [% IF patron %]
14   &rsaquo; Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %]
15 [% END %]
16 </title>
17 [% INCLUDE 'doc-head-close.inc' %]
18 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
19 </head>
20
21 <body id="circ_circulation" class="circ">
22
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'circ-search.inc' %]
25
26 <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;
27 [% IF patron %]
28     <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> &rsaquo; [% INCLUDE 'patron-title.inc' %]
29 [% ELSE %]
30     <strong>Checkouts</strong>
31 [% END %]
32 </div>
33 [% IF ( $borrowers ) %]
34 <div id="doc" class="yui-t7">
35
36    <div id="bd">
37         <div id="yui-main">
38         <div class="yui-g">
39 [% ELSE %]
40 <div id="doc3" class="yui-t2">
41
42    <div id="bd">
43         <div id="yui-main">
44         <div class="yui-b">
45 [% END %]
46
47 [% IF patron %]
48 [% INCLUDE 'members-toolbar.inc' %]
49 [% END %]
50
51 <!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
52 [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>[% END %]
53
54 [% IF autoswitched %]
55     <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>
56 [% END %]
57
58 [% IF additional_materials %]
59     <div id="materials" class="dialog message">Note about the accompanying materials: <br />
60     [% additional_materials %]
61     </div>
62 [% END %]
63
64 [% IF ( alert.ITEM_LOST ) %]
65     <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST %]".</div>
66 [% END %]
67
68 [% IF ( alert.OTHER_CHARGES ) %]
69     <div class="dialog message">The patron has unpaid charges for holds, rentals etc of [% alert.OTHER_CHARGES %]</div>
70 [% END %]
71
72 [% IF alert.HIGHHOLDS %]
73     <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>
74 [% END %]
75
76 [% IF ( nopermission ) %]
77     <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
78 [% END %]
79
80 [% IF ( NEEDSCONFIRMATION ) %]
81 <div class="yui-g">
82
83 <div id="circ_needsconfirmation" class="dialog alert audio-alert-action">
84 [% IF CAN_user_circulate_force_checkout %]
85   <h3>Please confirm checkout</h3>
86 [% ELSE %]
87   <h3>Cannot check out</h3>
88 [% END %]
89
90 <ul>
91 [%IF ( AGE_RESTRICTION ) %]
92     <li>Age restriction [% AGE_RESTRICTION %].
93       [% IF CAN_user_circulate_force_checkout %]
94         Check out anyway?
95       [% END %]
96     </li>
97 [% END %]
98
99 [% IF ( DEBT ) %]
100     <li>The patron has a debt of [% DEBT | $Price %].</li>
101 [% END %]
102
103 [% IF ( DEBT_GUARANTEES ) %]
104     <li>The patron's guarantees collectively have a debt of [% DEBT_GUARANTEES | $Price %].</li>
105 [% END %]
106
107 [% IF ( RENTALCHARGE && RENTALCHARGE > 0 ) %]
108     <li>Rental charge for this item: [% RENTALCHARGE %]</li>
109 [% END %]
110
111 [% IF ( RENEW_ISSUE ) %]
112     <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) is currently checked out to this patron.  Renew?</li>
113 [% END %]
114
115 [% IF ( RESERVE_WAITING ) %]
116     <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>
117 [% END %]
118
119 [% IF ( RESERVED ) %]
120     <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>
121 [% END %]
122
123 [% IF ( ISSUED_TO_ANOTHER ) %]
124     <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 %]).
125       [% IF CAN_user_circulate_force_checkout %]
126         Check in and check out?
127       [% END %]
128     </li>
129 [% END %]
130
131 [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %]
132     <li>Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.</li>
133 [% END %]
134
135 [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %]
136     <li>Too many on-site checked out. [% current_loan_count %] on-site checked out, only [% max_loans_allowed %] are allowed.</li>
137 [% END %]
138
139 [% IF ( BORRNOTSAMEBRANCH ) %]
140     <li>This patron is from a different library ([% Branches.GetName( BORRNOTSAMEBRANCH ) %])</li>
141 [% END %]
142
143 [% IF ( PATRON_CANT ) %]
144     <li>This patron can't check out this item per library circulation policy.</li>
145 [% END %]
146
147 [% IF ( TOO_MANY and TOO_MANY == 'NO_RULE_DEFINED' ) %]
148     <li>No circulation rule is defined for this patron and itemtype combination.</li>
149 [% END %]
150
151 [% IF ( NOT_FOR_LOAN_FORCING ) %]
152     <li>
153     [% IF ( itemtype_notforloan ) %]
154         Item type is normally not for loan.
155     [% ELSIF ( item_notforloan ) %]
156         [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
157         Item is normally not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib %])[% END %].
158     [% END %]
159       [% IF CAN_user_circulate_force_checkout %]
160         Check out anyway?
161       [% END %]
162     </li>
163 [% END %]
164
165 [% IF ( USERBLOCKEDOVERDUE ) %]
166     <li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s).
167       [% IF CAN_user_circulate_force_checkout %]
168        Check out anyway?
169       [% END %]
170     </li>
171 [% END %]
172
173 [% IF ( ITEM_LOST ) %]
174     <li>This item has been lost with a status of "[% ITEM_LOST %]".
175       [% IF CAN_user_circulate_force_checkout %]
176         Check out anyway?
177       [% END %]
178     </li>
179 [% END %]
180
181 [% IF HIGHHOLDS %]
182     <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li>
183 [% END %]
184
185 [% IF PREVISSUE %]
186     <li>Patron has previously checked out this title: <b>[% biblio.title %] [% IF biblio.author %] by [% biblio.author %][% END %]</b>. Check out anyway?</li>
187 [% END %]
188
189 [% IF BIBLIO_ALREADY_ISSUED %]
190   <li>
191     Patron has already checked out another item from this record.
192     [% IF CAN_user_circulate_force_checkout %]
193       Check out anyway?
194     [% END %]
195   </li>
196 [% END %]
197 </ul>
198
199 [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
200 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
201     <input type="hidden" name="restoreduedatespec" />
202
203 [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
204
205 [% IF HIGHHOLDS %]
206     <p class="circ-override-high-holds">
207     <input type="checkbox" name="override_high_holds_tmp" id="override_high_holds_tmp" value="1" />
208     <label for="override_high_holds_tmp">Don't decrease loan length based on holds</label>
209     </p>
210 [% END %]
211
212 [% IF ( RESERVED ) %]
213     <p>
214     <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
215     <label for="cancelreserve">Cancel hold</label>
216     </p>
217 [% END %]
218
219 [% IF ( RESERVE_WAITING ) %]
220 <p>
221     <label for="cancelreserve">Cancel hold</label>
222     <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
223     <label for="revertreserve">Revert waiting status</label>
224     <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
225 </p>
226 [% END %]
227
228     <input type="hidden" name="barcode" value="[% barcode |html %]" />
229     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
230     <input type="hidden" name="issueconfirmed" value="1" />
231     <input type="hidden" name="override_high_holds" value="[% override_high_holds %]"/>
232     [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
233     [% IF ( INVALID_DATE ) %]
234     <p>
235     <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />
236     <label for="duedatespec">Due date</label>
237     </p>
238     [% ELSE %]
239     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
240     [% END %]
241     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
242     <input type="hidden" name="branch" value="[% branch %]" />
243     [% IF ( RENEW_ISSUE ) %]
244     <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
245     [% ELSE %]
246     <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, check out (Y)</button>
247     [% END %]
248     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout %]" />
249     <input type="hidden" name="auto_renew" value="[% auto_renew %]" />
250 </form>
251 [% END %]
252
253 [% IF ( RESERVED ) %]
254 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
255     <input type="hidden" name="restoreduedatespec" />
256     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
257     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
258     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
259     <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% reserveborrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
260 </form>
261 [% END %]
262
263 [% IF ( RESERVE_WAITING ) %]
264 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
265     <input type="hidden" name="restoreduedatespec" />
266     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
267     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
268     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
269     <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% reserveborrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
270 </form>
271 [% END %]
272
273 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
274     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
275     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
276     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
277     <input type="hidden" name="restoreduedatespec" />
278     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
279     [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
280         [% IF ( RENEW_ISSUE ) %]
281         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
282         [% ELSE %]
283         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't check out (N)</button>
284         [% END %]
285     [% ELSE %]
286         <button type="submit" class="deny"><i class="fa fa-times"></i> Continue</button>
287     [% END %]
288 </form>
289
290 [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
291     [% UNLESS noissues %]
292         <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>
293     [% END %]
294 [% END %]
295 </div></div>
296 [% END %] <!-- NEEDSCONFIRMATION -->
297
298         [% IF ( IMPOSSIBLE ) %]
299
300 <div class="yui-g">
301 <div id="circ_impossible" class="dialog alert audio-alert-warning">
302     [% IF ( UNKNOWN_BARCODE ) %]
303         <h3>Barcode not found</h3>
304     [% END %]
305 <!-- RESULT OF ISSUING REQUEST -->
306         <ul>
307         [% IF ( STATS ) %]
308             <li>Local use recorded</li>
309         [% END %]
310
311         [% IF ( INVALID_DATE ) %]
312             <li>The due date &quot;[% INVALID_DATE %]&quot; is invalid</li>
313         [% END %]
314
315         [% IF ( UNKNOWN_BARCODE ) %]
316             <li>The barcode was not found: <span class="ex">[% barcode |html %]</span>
317
318                 <div>
319                     [% IF ( FALLBACK ) %]
320                         [% IF options %]
321                             <button type="button" class="approve" data-toggle="modal" data-target="#itemSearchFallback"><i class="fa fa-search"></i> Show matching titles</button>
322                         [% ELSE %]
323                             <div>No items were found by searching.</div>
324                         [% END %]
325                     [% END %]
326
327                     [% IF ( fast_cataloging ) %]
328                         [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
329                             <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>
330                         [% END %]
331                     [% END %]
332                 </div>
333
334             </li>
335         [% END %]
336
337         [% IF ( NOT_FOR_LOAN ) %]
338             <li>
339             [% IF ( itemtype_notforloan ) %]
340                 Item type not for loan.
341             [% ELSIF ( item_notforloan ) %]
342                 [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
343                 Item not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib %])[% END %].
344             [% END %]
345             </li>
346         [% END %]
347
348         [% IF ( WTHDRAWN ) %]
349             <li>Item has been withdrawn</li>
350         [% END %]
351
352         [% IF ( RESTRICTED ) %]
353             <li>Item is restricted</li>
354         [% END %]
355
356         [% IF ( GNA ) %]
357             <li>Patron's address is in doubt</li>
358         [% END %]
359
360         [% IF ( CARD_LOST ) %]
361             <li>Patron's card is lost</li>
362         [% END %]
363
364         [% IF ( DEBARRED ) %]
365             <li>Patron is restricted</li>
366         [% END %]
367
368         [% IF ( NO_MORE_RENEWALS ) %]
369             <li>No more renewals possible</li>
370         [% END %]
371
372         [% IF NO_RENEWAL_FOR_ONSITE_CHECKOUTS %]
373             <li>This item can not be renewed, it's an on-site checkout</li>
374         [% END %]
375
376         [%IF ( AGE_RESTRICTION ) %]
377             <li>Age restriction [% AGE_RESTRICTION %].</li>
378         [% END %]
379
380         [% IF ( EXPIRED ) %]
381             <li>Patron's card is expired</li>
382         [% END %]
383
384         [% IF ( TOO_MANY ) %]
385             <li>Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.</li>
386         [% END %]
387
388         [% IF ( ITEMNOTSAMEBRANCH ) %]
389             <li>This item belongs to [% Branches.GetName( itemhomebranch ) %] and cannot be checked out from this location.</li>
390         [% END %]
391
392         [% IF RETURN_IMPOSSIBLE %]
393             <li>This item must be returned to [% Branches.GetName( branch_to_return ) %].</li>
394         [% END %]
395
396         [% IF ( USERBLOCKEDWITHENDDATE ) %]
397             <li>Patron has a restriction until [% USERBLOCKEDWITHENDDATE | $KohaDates %].</li>
398         [% END %]
399
400         [% IF ( USERBLOCKEDNOENDDATE ) %]
401             <li>Patron has an indefinite restriction.</li>
402         [% END %]
403
404         [% IF ( USERBLOCKEDOVERDUE ) %]
405             <li>Checkouts are BLOCKED because patron has overdue items.</li>
406         [% END %]
407         </ul>
408
409         [% IF (forceallow) %]
410             <li>Restriction overridden temporarily.</li>
411         [% END %]
412
413 </div></div>
414
415         [% IF ( FALLBACK ) %]
416             [% IF options %]
417
418                 <!-- Modal -->
419                 <div class="modal" id="itemSearchFallback" tabindex="-1" role="dialog" aria-labelledby="itemSearchFallbackLabel">
420                     <div class="modal-dialog modal-wide" role="document">
421                         <div class="modal-content">
422                             <div class="modal-header">
423                                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
424                                 <h3 id="itemSearchFallbackLabel"><h3>Barcode not found. The following items were found by searching:</h3>
425                             </div>
426                             <div class="modal-body">
427                                 <table class="table_borrowers">
428                                     [% FOREACH book IN options %]
429                                         <tr>
430                                             <td>
431                                                 <a class="popup" target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% book.biblionumber %]">[% book.title %]</a>
432                                                 [% book.barcode %]
433                                             </td>
434                                             <td>
435                                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
436                                                     [% IF (forceallow) %]
437                                                         <input type="hidden" name="forceallow" value="1">
438                                                     [% END %]
439                                                     <input type="hidden" name="restoreduedatespec" />
440                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
441                                                     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
442                                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
443                                                     <input type="hidden" name="branch" value="[% branch %]" />
444                                                     <input type="hidden" name="barcode" value="[% book.barcode %]" />
445                                                     <button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
446                                                 </form>
447                                             </td>
448                                         </tr>
449                                     [% END %]
450                                 </table>
451                             </div>
452                             <div class="modal-footer">
453                                 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
454                             </div>
455                         </div>
456                     </div>
457                 </div>
458             [% END %]
459         [% END %]
460
461 [% ELSE %]
462   [% IF (forceallow) %]
463       <div id="overridden_debarment" class="dialog alert">Restriction overridden temporarily</div>
464   [% END %]
465 [% END %] <!-- /impossible -->
466
467 <span class="audio-alert-success"></span>
468
469 [% IF ( issued ) %]
470 <p>Item checked out</p>
471 [% END %]
472
473 [% IF ( message ) %]
474 [% INCLUDE 'patron-toolbar.inc' %]
475 <h4>
476 No patron matched <span class="ex">[% message | html %]</span>
477 </h4>
478 [% END %]
479
480 [% IF ( borrowers ) %]
481 [% INCLUDE 'patron-toolbar.inc' %]
482
483 <fieldset id="circ_circulation_selectborrower">
484     [% INCLUDE 'circ-patron-search-results.inc' destination = "circ" %]
485 </fieldset>
486 [% ELSE %]
487
488 <!-- BARCODE ENTRY -->
489
490 [% IF patron %]
491 <div class="yui-g">
492
493 [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
494     <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>
495 [% END %]
496
497 [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
498 <div class="yui-u first">
499
500 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
501     <input type="hidden" name="restoreduedatespec" />
502 [% IF ( issue ) %]
503     <fieldset id="circ_circulation_issue" class="lastchecked">
504 [% ELSE %]
505     <fieldset id="circ_circulation_issue">
506 [% END %]
507     [% IF ( DisplayClearScreenButton ) %]
508         <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
509     [% END %]
510
511     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
512
513     <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
514
515         [% IF Koha.Preference('itemBarcodeFallbackSearch') %]
516             <div class="hint">Enter item barcode or keyword:</div>
517         [% ELSE %]
518             <div class="hint">Enter item barcode:</div>
519         [% END %]
520
521     [% IF NEEDSCONFIRMATION %]
522         <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
523     [% ELSE %]
524         <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" />
525     [% END %]
526     <button type="submit" class="btn btn-default">Check out</button>
527
528     <div id="show-checkout-settings">
529         <a href="#"><i class="fa fa-caret-right checkout-settings-icon"></i> Checkout settings</a>
530     </div>
531
532     <div class="checkout-settings">
533
534         [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
535             [% IF ( SpecifyDueDate ) %]
536                 <div id="specify-due-date" class="checkout-setting">
537                     <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
538                     [% IF ( duedatespec ) %]
539                         <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />
540                     [% ELSE %]
541                         <input type="text" size="13" id="duedatespec" name="duedatespec" value="" />
542                     [% END %]
543                     <label for="stickyduedate"> Remember for session:</label>
544                     [% IF ( stickyduedate ) %]
545                         <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
546                     [% ELSE %]
547                         <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
548                     [% END %]
549                     <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>
550                 </div>
551             [% END %]
552         [% END %]
553
554         [% UNLESS ( noissues ) %]
555             <div id="set-automatic-renewal" class="checkout-setting">
556                 [% IF NEEDSCONFIRMATION %]
557                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
558                 [% ELSE %]
559                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
560                 [% END %]
561
562                 <label for="auto_renew">Automatic renewal</label>
563             </div>
564             [% IF Koha.Preference('decreaseLoanHighHolds') %]
565                 <div id="set_high_holds_overrride" class="checkout-setting">
566                     [% IF NEEDSCONFIRMATION %]
567                         [% IF override_high_holds %]
568                             <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
569                         [% ELSE %]
570                             <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
571                         [% END %]
572                     [% ELSE %]
573                         [% IF override_high_holds %]
574                             <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
575                         [% ELSE %]
576                             <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
577                         [% END %]
578                     [% END %]
579                     <label for="override_high_holds">Don't decrease checkout length based on holds</label>
580                 </div>
581             [% END %]
582         [% END %]
583
584         [% IF Koha.Preference('OnSiteCheckouts') %]
585             <div id="onsite_checkout-select" class="checkout-setting">
586                 [% IF noissues %]
587                     <div class="onsite-checkout-only">
588                         <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>
589                         <input type="text" name="duedatespec" id="duedatespec" />
590                         <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
591                     </div>
592                 [% ELSE %]
593                     <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
594                 [% END %]
595             </div>
596         [% END %]
597
598     </div> <!-- /.checkout-settings -->
599
600           <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
601           <input type="hidden" name="branch" value="[% branch %]" />
602           <input type="hidden" name="print" value="maybe" />
603           <input type="hidden" name="debt_confirmed" value="[% debt_confirmed %]" />
604                 [% IF ( CHARGES ) %]
605                         <input type="hidden" name="charges" value="yes" />
606                         <input type="hidden" name="oldamount" value="[% amountold %]" />
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>[% IF ( nonreturns ) %]<span class="circ-hlt">Overdues: Patron has ITEMS OVERDUE.</span> <a href="#checkouts">See highlighted items below</a>[% END %]</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 ( charges_guarantees_is_blocker ) %]
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 %][% 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     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min_[% KOHA_VERSION %].js"></script>
980     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min_[% KOHA_VERSION %].js"></script>
981     [% INCLUDE 'timepicker.inc' %]
982     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping_[% KOHA_VERSION %].js"></script>
983     <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation_[% KOHA_VERSION %].js"></script>
984     <script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts_[% KOHA_VERSION %].js"></script>
985     <script type="text/javascript" src="[% interface %]/[% theme %]/js/holds_[% KOHA_VERSION %].js"></script>
986     <script type="text/javascript" src="[% interface %]/[% theme %]/js/circ-patron-search-results_[% KOHA_VERSION %].js"></script>
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         /* Set some variables needed in members-menu.js */
1007         var advsearch = "[% advsearch %]";
1008         var dateformat = "[% dateformat %]";
1009         var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
1010         var CATCODE_MULTI = "[% CATCODE_MULTI %]";
1011         var catcode = "[% catcode %]";
1012         var destination = "[% destination %]";
1013         var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
1014
1015         columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
1016
1017         [% IF borrowernumber and patron %]
1018             if($.cookie("holdfor") != [% patron.borrowernumber %]){
1019                 $.removeCookie("holdfor", { path: '/' });
1020             }
1021         [% ELSE %]
1022             $.removeCookie("holdfor", { path: '/' });
1023         [% END %]
1024
1025         [% UNLESS ( patron.borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
1026
1027         // On-site checkout
1028         function toggle_onsite_checkout(){
1029             if ( $("#onsite_checkout").prop('checked') ) {
1030                 $("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1%]")
1031                 [% IF !Koha.Preference('SpecifyDueDate') %]
1032                     $("#duedatespec").datetimepicker('destroy');
1033                 [% END %]
1034             } else {
1035                 $("#duedatespec").datetimepicker({
1036                     onClose: function(dateText, inst) {
1037                         if (validate_date(dateText, inst) ) {
1038                             $("#barcode").focus();
1039                         }
1040                     },
1041                     hour: 23,
1042                     minute: 59
1043                 }).on("change", function(e, value) {
1044                     if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
1045                 });
1046             }
1047         }
1048
1049         function Dopop(link) {
1050             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1051         }
1052         $(document).ready(function() {
1053             $('#mainform').on('submit',function() {
1054                 if ($("#barcode") && $("#barcode").val()) {
1055                     $('#barcode').on('keypress',function(event) {
1056                         $('#barcodeSubmittedModal').modal();
1057                         event.preventDefault(); }
1058                     );
1059                 }
1060             });
1061
1062             if ( $('#clubs-tab').length ) {
1063                 $('#clubs-tab-link').on('click', function() {
1064                     $('#clubs-tab').text(_("Loading..."));
1065                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber %]');
1066                 });
1067             }
1068
1069             [% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
1070                 // listen submit to trigger qslip on empty checkout
1071                 $('#mainform').bind('submit',function() {
1072                     if ($('#barcode').val() == '') {
1073                         return printx_window( '[% CircAutoPrintQuickSlip %]' );
1074                     }
1075                 });
1076             [% END %]
1077             toggle_onsite_checkout();
1078             $("#onsite_checkout").click(function(){
1079                 toggle_onsite_checkout();
1080             });
1081
1082             $("#suspend_until").datepicker({
1083                 onClose: function(dateText, inst) {
1084                     validate_date(dateText, inst);
1085                 },
1086                 minDate: 1, // require that hold suspended until date is after today
1087             });
1088
1089             [% IF HIGHHOLDS %]
1090                 [% IF !override_high_holds %]
1091                     $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]');
1092                     if ('[% duedatespec %]' === '') {
1093                         $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
1094                     } else {
1095                         $("input[name=restoreduedatespec]:hidden").val('[% duedatespec %]');
1096                     }
1097                 [% END %]
1098
1099                 $("#override_high_holds_tmp").on( 'change', function() {
1100                     if ( this.checked ) {
1101                         $("input[name=duedatespec]:hidden").val('');
1102                     }
1103                 });
1104             [% END %]
1105         });
1106     </script>
1107     <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script>
1108 [% END %]
1109
1110 [% INCLUDE 'intranet-bottom.inc' %]