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