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