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