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