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