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