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