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