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