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