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