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