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