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