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