Bug 18335 - Check in: Make patron info in hold messages obey syspref AddressFormat
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / returns.tt
blobba284bc40df54144b31e44e4d85c6e0d2e9b78d5
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% USE Koha %]
4 [% USE Borrowers %]
5 [% USE ItemTypes %]
6 [% USE AuthorisedValues %]
7 [% USE ColumnsSettings %]
9 [% BLOCK display_bormessagepref %]
10     [% IF ( bormessagepref ) %]
11         <li>Patron notification:
12             [% FOREACH mtt IN bormessagepref.keys %]
13                 [%~ IF ( mtt == 'email' ) %] Email[% END ~%]
14                 [%~ IF ( mtt == 'phone' ) %] Phone[% END ~%]
15                 [%~ IF ( mtt == 'sms' ) %] SMS[% END ~%]
16                 [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
17             [% END %]
18         </li>
19            [% ELSE %]
20         <li>Patron is not notified.</li>
21     [% END %]
22 [% END %]
24 [% BLOCK display_holdpatron_address %]
25     [% IF Koha.Preference( 'AddressFormat' ) %]
26         [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
27     [% ELSE %]
28         [% INCLUDE 'member-display-address-style-us.inc' %]
29     [% END %]
30 [% END %]
32 [% INCLUDE 'doc-head-open.inc' %]
33 <title>Koha &rsaquo; Circulation &rsaquo; Check in [% title |html %]</title>
34 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
35 [% INCLUDE 'doc-head-close.inc' %]
36 [% INCLUDE 'datatables.inc' %]
37 [% INCLUDE 'columns_settings.inc' %]
38 [% INCLUDE 'calendar.inc' %]
39 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
40 [% INCLUDE 'timepicker.inc' %]
42 <script type="text/javascript">
43 //<![CDATA[
44 function Dopop(link) {
45     var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
46     $("#barcode").focus();
48 $(document).ready(function () {
49     $(".modal").modal({ backdrop: 'static' }).on('shown', function() {
50         $("#barcode").prop("disabled", true);
51     }).on('hidden', function() {
52         $("#barcode").prop("disabled", false).focus();
53     });
55     [% IF print_slip %]
56         Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]');
57     [% END %]
59     var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
60     var returns_table = KohaTable("#checkedintable", {
61             "bFilter":false,
62             "bPaginate":false,
63             "bInfo":false,
64             "bSort":false,
65             "dom": 'B<"clearfix">t',
66             }, columns_settings);
68     $("#return_date_override").datetimepicker({
69         onClose: function(dateText, inst) {
70             if (validate_date(dateText, inst) ) {
71                 $("#barcode").focus();
72             }
73         },
74         defaultDate: -1,
75         hour: 23,
76         minute: 59,
77         maxDate: 0
78     }).on("change", function(e, value) {
79         if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
80     });
81     $("#return_date_override").on("blur", function() {
82             check_valid_return_date();
83     });
84     $("#checkin-form").submit(function( event ) {
85         if ( !check_valid_return_date() ) {
86             event.preventDefault();
87         }
88     });
90     function check_valid_return_date() {
91         if ( $("#return_date_override").val() ) {
92             var datetime = DateTime_from_syspref( $("#return_date_override").val() );
93             var now = new Date();
94             if ( !datetime || datetime > now ) {
95                 alert("Invalid return date/time!");
96                 $("#return_date_override").val("")
97                 return false;
98             }
99         }
100         return true;
101     }
103     $("#exemptcheck").change(function () {
104         if (this.checked == true) {
105             $("#barcode").addClass("alert");
106             $("#exemptfines").show();
107         } else {
108             $("#barcode").removeClass("alert");
109             $("#exemptfines").hide();
110         }
111         $("#barcode").focus();
112     });
113     $("#dropboxcheck").change(function () {
114         if (this.checked == true) {
115             $("#barcode").addClass("alert");
116             $("#dropboxmode").show();
118             $("#return_date_override_fields :input").prop('disabled', true);
119             $("#return_date_override").datetimepicker("disable");
120         } else {
121             $("#barcode").removeClass("alert");
122             $("#dropboxmode").hide();
124             $("#return_date_override_fields :input").prop('disabled', false);
125             $("#return_date_override").datetimepicker("enable");
126         }
127         $("#barcode").focus();
128     });
129     $("#forgivemanualholdsexpire").change(function () {
130         if (this.checked == true) {
131             $("#barcode").addClass("alert");
132             $("#forgivemanualholdsexpire-alert").show();
133         } else {
134             $("#barcode").removeClass("alert");
135             $("#forgivemanualholdsexpire-alert").hide();
136         }
137         $("#barcode").focus();
138     });
139     [% IF(overduecharges) %] $("#barcode").focus(function () {
140         if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
141             $("#barcode").addClass("alert");
142         } else {
143             $("#barcode").removeClass("alert");
144         }
145     });
146     $("#barcode").blur(function () {
147         $("#barcode").removeClass("alert");
148     });
149     [% END %]
150     $('.openWin').on("click",function(e){
151         Dopop( $(this).data("url") );
152     });
154 //]]>
155 </script>
156 </head>
157 <body id="circ_returns" class="circ">
158 <span class="audio-alert-success"></span>
160 [% INCLUDE 'header.inc' %]
161 [% INCLUDE 'checkin-search.inc' %]
163 <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; Check in</div>
165 [% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc" class="yui-t7">[% END %]
167 <div id="bd">
168 <div id="yui-main">
169 [% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
170 <div class="yui-g">
172 [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
173     <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>
174 [% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
175     <div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
176 [% END %]
178 [% IF additional_materials %]
179     <div class="dialog message" id="materials">Note about the accompanying materials: <br />
180     [% additional_materials %]
181     </div>
182 [% END %]
184 [% IF ( collectionItemNeedsTransferred ) %]
185  <div id="rotating-collection" class="dialog message">
186         <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) %]</h3>
187             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
188             <p>This item is part of a rotating collection.</p>
189             <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% collectionBranch %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
190 </div>
191 [% END %]
193 <!-- Patron has fines -->
194 [% IF ( fines ) %]
195     <div class="dialog alert">
196         <h3>Patron has outstanding fines of [% fines %].</h3>
197         <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber %]">Make payment</a>.</p>
198     </div>
199 [% END %]
201 <!-- Patron has waiting holds -->
202 [% IF ( waiting_holds ) %]
203     <div id="awaiting-pickup" class="dialog message">
204         <h3>[% holdsfirstname %] [% holdssurname %] has [% waiting_holds %] hold(s) waiting for pickup.</h3>
205         <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber %]">Check out to this patron</a>.</p>
206     </div>
207 [% END %]
209 <!-- Patron is restricted and checkin was backdated -->
210 [% IF return_date_was_overriden && Borrowers.IsDebarred( borrower ) %]
211     <div id="restricted_backdated" class="dialog message">
212         <h3>
213             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">
214                 [% borrower.firstname %] [% borrower.surname %]
215             </a>
216             is restricted. Please verify this patron should still be restricted.
217         </h3>
218     </div>
219 [% END %]
221 [% IF ( wrongbranch ) %]
222     <div class="dialog alert"><h3>Cannot check in</h3>
223         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
224         </p><strong>NOT CHECKED IN</strong></p>
225         <p>This item must be checked in at following library: <strong>[% Branches.GetName( rightbranch ) %]</strong></p>
226     </div>
227 [% END %]
228 <!-- case of a mistake in transfer loop -->
229 [% IF ( WrongTransfer ) %]
230     <div id="return2" class="dialog message">
231         <!-- WrongTransfer -->
232         <h3>Please return item to: [% Branches.GetName( TransferWaitingAt ) %]</h3>
233             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
234         <button type="submit" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% TransferWaitingAt %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
235         <button class="deny" type="submit" onclick="window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&amp;canceltransfer=1'"><i class="fa fa-times"></i> Cancel transfer</button>
236 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
237         <ul>
238             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
239             [% borsurname %], [% borfirstname %]</a> ([% borcnum %]) <span class="patron-category"> - [% wborcategory %]</span> </li>
240             [% INCLUDE display_holdpatron_address %]
241             [% IF ( wborphone ) %]<li>[% wborphone %]</li>[% END %]
242             [% IF ( wboremail ) %]<li><a id="boremail" href="mailto:[% wboremail %]">[% wboremail %]</a></li>[% END %]
243         </ul>
245     <form method="post" action="returns.pl" class="confirm">
246             <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem %]" />
247             <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt %]" />
248             <input type="hidden" name="WT-From" value="[% wtransfertFrom %]" />
249             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
250             <input type="hidden" name="print_slip" value="0" />
251             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
252             <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
253             <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and confirm</button>
254         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
255         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
256     </form>
257     [% END %]</div>
258 [% END %]
260 [% IF ( found ) %]
261     [% IF ( waiting ) %]
262         <div id="hold-found1" class="modal fade audio-alert-action">
263             <div class="modal-dialog">
264             <div class="modal-content">
265             <form method="post" action="returns.pl" class="confirm">
266                 <div class="modal-header">
267                     <h3>
268                         Hold found (item is already waiting):
269                         <br/>
270                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
271                             [% itembarcode |html %]: [% title |html %]
272                         </a>
273                     </h3>
274                 </div>
276                 <div class="modal-body">
277                     [% IF ( reservenotes ) %]
278                         <h4>Notes: [% reservenotes %]</h4>
279                     [% END %]
281                     <h4>Hold for:</h4>
282                     <ul>
283                     <li>
284                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])
285                         <span class="patron-category"> - [% borcategory %]</span>
286                     </li>
287                     [% INCLUDE display_holdpatron_address %]
288                     [% IF ( borphone ) %]
289                         <li> [% borphone %]</li>
290                     [% END %]
292                     [% IF ( boremail ) %]
293                         <li><a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a></li>
294                     [% END %]
296                     [% IF ( debarred ) %]
297                         <li class="error">Patron is RESTRICTED</li>
298                     [% END %]
300                     [% IF ( gonenoaddress ) %]
301                         <li class="error">Patron's address is in doubt</li>
302                     [% END %]
303                     </ul>
305                     [% IF ( transfertodo ) %]
306                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
307                     [% ELSE %]
308                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
309                     [% END %]
311                     [% FOREACH inputloo IN inputloop %]
312                         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
313                         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
314                         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
315                     [% END %]
317                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
318                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
319                     <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
320                     <input type="hidden" name="reserve_id" value="[% reserve_id %]" />
321                     <input type="hidden" name="diffBranch" value="[% destbranch %]" />
322                     <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
323                     <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
324                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
326                     <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
327                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
328                 </div>
330                 <div class="modal-footer">
331                     <input type="hidden" name="cancel_reserve" value="0" />
333                     <button type="submit" class="btn btn-default approve">
334                         <i class="fa fa-check"></i> Confirm
335                     </button>
337                     <input type="hidden" name="print_slip" value="0" />
338                     <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit();">
339                         <i class="fa fa-print"></i> Print and confirm
340                     </button>
342                     <button type="submit" class="btn btn-default deny" onclick="this.form.cancel_reserve.value = 1; this.form.submit();">
343                         <i class="fa fa-times"></i> Cancel hold
344                     </button>
345                 </div>
346             </form>
347            </div>
348            </div>
349         </div>
350     [% END %]
352     [% IF ( diffbranch ) %]
353                 <!-- diffbranch -->
354         <div id="transfer-needed" class="dialog message audio-alert-action">
355             <h3>Hold needing transfer found</h3>
356                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
357                 <h4>Hold for: </h4>
358                     <ul>
359                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %]) <span class="patron-category"> - [% wborcategory %]</span> </li>
360                         [% INCLUDE display_holdpatron_address %]
361                         [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
362                         [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
363 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
364 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
365                     </ul>
366         [% IF ( transfertodo ) %]
367             <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
368         [% ELSE %]
369             <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
370         [% END %]
372         <form method="post" action="returns.pl" class="confirm">
373             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
374             <input type="hidden" name="print_slip" value="0" />
375             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
376             <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
377             <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and continue</button>
378             [% FOREACH inputloo IN inputloop %]
379                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
380                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
381                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
382             [% END %]
383             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
384             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
385             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
386             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
387             <input type="hidden" name="barcode" value="0" />
389             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
390             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
391         </form>
392                 </div>
393     [% END %]
395     [% IF ( transfer ) %]
396     <!-- transfer: item with no reservation, must be returned according to home library circulation rules -->
397         <div id="return1" class="dialog message audio-alert-action">
398             <h3>Please return item to: [% Branches.GetName( returnbranch ) %]</h3>
399             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
400             <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% returnbranch %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
401         </div>
402     [% END %]
404     [% IF ( needstransfer ) %]
405         <!-- needstransfer -->
406     <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) %]</h3>
407     Transfer now?<br />
408     <form method="post" action="returns.pl" name="mainform" id="mainform">
409     [% IF itemnumber %]
410         <button type="submit" name="dotransfer" value="Yes" class="print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% returnbranch %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button>
411     [% END %]
412     <button type="submit" name="dotransfer" value="Yes" class="submit"><i class="fa fa-check"></i> Yes</button>
413     <button type="submit" name="notransfer" value="No" class="submit"><i class="fa fa-times"></i> No</button>
414     <input type="hidden" name="tobranch" value="[% returnbranch %]" />
415         <input type="hidden" name="transferitem" value="[% itemnumber %]" />
416         <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
417         <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
418         <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
419         [% FOREACH inputloo IN inputloop %]
420         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
421         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
422         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
423         [% END %]
424         <input type="hidden" name="barcode" value="0" />
425         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
426         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
427         </form>   </div>
428     [% END %]
430     [% IF ( diffbranch ) %]
431         <!-- diffbranch -->
432         <h3 class="audio-alert-action">Item consigned:</h3>
433         <table>
434         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a></caption>
435         <tr>
436             <th>Hold for:</th>
437             <td>[% name %]</td>
438         </tr>
439         </table>
440         <form method="post" action="returns.pl"><input type="submit" value="OK" />
441             [% FOREACH inputloo IN inputloop %]
442                 [% UNLESS ( inputloo.first ) %]
443                     <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
444                     <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
445                     <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
446                 [% END %]
447             [% END %]
449             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
450             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
452             <input type="hidden" name="barcode" value="0" />
453         </form>
454     [% END %]
457     <!-- case of simple return no issue or transfer but with a reservation  -->
458     [% IF ( reserved ) %]
459         <!--  reserved  -->
460         <div id="hold-found2" class="modal fade audio-alert-action">
461             <div class="modal-dialog">
462             <div class="modal-content">
463             <form method="post" action="returns.pl" class="confirm">
464                 <div class="modal-header">
465                     <h3>
466                         Hold found:
467                         <br/>
468                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
469                             [% itembarcode |html %]: [% title |html %]
470                         </a>
471                 </div>
473                 <div class="modal-body">
474                     [% IF ( reservenotes ) %]
475                         <h4>Notes: [% reservenotes %]</h4>
476                     [% END %]
477                     <h5>Hold for:</h5>
478                         <li>
479                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
480                                 [% borsurname %], [% borfirstname %]
481                             </a>
482                             ([% borcnum %])
483                             <span class="patron-category"> - [% borcategory %]</span>
484                         </li>
486                         [% INCLUDE display_holdpatron_address %]
488                         [% IF ( borphone ) %]
489                             <li>[% borphone %]</li>
490                         [% END %]
492                         [% IF ( boremail ) %]
493                             <li>
494                                 [% IF ( transfertodo ) %]
495                                     [% boremail %]
496                                 [% ELSE %]
497                                     <a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>
498                                 [% END %]
499                             </li>
500                         [% END %]
502                         [% UNLESS ( transfertodo) %]
503                             [% INCLUDE display_bormessagepref %]
504                         [% END %]
506                         [% IF ( debarred ) %]
507                             <li class="error">Patron is RESTRICTED</li>
508                         [% END %]
510                         [% IF ( gonenoaddress ) %]
511                             <li class="error">Patron's address is in doubt</li>
512                         [% END %]
514                     [% IF ( transfertodo ) %]
515                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
516                     [% ELSE %]
517                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
518                     [% END %]
520                     <input type="hidden" name="print_slip" value="0" />
523                     [% FOREACH inputloo IN inputloop %]
524                         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
525                         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
526                         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
527                     [% END %]
529                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
530                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
531                     <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
532                     <input type="hidden" name="reserve_id" value="[% reserve_id %]" />
533                     <input type="hidden" name="diffBranch" value="[% destbranch %]" />
534                     <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
535                     <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
536                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
537                     <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
538                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
539                 </div>
541                 <div class="modal-footer">
542                     [% IF ( transfertodo ) %]
543                         <button type="submit" class="btn btn-default approve">
544                             <i class="fa fa-check"></i> Confirm hold and transfer
545                         </button>
546                         <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit()">
547                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
548                         </button>
549                     [% ELSE %]
550                         <button type="submit" class="btn btn-default approve">
551                             <i class="fa fa-check"></i> Confirm hold
552                         </button>
553                         <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit();">
554                             <i class="fa fa-print"></i> Print slip and confirm
555                         </button>
556                     [% END %]
558                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
559                         <i class="fa fa-times"></i> Ignore
560                     </button>
561                 </div>
562             </form>
563             </div>
564             </div>
565         </div>
566     [% END %]
567 [% END %]
569 [% IF ( errmsgloop ) %]
570     <div class="dialog alert audio-alert-warning">
571         <h3>Check in message</h3>
572         [% IF itembiblionumber %]
573             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
574         [% END %]
575         [% FOREACH errmsgloo IN errmsgloop %]
576             [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
577                 <p class="problem">
578                     Not for loan status updated.
579                     <br />Old value:
580                     [% IF errmsgloo.NotForLoanStatusUpdated.from %]
581                         [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
582                     [% ELSE %]
583                         Available for loan.
584                     [% END %]
585                     <br />New value:
586                     [% IF errmsgloo.NotForLoanStatusUpdated.to %]
587                         [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
588                     [% ELSE %]
589                         Available for loan.
590                     [% END %]
591                 </p>
592             [% END %]
593             [% IF ( errmsgloo.badbarcode ) %]
594                 <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
595             [% END %]
596             [% IF ( errmsgloo.ispermanent ) %]
597                 <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) %]</p>
598             [% END %]
599             [% IF ( errmsgloo.notissued ) %]
600                 <p class="problem">Not checked out.</p>
601             [% END %]
602             [% IF ( errmsgloo.localuse) %]
603                 <p class="problem">Local use recorded</p>
604             [% END %]
605             [% IF ( errmsgloo.waslost ) %]
606                 <p class="problem">Item was lost, now found.</p>
607                 [% IF ( LostItemFeeRefunded ) %]
608                     <p class="problem">A refund has been applied to the borrowing patron's account.</p>
609                 [% ELSE %]
610                     <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
611                 [% END %]
612             [% END %]
613             [% IF ( errmsgloo.withdrawn ) %]
614                 [% IF BlockReturnOfWithdrawnItems %]
615                    <h5>Cannot check in</h5>
616                    <p><strong>NOT CHECKED IN</strong></p>
617                    <p class="problem">Item is withdrawn.</p>
618                 [% ELSE %]
619                    <p class="problem">Item is withdrawn.</p>
620                 [% END %]
621             [% END %]
622             [% IF ( errmsgloo.debarred ) %]
623                 <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %].</p>
624             [% END %]
625             [% IF ( errmsgloo.prevdebarred ) %]
626                 <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
627             [% END %]
628             [% IF ( errmsgloo.foreverdebarred ) %]
629                 <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction.</p>
630             [% END %]
631         [% END %]
632     </div>
633 [% END %]
635 [% IF ( checkinmsg ) %]
636     [% IF ( checkinmsgtype == 'alert' ) %]
637         <div class="dialog alert">
638     [% ELSE %]
639         <div class="dialog message">
640     [% END %]
641             <p class="problem">[% checkinmsg | html_line_break %]</p>
642         </div>
643 [% END%]
645     <div id="exemptfines" class="dialog message" style="display:none;">
646         <p>Fines for returned items are forgiven.</p>
647     </div>
648     <div id="forgivemanualholdsexpire-alert" class="dialog message" style="display:none;">
649         <p>Fines are not charged for manually cancelled holds.</p>
650     </div>
651     <div id="dropboxmode" class="dialog message" style="display:none;">
652         <p>Book drop mode.  (Effective checkin date is [% dropboxdate %] ).</p>
653     </div>
654 </div>
655 <div class="yui-g">
656     <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
657     <div class="yui-u first">
658             <fieldset>
659         <legend>Check in</legend>
660             <label for="barcode">Enter item barcode: </label>
661                         [% IF ( exemptfine ) %]
662                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
663                         [% ELSIF ( dropboxmode ) %]
664                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
665                         [% ELSE %]
666                         <input name="barcode" id="barcode" size="14" class="focus"/>
667                         [% END %]
668             <input type="submit" class="submit" value="Submit" />
670             [% IF Koha.Preference('SpecifyReturnDate') %]
671                 <div class="date-select" id="return_date_override_fields">
672                     <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
674                     <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override %]" />
676                     <label for="return_date_override_remember"> Remember for next check in:</label>
677                     [% IF ( return_date_override_remember ) %]
678                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" checked="checked" />
679                     [% ELSE %]
680                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" />
681                     [% END %]
683                     <input type="button" class="action" id="cleardate" value="Clear" name="cleardate" onclick="this.checked = false; this.form.return_date_override.value = ''; this.form.return_date_override_remember.checked = false; this.form.barcode.focus(); return false;" />
684             </div>
685         [% END %]
686             [% FOREACH inputloo IN inputloop %]
687                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
688                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
689                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
690             [% END %]
693             </fieldset>
694             </div>
695             <div class="yui-u">
696             <fieldset id="checkin_options">
697                 <legend>Options</legend>
698                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
699                     <p>
700                         [% IF ( exemptfine ) %]
701                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
702                         [% ELSE %]
703                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
704                         [% END %]
705                         <label for="exemptcheck">Forgive overdue charges</label>
706                     </p>
707                     [% END %] <!-- overduecharges -->
708                     <p>
709                         [% IF ( dropboxmode ) %]
710                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
711                         [% ELSE %]
712                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
713                         [% END %]
714                         <label for="dropboxcheck">Book drop mode</label>
715                     </p>
716                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
717                     <p>
718                         [% IF ( forgivemanualholdsexpire ) %]
719                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
720                         [% ELSE %]
721                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
722                         [% END %]
723                         <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
724                     </p>
725                     [% END %] <!-- overduecharges -->
726             </fieldset>
727         </div>
728     </form>
729 </div>
731 [% IF ( riloop ) %]
732     <h2>Checked-in items</h2>
733     <table id="checkedintable">
734     <thead><tr><th class="ci-duedate">Due date</th><th class="ci-title">Title</th><th class="ci-author">Author</th><th class="ci-barcode">Barcode</th><th class="ci-homelibrary">Home library</th><th class="ci-holdinglibrary">Holding library</th><th class="ci-shelvinglocation">Shelving location</th><th class="ci-callnumber">Call number</th><th class="ci-dateaccessioned">Date acquired</th><th class="ci-type">Type</th><th class="ci-patron">Patron</th><th class="ci-note">Note</th></tr></thead>
736         [% FOREACH riloo IN riloop %]
737             <tr>
738             <td class="ci-duedate">[% IF ( riloo.duedate ) %]
739                     [% IF ( riloo.return_overdue ) %]
740                         <span class="overdue">[% riloo.duedate %] (overdue)</span>
741                     [% ELSE %][% riloo.duedate %]
742                     [% END %]
743                 [% ELSE %]Not checked out
744                 [% END %]
745             </td>
746             <td class="ci-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber %]">
747                     [% riloo.itemtitle |html %]
748                 </a>
749                 [% IF ( riloo.enumchron ) %]
750                     <br/>
751                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron %]</span>
752                 [% END %]
753             </td>
754             <td class="ci-author">[% riloo.itemauthor %]</td>
755             <td class="ci-barcode"><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% riloo.itembiblionumber %]&amp;itemnumber=[% riloo.itemnumber %]#item[% riloo.itemnumber %]">[% riloo.barcode %]</a></td>
756             <td class="ci-homelibrary">[% Branches.GetName( riloo.homebranch ) %]</td>
757             <td class="ci-holdinglibrary">[% Branches.GetName( riloo.holdingbranch ) %]</td>
758             <td class="ci-shelvinglocation">[% riloo.location %]</td>
759             <td class="ci-callnumber">[% riloo.itemcallnumber %]</td>
760             <td class="ci-dateaccessioned">[% riloo.dateaccessioned | $KohaDates %]</td>
761             <td class="ci-type">[% ItemTypes.GetDescription( riloo.itemtype ) %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) %]</td>
762             <td class="ci-patron">[% IF ( riloo.duedate ) %]
763                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.borrowernumber %]">
764                     [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
765                 </a>
766                 [% IF riloo.borissuescount %]
767                     <span class="results_summary nowrap">
768                         <span class="label">Checkouts:</span>
769                         <span class="number_box">
770                             <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.borrowernumber %]">[% riloo.borissuescount %]</a>
771                         </span>
772                     </span>
773                 [% END %]
774             [% ELSE %]Not checked out[% END %]</td>
775             <td class="ci-note">
776                 [% IF ( riloo.bornote ) %]<p><span class="circ-hlt patron-note">[% riloo.bornote %]</p></span>[% END %]
777                 [% IF ( riloo.itemnote ) %]<p><span class="circ-hlt item-note-public">[% riloo.itemnote %]</p></span>[% END %]
778                 [% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic %]</p></span>[% END %]
779             </td>
780            </tr>
781         [% END %]
782     </table>
783 [% END %]
784 </div>
785 [% IF Koha.Preference('CircSidebar') %]
786 </div>
787 <div class="yui-b noprint">
788     [% INCLUDE 'circ-nav.inc' %]
789 </div>
790 [% END %]
791 </div>
792 </div>
793 </div>
794 [% INCLUDE 'intranet-bottom.inc' %]