Bug 28261: Add visual feedback on overridden pickup locations on patron's page
[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     [% IF patron %]
17         Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %] &rsaquo; [% END %]
18
19     Circulation &rsaquo; Koha
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                                                     <thead>
484                                                         <tr>
485                                                             <th>Title</th>
486                                                             <th>Barcode</th>
487                                                             <th>Call number</th>
488                                                             <th>Copy number</th>
489                                                             <th>Inventory number</th>
490                                                             <th>Serial enumeration</th>
491                                                             <th>Collection</th>
492                                                             [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
493                                                             <th>&nbsp;</th>
494                                                         </tr>
495                                                     </thead>
496                                                     <tbody>
497                                                     [% FOREACH item IN options %]
498                                                         <tr>
499                                                             <td>
500                                                                 <a target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber | html %]">[% item.biblio.title | html %] <i class="fa fa-window-restore"></i></a>
501                                                             </td>
502                                                             <td>
503                                                                 [% item.barcode | html %]
504                                                             </td>
505                                                             <td>[% item.itemcallnumber | html %]</th>
506                                                             <td>[% item.copynumber | html %]</th>
507                                                             <td>[% item.stocknumber| html %]</th>
508                                                             <td>[% item.enumchron| html %]</th>
509                                                             <td>
510                                                                 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]
511                                                             </td>
512                                                             [% IF ( item_level_itypes ) %]
513                                                                 <td>
514                                                                     [% ItemTypes.GetDescription( item.itype ) | html %]
515                                                                 </td>
516                                                             [% END %]
517                                                             <td>
518                                                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
519                                                                     [% IF (forceallow) %]
520                                                                         <input type="hidden" name="forceallow" value="1">
521                                                                     [% END %]
522                                                                     <input type="hidden" name="restoreduedatespec" />
523                                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
524                                                                     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
525                                                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
526                                                                     <input type="hidden" name="branch" value="[% branch | html %]" />
527                                                                     <input type="hidden" name="barcode" value="[% item.barcode | html %]" />
528                                                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
529                                                                     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
530                                                                     <button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
531                                                                 </form>
532                                                             </td>
533                                                         </tr>
534                                                     [% END %]
535                                                     </tbody>
536                                                 </table>
537                                             </div> <!-- /.modal-body -->
538                                             <div class="modal-footer">
539                                                 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
540                                             </div>
541                                         </div> <!-- /.modal-content -->
542                                     </div> <!-- /.modal-dialog.modal-wide -->
543                                 </div> <!-- /#itemSearchFallback -->
544                             [% END # /IF options %]
545                         [% END # /IF FALLBACK %]
546
547                     [% ELSE # IF IMPOSSIBLE %]
548                         [% IF (forceallow) %]
549                             <div id="overridden_debarment" class="dialog alert">Restriction overridden temporarily</div>
550                         [% END %]
551                     [% END # /IF IMPOSSIBLE %]
552
553                     <span class="audio-alert-success"></span>
554
555                     [% IF ( issued ) %]
556                         <p>Item checked out</p>
557                     [% END %]
558
559                     [% IF ( message ) %]
560                         [% INCLUDE 'patron-toolbar.inc' %]
561                         <h4>No patron matched <span class="ex">[% message | html %]</span></h4>
562                     [% END %]
563
564                     [% IF ( borrowers ) %]
565
566                         [% INCLUDE 'patron-toolbar.inc' %]
567                         <fieldset id="circ_circulation_selectborrower">
568                             <legend>Patron selection</legend>
569                             [% INCLUDE 'circ-patron-search-results.inc' destination = "circ" %]
570                         </fieldset>
571
572                     [% ELSE %]
573
574                         <!-- BARCODE ENTRY -->
575
576                         [% IF patron %]
577
578                             [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
579                                 <div class="dialog alert">
580                                     <strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
581                                 </div>
582                             [% END %]
583
584                             <div class="row">
585                                 [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
586                                     <div class="col-sm-6">
587                                         <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
588                                             <input type="hidden" name="restoreduedatespec" />
589                                             [% IF ( issue ) %]
590                                                 <fieldset id="circ_circulation_issue" class="lastchecked">
591                                             [% ELSE %]
592                                                 <fieldset id="circ_circulation_issue">
593                                             [% END %]
594
595                                             [% IF ( DisplayClearScreenButton ) %]
596                                                 <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
597                                                 <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
598                                             [% END %]
599
600                                             [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
601
602                                             <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
603
604                                             [% IF Koha.Preference('itemBarcodeFallbackSearch') %]
605                                                 <div class="hint">Enter item barcode or keyword:</div>
606                                             [% ELSE %]
607                                                 <div class="hint">Enter item barcode:</div>
608                                             [% END %]
609
610                                             [% IF NEEDSCONFIRMATION %]
611                                                 <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
612                                             [% ELSE %]
613                                                 <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" />
614                                             [% END %]
615
616                                             <button type="submit" class="btn btn-default">Check out</button>
617
618                                             <div id="show-circ-settings">
619                                                 <a href="#"><i class="fa fa-caret-right circ-settings-icon"></i> Checkout settings</a>
620                                             </div>
621
622                                             <div class="circ-settings">
623
624                                                     [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
625                                                         [% IF ( SpecifyDueDate ) %]
626                                                             <div id="specify-due-date" class="circ-setting">
627                                                                 <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
628                                                                 [% IF ( duedatespec ) %]
629                                                                     <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
630                                                                 [% ELSE %]
631                                                                     <input type="text" size="20" id="duedatespec" name="duedatespec" value="" />
632                                                                 [% END %]
633                                                                 <label for="stickyduedate"> Remember for session:</label>
634                                                                 [% IF ( stickyduedate ) %]
635                                                                     <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
636                                                                 [% ELSE %]
637                                                                     <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
638                                                                 [% END %]
639                                                                 <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>
640                                                             </div>
641                                                         [% END %]
642                                                     [% END %]
643
644                                                     [% UNLESS ( noissues ) %]
645                                                         <div id="set-automatic-renewal" class="circ-setting">
646                                                             [% IF NEEDSCONFIRMATION %]
647                                                                 [% IF auto_renew %]
648                                                                     [% IF patron.autorenew_checkouts %]
649                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
650                                                                         title="Patron has opted out of auto-renewal"/>
651                                                                     [% ELSE %]
652                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
653                                                                     [% END %]
654                                                                 [% ELSE %]
655                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
656                                                                 [% END %]
657                                                             [% ELSE %]
658                                                                 [% IF ( auto_renew && patron.autorenew_checkouts ) %]
659                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
660                                                                 [% ELSIF patron.autorenew_checkouts %]
661                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
662                                                                 [% ELSE %]
663                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
664                                                                     title="Patron has opted out of auto-renewal"/>
665                                                                 [% END %]
666                                                             [% END %]
667
668                                                             <label for="auto_renew">Automatic renewal</label>
669                                                         </div>
670                                                         [% IF Koha.Preference('decreaseLoanHighHolds') %]
671                                                             <div id="set_high_holds_overrride" class="circ-setting">
672                                                                 [% IF NEEDSCONFIRMATION %]
673                                                                     [% IF override_high_holds %]
674                                                                         <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
675                                                                     [% ELSE %]
676                                                                         <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
677                                                                     [% END %]
678                                                                 [% ELSE %]
679                                                                     [% IF override_high_holds %]
680                                                                         <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
681                                                                     [% ELSE %]
682                                                                         <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
683                                                                     [% END %]
684                                                                 [% END %]
685                                                                 <label for="override_high_holds">Don't decrease checkout length based on holds</label>
686                                                             </div>
687                                                         [% END %]
688                                                     [% END %]
689
690                                                     [% IF Koha.Preference('OnSiteCheckouts') %]
691                                                         <div id="onsite_checkout-select" class="circ-setting">
692                                                             [% IF noissues %]
693                                                                 <div class="onsite-checkout-only">
694                                                                     <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>
695                                                                     <input type="text" name="duedatespec" id="duedatespec" />
696                                                                     <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
697                                                                 </div>
698                                                             [% ELSE %]
699                                                                 [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
700                                                                 <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
701                                                                 [% ELSE %]
702                                                                 <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
703                                                                 [% END %]
704                                                             [% END %]
705                                                         </div>
706                                                     [% END %]
707
708                                                 </div> <!-- /.circ-settings -->
709
710                                                 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
711                                                 <input type="hidden" name="branch" value="[% branch | html %]" />
712                                                 <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
713                                                 [% IF ( CHARGES ) %]
714                                                         <input type="hidden" name="charges" value="yes" />
715                                                 [% END %]
716                                             </fieldset> <!-- /#circ_circulation_issue -->
717
718                                             [% IF ( issue ) %]
719                                                 <div class="lastchecked">
720                                                     <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>
721                                                 </div>
722                                             [% END %]
723                                         </form> <!-- /#mainform -->
724                                     </div> <!-- /.col-sm-6 -->
725
726                                 [% END #/IF !noissues %]
727
728                                 [% IF ( noissues ) %]
729                                     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
730                                         <div class="col-sm-6">
731                                     [% ELSE %]
732                                         <div>
733                                     [% END %]
734                                 [% ELSE %]
735                                     <div class="col-sm-6">
736                                 [% END %]
737
738                                 [% IF ( noissues ) %]
739                                     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
740                                         <div id="circmessages" class="circmessage attention">
741                                     [% ELSE %]
742                                         <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
743                                         <div id="circmessages" class="circmessage warning">
744                                     [% END %]
745                                     <h3>
746                                         Cannot check out!
747                                         [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
748                                             <span class="circ-hlt">Only on-site checkouts are allowed</span>
749                                         [% END %]
750                                     </h3>
751                                 [% ELSE %]
752                                     <div id="circmessages" class="circmessage attention">
753                                 [% END %]
754
755                                 [% INCLUDE 'patron_messages.inc' %]
756
757                             </div> <!-- /#circmessages -->
758                         </div> <!-- /div or div.col-sm-6 -->
759                     </div> <!-- /.row -->
760
761                     <div id="patronlists" class="toptabs">
762                         <ul>
763                             <li>
764                                 [% IF ( issuecount ) %]
765                                     <a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
766                                 [% ELSE %]
767                                     <a href="#checkouts">0 Checkouts</a>
768                                 [% END %]
769                             </li>
770
771                             [% IF relatives_issues_count %]
772                                 <li><a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] Relatives' checkouts</a></li>
773                             [% END %]
774
775                             <li>
776                                 [% IF ( holds_count ) %]
777                                     <a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a>
778                                 [% ELSE %]
779                                     <a href="#reserves" id="holds-tab">0 Holds</a>
780                                 [% END %]
781                             </li>
782
783                             [% IF Koha.Preference('ArticleRequests') %]
784                                 <li>
785                                     <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] Article requests</a>
786                                 </li>
787                             [% END %]
788
789                             [% IF Koha.Preference('ClaimReturnedLostValue') %]
790                                 <li>
791                                     [% IF ( patron.return_claims.count ) %]
792                                         <a href="#return-claims" id="return-claims-tab">
793                                             Claim(s)
794                                             [% IF patron.return_claims.resolved.count == 0 %]
795                                                 <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
796                                             [% ELSE %]
797                                                 <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
798                                             [% END %]
799                                             [% IF patron.return_claims.unresolved.count == 0 %]
800                                                 <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
801                                             [% ELSE %]
802                                                 <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
803                                             [% END %]
804                                         </a>
805                                     [% ELSE %]
806                                         <a href="#return-claims" id="return-claims-tab">
807                                             Claim(s)
808                                             <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
809                                             <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>
810                                         </a>
811                                     [% END %]
812                                 </li>
813                             [% END %]
814
815                             <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li>
816
817                             [% SET enrollments = patron.get_club_enrollments(1) %]
818                             [% SET enrollable  = patron.get_enrollable_clubs(0,1) %]
819                             [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
820                                 <li>
821                                     <a id="clubs-tab-link" href="#clubs-tab">
822                                         Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
823                                     </a>
824                                 </li>
825                             [% END %]
826                         </ul>
827
828                         <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
829
830                         [% INCLUDE "checkouts-table.inc" %]
831
832                         [% INCLUDE "relatives-issues-table.inc" %]
833
834                         [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
835                             <div id="clubs-tab">
836                                 Loading...
837                             </div> <!-- /#clubs-tab -->
838                         [% END %]
839
840                         [% INCLUDE borrower_debarments.inc %]
841
842                         <div id="reserves">
843                             [% IF ( holds_count ) %]
844                                 <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
845                                     <input type="hidden" name="from" value="circ" />
846                                     <table id="holds-table" style="width: 100% !Important;">
847                                         <thead>
848                                             <tr>
849                                                 <th>Hold date</th>
850                                                 <th>Title</th>
851                                                 <th>Call number</th>
852                                                 <th>Barcode</th>
853                                                 <th>Pickup at</th>
854                                                 <th>Expiration</th>
855                                                 <th>Priority</th>
856                                                 <th>Cancel?</th>
857                                                 <th>Suspend?</th>
858                                                 <th>Status</th>
859                                             </tr>
860                                         </thead>
861                                     </table>
862
863                                     <fieldset class="action">
864                                         <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
865
866                                         [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
867                                         [% IF hold_cancellation %]
868                                             <select name="cancellation-reason">
869                                                 <option value="">No reason given</option>
870                                                 [% FOREACH reason IN hold_cancellation %]
871                                                     <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
872                                                 [% END %]
873                                             </select>
874                                         [% END %]
875                                     </fieldset>
876                                 </form>
877
878                                 [% IF Koha.Preference('SuspendHoldsIntranet') %]
879                                     <fieldset class="action">
880                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
881                                             <input type="hidden" name="from" value="circ" />
882                                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
883                                             <input type="submit" value="Suspend all holds" />
884
885                                             [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
886                                             <label for="suspend_until">until</label>
887                                             <input type="text" size="10" id="suspend_until" name="suspend_until" class="datepicker futuredate"/>
888                                             <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
889                                              [% END %]
890                                         </form>
891                                     </fieldset>
892
893                                     <fieldset class="action">
894                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
895                                             <input type="hidden" name="from" value="circ" />
896                                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
897                                             <input type="hidden" name="suspend" value="0" />
898                                             <input type="submit" value="Resume all suspended holds" />
899                                         </form>
900                                     </fieldset>
901                                 [% END # /IF SuspendHoldsIntranet %]
902
903                             [% ELSE # IF holds_count %]
904                                 <p>Patron has nothing on hold.</p>
905                             [% END # /IF holds_count %]
906                         </div> <!-- /#reserves -->
907
908                         [% IF Koha.Preference('ClaimReturnedLostValue') %]
909                             [% INCLUDE 'patron-return-claims.inc' %]
910                         [% END %]
911
912                         [% IF Koha.Preference('ArticleRequests') %]
913                             [% INCLUDE 'patron-article-requests.inc' %]
914                         [% END %]
915
916                     </div> <!-- /#patronlists -->
917                     [% ELSIF borrowernumber # IF patron %]
918                         <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
919                     [% END # /IF patron %]
920
921                 [% END #/IF borrowers %]
922
923                 </div> <!-- /.col-sm-10.col-sm-push-2 -->
924
925                 [% IF Koha.Preference('CircSidebar') %]
926                     [% UNLESS ( borrowers ) %]
927                         [% IF not( borrowernumber and patron ) %]
928                             <div class="col-sm-2 col-sm-pull-10">
929                                 <aside>
930                                     [% INCLUDE 'circ-nav.inc' %]
931                                 </aside>
932                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
933                         [% END %]
934                     [% END %]
935                 [% END %]
936
937                 [% UNLESS ( borrowers ) %]
938                     [% IF borrowernumber and patron %]
939                             <div class="col-sm-2 col-sm-pull-10">
940                                 <aside>
941                             [% INCLUDE 'circ-menu.inc' %]
942                                 </aside>
943                             </div> <!-- /.col-sm-2 col-sm-pull-10 -->
944                     [% END %]
945                 [% END %]
946
947             </div> <!-- /.row -->
948         </main>
949
950 <!-- Modal -->
951 <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
952     <div class="modal-dialog">
953         <div class="modal-content">
954             <div class="modal-header">
955                 <h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
956             </div>
957             <div class="modal-body">
958                 <p>You have already submitted a barcode, please wait for the checkout to process...</p>
959             </div>
960         </div> <!-- /.modal-content -->
961     </div> <!-- /.modal-dialog -->
962 </div> <!-- /#barcodeSubmittedModal -->
963
964 [% MACRO jsinclude BLOCK %]
965     [% INCLUDE 'calendar.inc' %]
966     [% INCLUDE 'datatables.inc' %]
967     [% INCLUDE 'columns_settings.inc' %]
968     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
969     [% INCLUDE 'timepicker.inc' %]
970     [% INCLUDE 'select2.inc' %]
971     [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
972     <script>
973         /* Set some variable needed in circulation.js */
974         var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
975         var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
976         var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
977         var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
978         var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
979         var interface = "[% interface | html %]";
980         var theme = "[% theme | html %]";
981         var borrowernumber = "[% patron.borrowernumber | html %]";
982         var branchcode = "[% branch | html %]";
983         var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]";
984         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %];
985         var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %];
986         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %];
987         var script = "circulation";
988         var relatives_borrowernumbers = new Array();
989         [% FOREACH b IN relatives_borrowernumbers %]
990             relatives_borrowernumbers.push("[% b | html %]");
991         [% END %]
992         var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
993     </script>
994     [% Asset.js("js/pages/circulation.js") | $raw %]
995     [% Asset.js("js/checkouts.js") | $raw %]
996     [% Asset.js("js/holds.js") | $raw %]
997     [% Asset.js("js/circ-patron-search-results.js") | $raw %]
998     <script>
999         columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1000         columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
1001
1002         [% IF borrowernumber and patron %]
1003             if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){
1004                 Cookies.remove("holdfor", { path: '/' });
1005             }
1006         [% ELSE %]
1007             Cookies.remove("holdfor", { path: '/' });
1008         [% END %]
1009
1010         [% UNLESS ( patron.borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
1011
1012         // On-site checkout
1013         function toggle_onsite_checkout(){
1014             if ( $("#onsite_checkout").prop('checked') ) {
1015                 $("#duedatespec").val("[% todaysdate | $KohaDates  with_hours => 1 %]")
1016                 [% IF !Koha.Preference('SpecifyDueDate') %]
1017                     $("#duedatespec").datetimepicker('destroy');
1018                 [% END %]
1019             } else {
1020                 $("#duedatespec").datetimepicker({
1021                     onClose: function(dateText, inst) {
1022                         if (validate_date(dateText, inst) ) {
1023                             $("#barcode").focus();
1024                         }
1025                     },
1026                     hour: 23,
1027                     minute: 59
1028                 }).on("change", function(e, value) {
1029                     if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
1030                 });
1031             }
1032         }
1033
1034         function Dopop(link) {
1035             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1036         }
1037         $(document).ready(function() {
1038             $('#mainform').on('submit',function() {
1039                 if ($("#barcode") && $("#barcode").val()) {
1040                     $('#barcode').on('keypress',function(event) {
1041                         $('#barcodeSubmittedModal').modal();
1042                         event.preventDefault(); }
1043                     );
1044                 }
1045             });
1046
1047             if ( $('#clubs-tab').length ) {
1048                 $('#clubs-tab-link').on('click', function() {
1049                     $('#clubs-tab').text(_("Loading..."));
1050                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber | html %]');
1051                 });
1052             }
1053
1054             [% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
1055                 // listen submit to trigger qslip on empty checkout
1056                 $('#mainform').bind('submit',function() {
1057                     if ($('#barcode').val() == '') {
1058                         return printx_window( '[% CircAutoPrintQuickSlip | html %]' );
1059                     }
1060                 });
1061             [% END %]
1062             toggle_onsite_checkout();
1063             $("#onsite_checkout").click(function(){
1064                 toggle_onsite_checkout();
1065             });
1066
1067             [% IF HIGHHOLDS %]
1068                 [% IF !override_high_holds %]
1069                     $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]');
1070                     if ('[% duedatespec | html %]' === '') {
1071                         $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
1072                     } else {
1073                         $("input[name=restoreduedatespec]:hidden").val('[% duedatespec | html %]');
1074                     }
1075                 [% END %]
1076
1077                 $("#override_high_holds_tmp").on( 'change', function() {
1078                     if ( this.checked ) {
1079                         $("input[name=duedatespec]:hidden").val('');
1080                     }
1081                 });
1082             [% END %]
1083         });
1084     </script>
1085     [% INCLUDE 'str/members-menu.inc' %]
1086     [% Asset.js("js/members-menu.js") | $raw %]
1087 [% END %]
1088
1089 [% INCLUDE 'intranet-bottom.inc' %]