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