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