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