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