Bug 28937: Use Flatpickr on circulation and patron pages
[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                                                             </div>
640                                                         [% END %]
641                                                     [% END %]
642
643                                                     [% UNLESS ( noissues ) %]
644                                                         <div id="set-automatic-renewal" class="circ-setting">
645                                                             [% IF NEEDSCONFIRMATION %]
646                                                                 [% IF auto_renew %]
647                                                                     [% IF patron.autorenew_checkouts %]
648                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
649                                                                         title="Patron has opted out of auto-renewal"/>
650                                                                     [% ELSE %]
651                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
652                                                                     [% END %]
653                                                                 [% ELSE %]
654                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
655                                                                 [% END %]
656                                                             [% ELSE %]
657                                                                 [% IF ( auto_renew && patron.autorenew_checkouts ) %]
658                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
659                                                                 [% ELSIF patron.autorenew_checkouts %]
660                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
661                                                                 [% ELSE %]
662                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
663                                                                     title="Patron has opted out of auto-renewal"/>
664                                                                 [% END %]
665                                                             [% END %]
666
667                                                             <label for="auto_renew">Automatic renewal</label>
668                                                         </div>
669                                                         [% IF Koha.Preference('decreaseLoanHighHolds') %]
670                                                             <div id="set_high_holds_overrride" class="circ-setting">
671                                                                 [% IF NEEDSCONFIRMATION %]
672                                                                     [% IF override_high_holds %]
673                                                                         <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
674                                                                     [% ELSE %]
675                                                                         <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
676                                                                     [% END %]
677                                                                 [% ELSE %]
678                                                                     [% IF override_high_holds %]
679                                                                         <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
680                                                                     [% ELSE %]
681                                                                         <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
682                                                                     [% END %]
683                                                                 [% END %]
684                                                                 <label for="override_high_holds">Don't decrease checkout length based on holds</label>
685                                                             </div>
686                                                         [% END %]
687                                                     [% END %]
688
689                                                     [% IF Koha.Preference('OnSiteCheckouts') %]
690                                                         <div id="onsite_checkout-select" class="circ-setting">
691                                                             [% IF noissues %]
692                                                                 <div class="onsite-checkout-only">
693                                                                     <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>
694                                                                     <input type="text" name="duedatespec" id="duedatespec" />
695                                                                     <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
696                                                                 </div>
697                                                             [% ELSE %]
698                                                                 [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
699                                                                 <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
700                                                                 [% ELSE %]
701                                                                 <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
702                                                                 [% END %]
703                                                             [% END %]
704                                                         </div>
705                                                     [% END %]
706
707                                                 </div> <!-- /.circ-settings -->
708
709                                                 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
710                                                 <input type="hidden" name="branch" value="[% branch | html %]" />
711                                                 <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
712                                                 [% IF ( CHARGES ) %]
713                                                         <input type="hidden" name="charges" value="yes" />
714                                                 [% END %]
715                                             </fieldset> <!-- /#circ_circulation_issue -->
716
717                                             [% IF ( issue ) %]
718                                                 <div class="lastchecked">
719                                                     <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>
720                                                 </div>
721                                             [% END %]
722                                         </form> <!-- /#mainform -->
723                                     </div> <!-- /.col-sm-6 -->
724
725                                 [% END #/IF !noissues %]
726
727                                 [% IF ( noissues ) %]
728                                     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
729                                         <div class="col-sm-6">
730                                     [% ELSE %]
731                                         <div>
732                                     [% END %]
733                                 [% ELSE %]
734                                     <div class="col-sm-6">
735                                 [% END %]
736
737                                 [% IF ( noissues ) %]
738                                     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
739                                         <div id="circmessages" class="circmessage attention">
740                                     [% ELSE %]
741                                         <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
742                                         <div id="circmessages" class="circmessage warning">
743                                     [% END %]
744                                     <h3>
745                                         Cannot check out!
746                                         [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
747                                             <span class="circ-hlt">Only on-site checkouts are allowed</span>
748                                         [% END %]
749                                     </h3>
750                                 [% ELSE %]
751                                     <div id="circmessages" class="circmessage attention">
752                                 [% END %]
753
754                                 [% INCLUDE 'patron_messages.inc' %]
755
756                             </div> <!-- /#circmessages -->
757                         </div> <!-- /div or div.col-sm-6 -->
758                     </div> <!-- /.row -->
759
760                     <div id="patronlists" class="toptabs">
761                         <ul>
762                             <li>
763                                 [% IF ( issuecount ) %]
764                                     <a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
765                                 [% ELSE %]
766                                     <a href="#checkouts">0 Checkouts</a>
767                                 [% END %]
768                             </li>
769
770                             [% IF relatives_issues_count %]
771                                 <li><a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] Relatives' checkouts</a></li>
772                             [% END %]
773
774                             <li>
775                                 [% IF ( holds_count ) %]
776                                     <a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a>
777                                 [% ELSE %]
778                                     <a href="#reserves" id="holds-tab">0 Holds</a>
779                                 [% END %]
780                             </li>
781
782                             [% IF Koha.Preference('ArticleRequests') %]
783                                 <li>
784                                     <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count | html %] Article requests</a>
785                                 </li>
786                             [% END %]
787
788                             [% IF Koha.Preference('ClaimReturnedLostValue') %]
789                                 <li>
790                                     [% IF ( patron.return_claims.count ) %]
791                                         <a href="#return-claims" id="return-claims-tab">
792                                             Claim(s)
793                                             [% IF patron.return_claims.resolved.count == 0 %]
794                                                 <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
795                                             [% ELSE %]
796                                                 <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
797                                             [% END %]
798                                             [% IF patron.return_claims.unresolved.count == 0 %]
799                                                 <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
800                                             [% ELSE %]
801                                                 <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
802                                             [% END %]
803                                         </a>
804                                     [% ELSE %]
805                                         <a href="#return-claims" id="return-claims-tab">
806                                             Claim(s)
807                                             <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
808                                             <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>
809                                         </a>
810                                     [% END %]
811                                 </li>
812                             [% END %]
813
814                             <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li>
815
816                             [% SET enrollments = patron.get_club_enrollments(1) %]
817                             [% SET enrollable  = patron.get_enrollable_clubs(0,1) %]
818                             [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
819                                 <li>
820                                     <a id="clubs-tab-link" href="#clubs-tab">
821                                         Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
822                                     </a>
823                                 </li>
824                             [% END %]
825                         </ul>
826
827                         <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
828
829                         [% INCLUDE "checkouts-table.inc" %]
830
831                         [% INCLUDE "relatives-issues-table.inc" %]
832
833                         [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
834                             <div id="clubs-tab">
835                                 Loading...
836                             </div> <!-- /#clubs-tab -->
837                         [% END %]
838
839                         [% INCLUDE borrower_debarments.inc %]
840
841                         <div id="reserves">
842                             [% IF ( holds_count ) %]
843                                 <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
844                                     <input type="hidden" name="from" value="circ" />
845                                     <table id="holds-table" style="width: 100% !Important;">
846                                         <thead>
847                                             <tr>
848                                                 <th>Hold date</th>
849                                                 <th>Title</th>
850                                                 <th>Call number</th>
851                                                 <th>Barcode</th>
852                                                 <th>Pickup at</th>
853                                                 <th>Expiration</th>
854                                                 <th>Priority</th>
855                                                 <th>Cancel?</th>
856                                                 <th>Suspend?</th>
857                                                 <th>Status</th>
858                                             </tr>
859                                         </thead>
860                                     </table>
861
862                                     <fieldset class="action">
863                                         <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
864
865                                         [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
866                                         [% IF hold_cancellation %]
867                                             <select name="cancellation-reason">
868                                                 <option value="">No reason given</option>
869                                                 [% FOREACH reason IN hold_cancellation %]
870                                                     <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
871                                                 [% END %]
872                                             </select>
873                                         [% END %]
874                                     </fieldset>
875                                 </form>
876
877                                 [% IF Koha.Preference('SuspendHoldsIntranet') %]
878                                     <fieldset class="action">
879                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
880                                             <input type="hidden" name="from" value="circ" />
881                                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
882                                             <input type="submit" value="Suspend all holds" />
883
884                                             [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
885                                             <label for="suspend_until">until</label>
886                                             <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr futuredate"/>
887                                             <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
888                                              [% END %]
889                                         </form>
890                                     </fieldset>
891
892                                     <fieldset class="action">
893                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
894                                             <input type="hidden" name="from" value="circ" />
895                                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
896                                             <input type="hidden" name="suspend" value="0" />
897                                             <input type="submit" value="Resume all suspended holds" />
898                                         </form>
899                                     </fieldset>
900                                 [% END # /IF SuspendHoldsIntranet %]
901
902                             [% ELSE # IF holds_count %]
903                                 <p>Patron has nothing on hold.</p>
904                             [% END # /IF holds_count %]
905                         </div> <!-- /#reserves -->
906
907                         [% IF Koha.Preference('ClaimReturnedLostValue') %]
908                             [% INCLUDE 'patron-return-claims.inc' %]
909                         [% END %]
910
911                         [% IF Koha.Preference('ArticleRequests') %]
912                             [% INCLUDE 'patron-article-requests.inc' %]
913                         [% END %]
914
915                     </div> <!-- /#patronlists -->
916                     [% ELSIF borrowernumber # IF patron %]
917                         <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
918                     [% END # /IF patron %]
919
920                 [% END #/IF borrowers %]
921
922                 </div> <!-- /.col-sm-10.col-sm-push-2 -->
923
924                 [% IF Koha.Preference('CircSidebar') %]
925                     [% UNLESS ( borrowers ) %]
926                         [% IF not( borrowernumber and patron ) %]
927                             <div class="col-sm-2 col-sm-pull-10">
928                                 <aside>
929                                     [% INCLUDE 'circ-nav.inc' %]
930                                 </aside>
931                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
932                         [% END %]
933                     [% END %]
934                 [% END %]
935
936                 [% UNLESS ( borrowers ) %]
937                     [% IF borrowernumber and patron %]
938                             <div class="col-sm-2 col-sm-pull-10">
939                                 <aside>
940                             [% INCLUDE 'circ-menu.inc' %]
941                                 </aside>
942                             </div> <!-- /.col-sm-2 col-sm-pull-10 -->
943                     [% END %]
944                 [% END %]
945
946             </div> <!-- /.row -->
947         </main>
948
949 <!-- Modal -->
950 <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
951     <div class="modal-dialog">
952         <div class="modal-content">
953             <div class="modal-header">
954                 <h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
955             </div>
956             <div class="modal-body">
957                 <p>You have already submitted a barcode, please wait for the checkout to process...</p>
958             </div>
959         </div> <!-- /.modal-content -->
960     </div> <!-- /.modal-dialog -->
961 </div> <!-- /#barcodeSubmittedModal -->
962
963 [% MACRO jsinclude BLOCK %]
964     [% INCLUDE 'calendar.inc' %]
965     [% INCLUDE 'datatables.inc' %]
966     [% INCLUDE 'columns_settings.inc' %]
967     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
968     [% INCLUDE 'timepicker.inc' %]
969     [% INCLUDE 'select2.inc' %]
970     [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
971     <script>
972         /* Set some variable needed in circulation.js */
973         var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
974         var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
975         var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
976         var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
977         var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
978         var interface = "[% interface | html %]";
979         var theme = "[% theme | html %]";
980         var borrowernumber = "[% patron.borrowernumber | html %]";
981         var branchcode = "[% branch | html %]";
982         var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]";
983         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %];
984         var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %];
985         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %];
986         var script = "circulation";
987         var relatives_borrowernumbers = new Array();
988         [% FOREACH b IN relatives_borrowernumbers %]
989             relatives_borrowernumbers.push("[% b | html %]");
990         [% END %]
991         var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
992     </script>
993     [% Asset.js("js/pages/circulation.js") | $raw %]
994     [% Asset.js("js/checkouts.js") | $raw %]
995     [% Asset.js("js/holds.js") | $raw %]
996     [% Asset.js("js/circ-patron-search-results.js") | $raw %]
997     <script>
998         columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
999         columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
1000
1001         [% IF borrowernumber and patron %]
1002             if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){
1003                 Cookies.remove("holdfor", { path: '/' });
1004             }
1005         [% ELSE %]
1006             Cookies.remove("holdfor", { path: '/' });
1007         [% END %]
1008
1009         [% UNLESS ( patron.borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
1010
1011         // On-site checkout
1012         function toggle_onsite_checkout(){
1013             if ( $("#onsite_checkout").prop('checked') ) {
1014                 $("#duedatespec").val("[% todaysdate | $KohaDates  with_hours => 1 %]")
1015             }
1016         }
1017
1018         function Dopop(link) {
1019             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1020         }
1021         $(document).ready(function() {
1022             $('#mainform').on('submit',function() {
1023                 if ($("#barcode") && $("#barcode").val()) {
1024                     $('#barcode').on('keypress',function(event) {
1025                         $('#barcodeSubmittedModal').modal();
1026                         event.preventDefault(); }
1027                     );
1028                 }
1029             });
1030
1031             if ( $('#clubs-tab').length ) {
1032                 $('#clubs-tab-link').on('click', function() {
1033                     $('#clubs-tab').text(_("Loading..."));
1034                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber | html %]');
1035                 });
1036             }
1037
1038             // listen submit to trigger qslip on empty checkout
1039             $('#mainform').bind('submit',function() {
1040                 if ($('#barcode').val() == '') {
1041                     [% IF ( CircAutoPrintQuickSlip == 'clear' ) %]
1042                         window.location='/cgi-bin/koha/circ/circulation.pl';
1043                         return false;
1044                     [% ELSE %]
1045                         return printx_window( '[% CircAutoPrintQuickSlip | html %]' );
1046                     [% END %]
1047                 }
1048             });
1049             toggle_onsite_checkout();
1050             $("#onsite_checkout").click(function(){
1051                 toggle_onsite_checkout();
1052             });
1053
1054             [% IF HIGHHOLDS %]
1055                 [% IF !override_high_holds %]
1056                     $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]');
1057                     if ('[% duedatespec | html %]' === '') {
1058                         $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
1059                     } else {
1060                         $("input[name=restoreduedatespec]:hidden").val('[% duedatespec | html %]');
1061                     }
1062                 [% END %]
1063
1064                 $("#override_high_holds_tmp").on( 'change', function() {
1065                     if ( this.checked ) {
1066                         $("input[name=duedatespec]:hidden").val('');
1067                     }
1068                 });
1069             [% END %]
1070         });
1071     </script>
1072     [% INCLUDE 'str/members-menu.inc' %]
1073     [% Asset.js("js/members-menu.js") | $raw %]
1074 [% END %]
1075
1076 [% INCLUDE 'intranet-bottom.inc' %]