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