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