Bug 33597: (follow-up) Two other occurrences for holdfor
[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                                                             </td>
557                                                             <td>
558                                                                 [% item.barcode | html %]
559                                                             </td>
560                                                             <td>[% item.itemcallnumber | html %]</th>
561                                                             <td>[% item.copynumber | html %]</th>
562                                                             <td>[% item.stocknumber| html %]</th>
563                                                             <td>[% item.enumchron| html %]</th>
564                                                             <td>
565                                                                 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]
566                                                             </td>
567                                                             [% IF ( item_level_itypes ) %]
568                                                                 <td>
569                                                                     [% ItemTypes.GetDescription( item.itype ) | html %]
570                                                                 </td>
571                                                             [% END %]
572                                                             <td>
573                                                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
574                                                                     [% IF (forceallow) %]
575                                                                         <input type="hidden" name="forceallow" value="1">
576                                                                     [% END %]
577                                                                     <input type="hidden" name="restoreduedatespec" />
578                                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
579                                                                     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
580                                                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
581                                                                     <input type="hidden" name="branch" value="[% branch | html %]" />
582                                                                     <input type="hidden" name="barcode" value="[% item.barcode | html %]" />
583                                                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
584                                                                     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
585                                                                     <button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
586                                                                 </form>
587                                                             </td>
588                                                         </tr>
589                                                     [% END %]
590                                                     </tbody>
591                                                 </table>
592                                             </div> <!-- /.modal-body -->
593                                             <div class="modal-footer">
594                                                 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
595                                             </div>
596                                         </div> <!-- /.modal-content -->
597                                     </div> <!-- /.modal-dialog.modal-wide -->
598                                 </div> <!-- /#itemSearchFallback -->
599                             [% END # /IF options %]
600                         [% END # /IF FALLBACK %]
601
602                     [% ELSE # IF IMPOSSIBLE %]
603                         [% IF (forceallow) %]
604                             <div id="overridden_debarment" class="dialog alert">Restriction overridden temporarily</div>
605                         [% END %]
606                     [% END # /IF IMPOSSIBLE %]
607
608                     <span class="audio-alert-success"></span>
609
610                     [% IF ( issued ) %]
611                         <p>Item checked out</p>
612                     [% END %]
613
614                     [% IF ( message ) %]
615                         [% INCLUDE 'patron-toolbar.inc' %]
616                         <h4>No patron matched <span class="ex">[% message | html %]</span></h4>
617                     [% END %]
618
619                     <!-- BARCODE ENTRY -->
620
621                     [% IF patron %]
622
623                         [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
624                             <div class="dialog alert">
625                                 <strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
626                             </div>
627                         [% END %]
628
629                         <div class="row">
630                             [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
631                                 <div class="col-sm-6">
632                                     <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
633                                         <input type="hidden" name="restoreduedatespec" />
634                                         [% IF ( issue ) %]
635                                             <fieldset id="circ_circulation_issue" class="lastchecked">
636                                         [% ELSE %]
637                                             <fieldset id="circ_circulation_issue">
638                                         [% END %]
639
640                                         [% IF Koha.Preference('DisplayClearScreenButton') == 'issueslip' %]
641                                             <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
642                                             <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
643                                         [% ELSIF Koha.Preference('DisplayClearScreenButton') == 'issueqslip' %]
644                                             <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
645                                             <span id="printclearscreenq"><a href="#" title="Print quick slip and clear screen"><i class="fa fa-print"></i></a></span>
646                                         [% END %]
647
648                                         [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
649
650                                         <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
651
652                                         [% IF NEEDSCONFIRMATION %]
653                                             <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
654                                         [% ELSE %]
655                                             [% IF Koha.Preference('itemBarcodeFallbackSearch') %]
656                                                 <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" placeholder="Enter item barcode or keyword" />
657                                             [% ELSE %]
658                                                 <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" placeholder="Enter item barcode" />
659                                             [% END %]
660                                         [% END %]
661
662                                         <div id="show-circ-settings">
663                                             <a href="#" title="Checkout settings"><i class="fa fa-sliders"></i></a>
664                                         </div>
665
666                                         <button type="submit" class="btn btn-primary">Check out</button>
667
668                                         <div class="circ-settings">
669
670                                                 [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
671                                                     [% IF ( SpecifyDueDate ) %]
672                                                         <div id="specify-due-date" class="circ-setting">
673                                                             <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
674                                                             [% IF ( duedatespec ) %]
675                                                                 <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" />
676                                                             [% ELSE %]
677                                                                 <input type="text" size="20" id="duedatespec" name="duedatespec" value="" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
678                                                             [% END %]
679                                                             <label for="stickyduedate"> Remember for session:</label>
680                                                             [% IF ( stickyduedate ) %]
681                                                                 <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
682                                                             [% ELSE %]
683                                                                 <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
684                                                             [% END %]
685                                                         </div>
686                                                     [% END %]
687                                                 [% END %]
688
689                                                 [% UNLESS ( noissues ) %]
690                                                     [% IF Koha.Preference('AllowSetAutomaticRenewal') %]
691                                                         <div id="set-automatic-renewal" class="circ-setting">
692                                                             [% IF NEEDSCONFIRMATION %]
693                                                                 [% IF auto_renew %]
694                                                                     [% IF patron.autorenew_checkouts %]
695                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
696                                                                         title="Patron has opted out of auto-renewal"/>
697                                                                     [% ELSE %]
698                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
699                                                                     [% END %]
700                                                                 [% ELSE %]
701                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
702                                                                 [% END %]
703                                                             [% ELSE %]
704                                                                 [% IF ( auto_renew && patron.autorenew_checkouts ) %]
705                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
706                                                                 [% ELSIF patron.autorenew_checkouts %]
707                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
708                                                                 [% ELSE %]
709                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
710                                                                     title="Patron has opted out of auto-renewal"/>
711                                                                 [% END %]
712                                                             [% END %]
713
714                                                             <label for="auto_renew">Automatic renewal</label>
715                                                         </div>
716                                                     [% END %]
717                                                     [% IF Koha.Preference('decreaseLoanHighHolds') %]
718                                                         <div id="set_high_holds_overrride" class="circ-setting">
719                                                             [% IF NEEDSCONFIRMATION %]
720                                                                 [% IF override_high_holds %]
721                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
722                                                                 [% ELSE %]
723                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
724                                                                 [% END %]
725                                                             [% ELSE %]
726                                                                 [% IF override_high_holds %]
727                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
728                                                                 [% ELSE %]
729                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
730                                                                 [% END %]
731                                                             [% END %]
732                                                             <label for="override_high_holds">Don't decrease checkout length based on holds</label>
733                                                         </div>
734                                                     [% END %]
735                                                 [% END %]
736
737                                                 [% IF Koha.Preference('OnSiteCheckouts') %]
738                                                     <div id="onsite_checkout-select" class="circ-setting">
739                                                         [% IF noissues %]
740                                                             <div class="onsite-checkout-only">
741                                                                 <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>
742                                                                 <input type="text" name="duedatespec" id="duedatespec" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
743                                                                 <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
744                                                             </div>
745                                                         [% ELSE %]
746                                                             [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
747                                                             <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
748                                                             [% ELSE %]
749                                                             <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
750                                                             [% END %]
751                                                         [% END %]
752                                                     </div>
753                                                 [% END %]
754
755                                             </div> <!-- /.circ-settings -->
756
757                                             <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
758                                             <input type="hidden" name="branch" value="[% branch | html %]" />
759                                             <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
760                                             [% IF ( CHARGES ) %]
761                                                     <input type="hidden" name="charges" value="yes" />
762                                             [% END %]
763                                         </fieldset> <!-- /#circ_circulation_issue -->
764
765                                         [% IF ( issue ) %]
766                                             <div class="lastchecked">
767                                                 <p>
768                                                     <strong>Checked out: </strong>
769                                                     [% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]).
770
771                                                     [% IF issue.item.is_bundle %]
772                                                         [% SET bundle_items_count = issue.item.bundle_items.count %]
773                                                         [% tnx('Bundle of {count} item', 'Bundle of {count} items', bundle_items_count, { count = bundle_items_count }) | html %].
774                                                     [% END %]
775
776                                                     Due on [% issue.date_due | $KohaDates as_due_date => 1 %]
777                                                 </p>
778                                             </div>
779                                         [% END %]
780                                     </form> <!-- /#mainform -->
781                                 </div> <!-- /.col-sm-6 -->
782
783                             [% END #/IF !noissues %]
784
785                             [% IF ( noissues ) %]
786                                 [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
787                                     <div class="col-sm-6">
788                                 [% ELSE %]
789                                     <div>
790                                 [% END %]
791                             [% ELSE %]
792                                 <div class="col-sm-6">
793                             [% END %]
794
795                             [% IF ( noissues ) %]
796                                 [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
797                                     <div id="circmessages" class="circmessage attention">
798                                 [% ELSE %]
799                                     <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
800                                     <div id="circmessages" class="circmessage warning">
801                                 [% END %]
802                                 <h3>
803                                     Cannot check out!
804                                     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
805                                         <span class="circ-hlt">Only on-site checkouts are allowed</span>
806                                     [% END %]
807                                 </h3>
808                             [% ELSE %]
809                                 <div id="circmessages" class="circmessage attention">
810                             [% END %]
811
812                             [% INCLUDE 'patron_messages.inc' %]
813
814                         </div> <!-- /#circmessages -->
815                     </div> <!-- /div or div.col-sm-6 -->
816                 </div> <!-- /.row -->
817
818                 <div id="patronlists" class="toptabs">
819                     <ul class="nav nav-tabs" role="tablist">
820                         <li role="presentation" class="active">
821                             <a href="#checkouts" aria-controls="checkouts" role="tab" data-toggle="tab">Checkouts ([% issuecount || 0 | html %])</a>
822                         </li>
823
824                         [% IF relatives_issues_count %]
825                             <li role="presentation">
826                                 <a id="relatives-issues-tab" href="#relatives-issues" aria-controls="relatives-issues" role="tab" data-toggle="tab">Relatives' checkouts ([% relatives_issues_count | html %])</a>
827                             </li>
828                         [% END %]
829
830                         <li role="presentation">
831                             <a href="#reserves" id="holds-tab" aria-controls="reserves" role="tab" data-toggle="tab">Holds ([% holds_count || 0 | html %])</a>
832                         </li>
833
834                         [% IF Koha.Preference('UseRecalls') %]
835                             <li role="presentation">
836                                 <a href="#recalls" id="recalls-tab" aria-controls="recalls" role="tab" data-toggle="tab">Recalls ([% recalls.count || 0 | html %])</a>
837                             </li>
838                         [% END %]
839
840                         [% IF Koha.Preference('ArticleRequests') %]
841                             [% SET current_article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current' ) %]
842                             <li role="presentation">
843                                 <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>
844                             </li>
845                         [% END %]
846
847                         [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
848                             <li role="presentation">
849                                 [% IF ( patron.return_claims.count ) %]
850                                     <a href="#return-claims" id="return-claims-tab" aria-controls="return-claims" role="tab" data-toggle="tab">
851                                         Claims
852                                         ([% IF patron.return_claims.resolved.count == 0 %]
853                                             <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
854                                         [% ELSE %]
855                                             <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
856                                         [% END %]
857                                         [% IF patron.return_claims.unresolved.count == 0 %]
858                                             <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
859                                         [% ELSE %]
860                                             <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
861                                         [% END %])
862                                     </a>
863                                 [% ELSE %]
864                                     [% no_claims = 0 %]
865                                     <a href="#return-claims" id="return-claims-tab" aria-controls="return-claims" role="tab" data-toggle="tab">
866                                         Claims
867                                         (<span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% no_claims | html %]</span>
868                                         <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% no_claims | html %]</span>)
869                                     </a>
870                                 [% END %]
871                             </li>
872                         [% END %]
873
874                         <li role="presentation">
875                             <a id="debarments-tab-link" href="#reldebarments" aria-controls="reldebarments" role="tab" data-toggle="tab">Restrictions ([% patron.restrictions.count || 0 | html %])</a>
876                         </li>
877
878                         [% SET enrollments = patron.get_club_enrollments %]
879                         [% SET enrollable  = patron.get_enrollable_clubs(0) %] <!-- 0 => not OPAC -->
880                         [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
881                             <li role="presentation">
882                                 <a id="clubs-tab-link" href="#clubs-tab" aria-controls="clubs-tab" role="tab" data-toggle="tab">
883                                     Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
884                                 </a>
885                             </li>
886                         [% END %]
887                     </ul>
888
889                     <div class="tab-content">
890                         <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
891
892                         [% INCLUDE "checkouts-table.inc" %]
893
894                         [% INCLUDE "relatives-issues-table.inc" %]
895
896                         [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
897                             <div id="clubs-tab" role="tabpanel" class="tab-pane">
898                                 Loading...
899                             </div> <!-- /#clubs-tab -->
900                         [% END %]
901
902                         [% INCLUDE "patron-restrictions-tab.inc" %]
903
904                         <div id="reserves" role="tabpanel" class="tab-pane">
905                             [% IF ( holds_count ) %]
906                                 <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
907                                     <input type="hidden" name="from" value="circ" />
908                                     <table id="holds-table" style="width: 100% !Important;">
909                                         <thead>
910                                             <tr>
911                                                 <th>Hold date</th>
912                                                 <th>Title</th>
913                                                 <th>Call number</th>
914                                                 <th>Item type</th>
915                                                 <th>Barcode</th>
916                                                 <th>Pickup at</th>
917                                                 <th>Expiration</th>
918                                                 <th>Priority</th>
919                                                 <th>Cancel?</th>
920                                                 <th>Suspend?</th>
921                                                 <th>Status</th>
922                                             </tr>
923                                         </thead>
924                                     </table>
925
926                                     <fieldset class="action">
927                                         <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
928
929                                         [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
930                                         [% IF hold_cancellation.count %]
931                                             <select name="cancellation-reason">
932                                                 <option value="">No reason given</option>
933                                                 [% FOREACH reason IN hold_cancellation %]
934                                                     <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
935                                                 [% END %]
936                                             </select>
937                                         [% END %]
938                                     </fieldset>
939                                 </form>
940
941                                 [% IF Koha.Preference('SuspendHoldsIntranet') %]
942                                     <fieldset class="action">
943                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
944                                             <input type="hidden" name="from" value="circ" />
945                                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
946                                             <input type="submit" class="btn btn-primary" value="Suspend all holds" />
947
948                                             [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
949                                             <label for="suspend_until">until</label>
950                                             <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr" data-flatpickr-futuredate="true" />
951                                             <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
952                                             [% END %]
953                                         </form>
954                                     </fieldset>
955
956                                     <fieldset class="action">
957                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
958                                             <input type="hidden" name="from" value="circ" />
959                                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
960                                             <input type="hidden" name="suspend" value="0" />
961                                             <input type="submit" class="btn btn-primary" value="Resume all suspended holds" />
962                                         </form>
963                                     </fieldset>
964                                 [% END # /IF SuspendHoldsIntranet %]
965
966                             [% ELSE # IF holds_count %]
967                                 <p>Patron has nothing on hold.</p>
968                             [% END # /IF holds_count %]
969                         </div> <!-- /#reserves -->
970
971                         [% IF Koha.Preference('UseRecalls') %]
972                             <div id="recalls" role="tabpanel" class="tab-pane">
973                                 [% INCLUDE 'recalls.inc' %]
974                             </div>
975                         [% END %]
976
977                         [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
978                             [% INCLUDE 'patron-return-claims.inc' %]
979                         [% END %]
980
981                         [% IF Koha.Preference('ArticleRequests') %]
982                             [% INCLUDE 'patron-article-requests.inc' %]
983                         [% END %]
984                     </div> <!-- /.tab-content -->
985                 </div> <!-- /#patronlists -->
986                 [% ELSIF borrowernumber # IF patron %]
987                     <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
988                 [% END # /IF patron %]
989
990                 </div> <!-- /.col-sm-10.col-sm-push-2 -->
991
992                 [% IF Koha.Preference('CircSidebar') %]
993                     [% IF not( borrowernumber and patron ) %]
994                         <div class="col-sm-2 col-sm-pull-10">
995                             <aside>
996                                 [% INCLUDE 'circ-nav.inc' %]
997                             </aside>
998                         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
999                     [% END %]
1000                 [% END %]
1001
1002                 [% IF borrowernumber and patron %]
1003                         <div class="col-sm-2 col-sm-pull-10">
1004                             <aside>
1005                         [% INCLUDE 'circ-menu.inc' %]
1006                             </aside>
1007                         </div> <!-- /.col-sm-2 col-sm-pull-10 -->
1008                 [% END %]
1009
1010             </div> <!-- /.row -->
1011         </main>
1012
1013         [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
1014             [% INCLUDE 'modals/resolve_return_claim.inc' %]
1015         [% END %]
1016
1017 <!-- Modal -->
1018 <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
1019     <div class="modal-dialog">
1020         <div class="modal-content">
1021             <div class="modal-header">
1022                 <h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
1023             </div>
1024             <div class="modal-body">
1025                 <p>You have already submitted a barcode, please wait for the checkout to process...</p>
1026             </div>
1027         </div> <!-- /.modal-content -->
1028     </div> <!-- /.modal-dialog -->
1029 </div> <!-- /#barcodeSubmittedModal -->
1030
1031 [% MACRO jsinclude BLOCK %]
1032     [% INCLUDE 'datatables.inc' %]
1033     [% INCLUDE 'columns_settings.inc' %]
1034     [% INCLUDE 'select2.inc' %]
1035     [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
1036     [% PROCESS 'modal-claims.inc' %]
1037     [% PROCESS 'modal-claims-js' %]
1038
1039     <script>
1040         /* Set some variable needed in circulation.js */
1041         var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1042         var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1043         var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1044         var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
1045         var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
1046         var interface = "[% interface | html %]";
1047         var theme = "[% theme | html %]";
1048         var borrowernumber = "[% patron.borrowernumber | html %]";
1049         var branchcode = "[% branch | html %]";
1050         var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]";
1051         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %];
1052         var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %];
1053         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %];
1054         var script = "circulation";
1055         var relatives_borrowernumbers = new Array();
1056         [% FOREACH b IN relatives_borrowernumbers %]
1057             relatives_borrowernumbers.push("[% b | html %]");
1058         [% END %]
1059         var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
1060     </script>
1061     [% Asset.js("js/pages/circulation.js") | $raw %]
1062     [% Asset.js("js/checkouts.js") | $raw %]
1063     [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
1064         [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1065     [% END %]
1066     [% Asset.js("js/holds.js") | $raw %]
1067     [% INCLUDE 'calendar.inc' %]
1068     <script>
1069         table_settings_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1070         table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'relatives-issues-table', 'json' ) | $raw %]
1071         table_settings_borrowers_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
1072
1073         [% IF borrowernumber and patron %]
1074             if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){
1075                 Cookies.remove("holdfor", { path: '/', SameSite: 'Lax' });
1076             }
1077         [% ELSE %]
1078             Cookies.remove("holdfor", { path: '/', SameSite: 'Lax' });
1079         [% END %]
1080
1081         [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
1082
1083         // On-site checkout
1084         function toggle_onsite_checkout(){
1085             if ( $("#onsite_checkout").prop('checked') ) {
1086                 const duedatespec_fp = document.querySelector("#duedatespec")._flatpickr;
1087                 duedatespec_fp.setDate("[% today_due_date_and_time | $KohaDates dateformat => 'iso', with_hours => 1 %]");
1088             }
1089         }
1090
1091         function Dopop(link) {
1092             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1093         }
1094         $(document).ready(function() {
1095             $('#mainform').on('submit',function() {
1096                 if ($("#barcode") && $("#barcode").val()) {
1097                     $('#barcode').on('keypress',function(event) {
1098                         $('#barcodeSubmittedModal').modal();
1099                         event.preventDefault(); }
1100                     );
1101                 }
1102             });
1103
1104             if ( $('#clubs-tab').length ) {
1105                 $('#clubs-tab-link').on('click', function() {
1106                     $('#clubs-tab').text(_("Loading..."));
1107                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber | html %]');
1108                 });
1109             }
1110
1111             // listen submit to trigger qslip on empty checkout
1112             $('#mainform').bind('submit',function() {
1113                 if ($('#barcode').val() == '') {
1114                     [% IF ( CircAutoPrintQuickSlip == 'clear' ) %]
1115                         window.location='/cgi-bin/koha/circ/circulation.pl';
1116                         return false;
1117                     [% ELSE %]
1118                         return printx_window( '[% CircAutoPrintQuickSlip | html %]' );
1119                     [% END %]
1120                 }
1121             });
1122             toggle_onsite_checkout();
1123             $("#onsite_checkout").click(function(){
1124                 toggle_onsite_checkout();
1125             });
1126
1127             [% IF HIGHHOLDS %]
1128                 [% IF !override_high_holds %]
1129                     $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]');
1130                     if ('[% duedatespec | html %]' === '') {
1131                         $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
1132                     } else {
1133                         $("input[name=restoreduedatespec]:hidden").val('[% duedatespec | html %]');
1134                     }
1135                 [% END %]
1136
1137                 $("#override_high_holds_tmp").on( 'change', function() {
1138                     if ( this.checked ) {
1139                         $("input[name=duedatespec]:hidden").val('');
1140                     }
1141                 });
1142             [% END %]
1143         });
1144     </script>
1145     [% INCLUDE 'str/members-menu.inc' %]
1146     [% Asset.js("js/members-menu.js") | $raw %]
1147     [% Asset.js("js/recalls.js") | $raw %]
1148 [% END %]
1149
1150 [% INCLUDE 'intranet-bottom.inc' %]