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