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