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