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