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