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