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