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