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