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