Bug 19933: Remove patronflags - tricky ones
[koha.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                 [% END %]
607 </fieldset>
608 [% IF ( issue ) %]
609     <div class="lastchecked">
610         <p><strong>Checked out: </strong>[% issue.item.biblioitemnumber.biblionumber.title %] ([% issue.item.barcode %]). Due on [% issue.date_due | $KohaDates %]</p>
611     </div>
612 [% END %]
613 </form></div>
614
615 [% END %]<!-- /unless noissues -->
616
617 [% IF ( noissues ) %]
618     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
619         <div class="yui-u">
620     [% ELSE %]
621         <div>
622     [% END %]
623 [% ELSE %]
624     <div class="yui-u">
625 [% END %]
626
627         [% IF ( noissues ) %]
628             [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
629                 <div id="circmessages" class="circmessage attention">
630             [% ELSE %]
631                 <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
632                 <div id="circmessages" class="circmessage warning">
633             [% END %]
634             <h3>
635                 Cannot check out!
636                 [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
637                     <span class="circ-hlt">Only on-site checkouts are allowed</span>
638                 [% END %]
639             </h3>
640         [% ELSE %]
641             <div id="circmessages" class="circmessage attention">
642                 <h3>Attention:</h3>
643         [% END %]
644
645                 <ul>
646
647                    [% IF ( has_modifications ) %]
648                     <li><span class="circ-hlt">Pending modifications:</span> Patron has pending modifications.
649                             [% IF CAN_user_borrowers_edit_borrowers && ( !Koha.Preference('IndependentBranchesPatronModifications') || borrower.branch == branch ) %]
650                                     <a href="/cgi-bin/koha/members/members-update.pl">View all pending patron modifications</a>
651                             [% END %]
652                    </li>
653                   [% END %]
654
655                         [% IF ( warndeparture ) %]
656                         <li><span class="circ-hlt">Expiration:</span> Patron's card will expire soon.
657             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>
658
659                         </li>
660                         [% END %]
661
662                         [% IF ( returnbeforeexpiry ) %]
663                          <li><span class="circ-hlt">Set due date to expiry:</span> You have the ReturnBeforeExpiry system preference enabled this means if the
664                          expiry date is before the date due, the date due will be set to the expiry date
665                          </li>
666                         [% END %]
667
668                         [% IF ( expired ) %]
669                         <li><span class="circ-hlt">Expiration:</span> Patron's card has expired.
670             [% 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>
671
672                         </li>
673                         [% END %]
674
675             [% IF ( gna ) %]
676                         <li class="blocker"><span class="circ-hlt">Address:</span> Patron's address in doubt</li>
677                         [% END %]
678
679             [% IF ( lost ) %]
680                         <li class="blocker"><span class="circ-hlt">Lost: </span>Patron's card is lost</li>
681                         [% END %]
682
683             [% IF ( userdebarred ) %]
684                <li class="blocker">
685                    <span class="circ-hlt"> Restricted:</span> Patron's account is restricted
686
687                    [% IF ( userdebarreddate ) %]
688                        until [% userdebarreddate | $KohaDates %]
689                    [% END %]
690
691                    [% IF ( debarredcomment ) %]
692                        with the explanation: <br/><i>
693                            [% IF debarredcomment.search('OVERDUES_PROCESS') %]
694                                Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
695                            [% ELSE %]
696                                [% debarredcomment | html_line_break %]
697                            [% END %]
698                     </i>
699                    [% END %]
700                    <br/>
701                    <a class="btn btn-default btn-sm" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
702                     [% IF (noissues && patron && CAN_user_circulate_force_checkout) %]
703                         <span class="override_debarment">
704                             <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber %]" class="btn btn-default btn-sm">Override restriction temporarily</a>
705                         </span>
706                     [% END %]
707                </li>
708             [% END %]
709
710                 [% IF ( odues ) %]<li><span class="circ-hlt">Overdues: Patron has ITEMS OVERDUE.</span> <a href="#checkouts">See highlighted items below</a></li>
711             [% END %]
712
713             [% IF ( charges ) %]
714                 [% INCLUDE 'blocked-fines.inc' fines = chargesamount %]
715             [% END %]
716
717             [% IF ( charges_guarantees ) %]
718                 <li>
719                     <span class="circ-hlt">Fees &amp; Charges:</span> Patron's guarantees collectively owe [% chargesamount_guarantees | $Price %].
720                         [% IF noissues %]
721                             <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
722                         [% END %]
723                 </li>
724             [% END %]
725
726
727             [% IF ( credits ) %]
728                 <li>
729                     <span class="circ-hlt">Credits:</span> Patron has a credit[% IF ( creditsamount ) %] of [% creditsamount | $Price %][% END %]
730                 </li>
731             [% END %]
732
733                         </ul>
734         </div>
735
736             [% IF WaitingHolds.count %]
737                 <div id="holdswaiting" class="circmessage">
738                     <h4>Holds waiting:</h4>
739                     [% FOREACH w IN WaitingHolds %]
740                         <ul>
741                             <li>
742                                 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% w.biblio.biblionumber %]">[% w.biblio.title | html %]</a>
743                                 ([% ItemTypes.GetDescription( w.item.effective_itemtype ) %]),
744                                 [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %]
745                                 [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber %]] [% END %]
746                                 Hold placed on [% w.reservedate | $KohaDates %].
747
748                                 <br/>
749                                 [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode()  ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]
750                                     [% SET expires_on = w.expirationdate %]
751                                     Waiting at [% w.branch.branchname | html %] [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %]
752                                 </strong>
753                             </li>
754                         </ul>
755                     [% END %]
756                 </div>
757             [% END %]
758
759         [% IF ( notes ) %]
760                         <div id="circnotes" class="circmessage">
761                         <h4>Notes:</h4>
762             <p><span class="circ-hlt">[% notesmsg %]</span></p>
763                         </div>
764
765
766     <!-- /If notes -->[% END %]
767
768     <div id="messages" class="circmessage">
769         <h4>Messages:</h4>
770         <ul>
771             [% FOREACH message IN messages %]
772                 <li>
773                     [% IF(message.message_type == "L") %]
774                         <span class="circ-hlt">
775                     [% ELSE %]
776                         <span>
777                     [% END %]
778                         [% message.message_date | $KohaDates %]
779                         [% Branches.GetName( message.branchcode ) %]
780                         [% IF message.manager_id %]
781                             ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.manager_id %]">[% message.get_column('manager_firstname') %] [% message.get_column('manager_surname') %]</a> )
782                         [% END %]
783                         <i>"[% message.message | html %]"</i>
784                     </span>
785                     [% IF message.branchcode == branch OR Koha.Preference('AllowAllMessageDeletion') %]
786                         <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>
787                     [% END %]
788                 </li>
789             [% END %]
790         </ul>
791         <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>
792     </div>
793
794 </div>
795 </div>
796
797 <div class="yui-g"><div id="patronlists" class="toptabs">
798
799 <ul>
800     <li>
801         [% IF ( issuecount ) %]
802             <a href="#checkouts">[% issuecount %] Checkout(s)</a>
803         [% ELSE %]
804             <a href="#checkouts">0 Checkouts</a>
805         [% END %]
806     </li>
807
808     [% IF relatives_issues_count %]
809         <li><a id="relatives-issues-tab" href="#relatives-issues">Relatives' checkouts</a></li>
810     [% END %]
811
812     <li>
813         [% IF ( holds_count ) %]
814             <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a>
815         [% ELSE %]
816             <a href="#reserves" id="holds-tab">0 Holds</a>
817         [% END %]
818     </li>
819
820     [% IF Koha.Preference('ArticleRequests') %]
821         <li>
822             <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count %] Article requests</a>
823         </li>
824     [% END %]
825
826     <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count %] Restrictions</a></li>
827
828     [% SET enrollments = patron.get_club_enrollments(1) %]
829     [% SET enrollable  = patron.get_enrollable_clubs(0,1) %]
830     [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
831         <li>
832             <a id="clubs-tab-link" href="#clubs-tab">
833                 Clubs ([% enrollments.count %]/[% enrollable.count %])
834             </a>
835         </li>
836     [% END %]
837
838 </ul>
839
840 <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
841
842 [% INCLUDE "checkouts-table.inc" %]
843
844 [% IF ( relatives_issues_count ) %]
845     <div id="relatives-issues">
846         <table id="relatives-issues-table">
847             <thead>
848                 <tr>
849                     <th scope="col">Due date (unformatted, hidden)</th>
850                     <th scope="col">Due date</th>
851                     <th scope="col">Title</th>
852                     <th scope="col">Item type</th>
853                     <th scope="col">Location</th>
854                     <th scope="col">Checked out on</th>
855                     <th scope="col">Checked out from</th>
856                     <th scope="col">Call no</th>
857                     <th scope="col">Charge</th>
858                     <th scope="col">Fine</th>
859                     <th scope="col">Price</th>
860                     <th scope="col">Patron</th>
861                 </tr>
862             </thead>
863         </table>
864     </div>
865 [% END %]
866
867 [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
868     <div id="clubs-tab">
869         Loading...
870     </div>
871 [% END %]
872
873 [% INCLUDE borrower_debarments.inc %]
874
875 <div id="reserves">
876 [% IF ( holds_count ) %]
877     <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
878         <input type="hidden" name="from" value="circ" />
879         <table id="holds-table" style="width: 100% !Important;">
880             <thead>
881                 <tr>
882                     <th>Hold date</th>
883                     <th>Title</th>
884                     <th>Call number</th>
885                     <th>Barcode</th>
886                     <th>Pickup at</th>
887                     <th>Expiration</th>
888                     <th>Priority</th>
889                     <th>Cancel?</th>
890                     <th>Suspend?</th>
891                 </tr>
892             </thead>
893         </table>
894
895         <fieldset class="action">
896             <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
897         </fieldset>
898     </form>
899
900     [% IF Koha.Preference('SuspendHoldsIntranet') %]
901     <fieldset class="action">
902         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
903             <input type="hidden" name="from" value="circ" />
904             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
905             <input type="submit" value="Suspend all holds" />
906
907             [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
908             <label for="suspend_until">until</label>
909             <input type="text" size="10" id="suspend_until" name="suspend_until" class="datepicker"/>
910             <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
911              [% END %]
912         </form>
913     </fieldset>
914
915     <fieldset class="action">
916         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
917             <input type="hidden" name="from" value="circ" />
918             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
919             <input type="hidden" name="suspend" value="0" />
920             <input type="submit" value="Resume all suspended holds" />
921         </form>
922     </fieldset>
923     [% END # IF SuspendHoldsIntranet %]
924
925 [% ELSE %]
926         <p>Patron has nothing on hold.</p>
927 [% END %]
928 </div> <!-- reservesloop -->
929
930 [% IF Koha.Preference('ArticleRequests') %]
931     [% INCLUDE 'patron-article-requests.inc' %]
932 [% END %]
933
934 [% ELSIF borrowernumber %]
935     <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
936 [% END %]
937 </div></div>
938 [% END %]
939 [% IF Koha.Preference('CircSidebar') %]
940 [% UNLESS ( borrowers ) %]
941     [% IF not( borrowernumber and patron ) %]
942         <div class="yui-b noprint">
943             [% INCLUDE 'circ-nav.inc' %]
944         </div>
945     [% END %]
946 [% END %]
947 [% END %]
948 </div>
949 </div>
950 [% UNLESS ( borrowers ) %]
951     [% IF borrowernumber and patron %]
952         <div class="yui-b">
953             [% INCLUDE 'circ-menu.inc' %]
954         </div>
955     [% END %]
956 [% END %]
957 </div>
958 <!-- Modal -->
959 <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
960     <div class="modal-dialog">
961     <div class="modal-content">
962     <div class="modal-header">
963         <h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
964     </div>
965
966     <div class="modal-body">
967         <p>You have already submitted a barcode, please wait for the checkout to process...</p>
968     </div>
969     </div>
970     </div>
971 </div>
972
973 [% MACRO jsinclude BLOCK %]
974     [% INCLUDE 'strings.inc' %]
975     [% INCLUDE 'calendar.inc' %]
976     [% INCLUDE 'datatables.inc' %]
977     [% INCLUDE 'columns_settings.inc' %]
978     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min_[% KOHA_VERSION %].js"></script>
979     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min_[% KOHA_VERSION %].js"></script>
980     [% INCLUDE 'timepicker.inc' %]
981     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping_[% KOHA_VERSION %].js"></script>
982     <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation_[% KOHA_VERSION %].js"></script>
983     <script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts_[% KOHA_VERSION %].js"></script>
984     <script type="text/javascript" src="[% interface %]/[% theme %]/js/holds_[% KOHA_VERSION %].js"></script>
985     <script type="text/javascript" src="[% interface %]/[% theme %]/js/circ-patron-search-results_[% KOHA_VERSION %].js"></script>
986     <script type="text/javascript">
987         /* Set some variable needed in circulation.js */
988         var MSG_DT_LOADING_RECORDS = _("Loading... you may continue scanning.");
989         var interface = "[% interface %]";
990         var theme = "[% theme %]";
991         var borrowernumber = "[% patron.borrowernumber %]";
992         var branchcode = "[% branch %]";
993         var exports_enabled = "[% Koha.Preference('ExportCircHistory') %]";
994         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %];
995         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %];
996         var script = "circulation";
997         var relatives_borrowernumbers = new Array();
998         [% FOREACH b IN relatives_borrowernumbers %]
999             relatives_borrowernumbers.push("[% b %]");
1000         [% END %]
1001
1002         var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
1003         var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone.");
1004
1005         /* Set some variables needed in members-menu.js */
1006         var advsearch = "[% advsearch %]";
1007         var dateformat = "[% dateformat %]";
1008         var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
1009         var CATCODE_MULTI = "[% CATCODE_MULTI %]";
1010         var catcode = "[% catcode %]";
1011         var destination = "[% destination %]";
1012         var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
1013
1014         columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
1015
1016         [% IF borrowernumber and patron %]
1017             if($.cookie("holdfor") != [% patron.borrowernumber %]){
1018                 $.removeCookie("holdfor", { path: '/' });
1019             }
1020         [% ELSE %]
1021             $.removeCookie("holdfor", { path: '/' });
1022         [% END %]
1023
1024         [% UNLESS ( patron.borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
1025
1026         // On-site checkout
1027         function toggle_onsite_checkout(){
1028             if ( $("#onsite_checkout").prop('checked') ) {
1029                 $("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1%]")
1030                 [% IF !Koha.Preference('SpecifyDueDate') %]
1031                     $("#duedatespec").datetimepicker('destroy');
1032                 [% END %]
1033             } else {
1034                 $("#duedatespec").datetimepicker({
1035                     onClose: function(dateText, inst) {
1036                         if (validate_date(dateText, inst) ) {
1037                             $("#barcode").focus();
1038                         }
1039                     },
1040                     hour: 23,
1041                     minute: 59
1042                 }).on("change", function(e, value) {
1043                     if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
1044                 });
1045             }
1046         }
1047
1048         function Dopop(link) {
1049             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1050         }
1051         $(document).ready(function() {
1052             $('#mainform').on('submit',function() {
1053                 if ($("#barcode") && $("#barcode").val()) {
1054                     $('#barcode').on('keypress',function(event) {
1055                         $('#barcodeSubmittedModal').modal();
1056                         event.preventDefault(); }
1057                     );
1058                 }
1059             });
1060
1061             if ( $('#clubs-tab').length ) {
1062                 $('#clubs-tab-link').on('click', function() {
1063                     $('#clubs-tab').text(_("Loading..."));
1064                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber %]');
1065                 });
1066             }
1067
1068             [% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
1069                 // listen submit to trigger qslip on empty checkout
1070                 $('#mainform').bind('submit',function() {
1071                     if ($('#barcode').val() == '') {
1072                         return printx_window( '[% CircAutoPrintQuickSlip %]' );
1073                     }
1074                 });
1075             [% END %]
1076             toggle_onsite_checkout();
1077             $("#onsite_checkout").click(function(){
1078                 toggle_onsite_checkout();
1079             });
1080
1081             $("#suspend_until").datepicker({
1082                 onClose: function(dateText, inst) {
1083                     validate_date(dateText, inst);
1084                 },
1085                 minDate: 1, // require that hold suspended until date is after today
1086             });
1087
1088             [% IF HIGHHOLDS %]
1089                 [% IF !override_high_holds %]
1090                     $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]');
1091                     if ('[% duedatespec %]' === '') {
1092                         $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
1093                     } else {
1094                         $("input[name=restoreduedatespec]:hidden").val('[% duedatespec %]');
1095                     }
1096                 [% END %]
1097
1098                 $("#override_high_holds_tmp").on( 'change', function() {
1099                     if ( this.checked ) {
1100                         $("input[name=duedatespec]:hidden").val('');
1101                     }
1102                 });
1103             [% END %]
1104         });
1105     </script>
1106     <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script>
1107 [% END %]
1108
1109 [% INCLUDE 'intranet-bottom.inc' %]