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