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