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