Bug 14060: Remove readonly attributes on date inputs
[koha_ffzg] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / returns.tt
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% USE Koha %]
4 [% USE Borrowers %]
5 [% USE ItemTypes %]
6 [% USE AuthorisedValues %]
7 [% USE ColumnsSettings %]
8
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 %]
23
24 [% INCLUDE 'doc-head-open.inc' %]
25 <title>Koha &rsaquo; Circulation &rsaquo; Check in [% title |html %]</title>
26 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
27 [% INCLUDE 'doc-head-close.inc' %]
28 [% INCLUDE 'datatables.inc' %]
29 [% INCLUDE 'columns_settings.inc' %]
30 [% INCLUDE 'calendar.inc' %]
31 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
32 [% INCLUDE 'timepicker.inc' %]
33
34 <script type="text/javascript">
35 //<![CDATA[
36 function Dopop(link) {
37     var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
38     $("#barcode").focus();
39 }
40 $(document).ready(function () {
41     $(".modal").modal({ backdrop: 'static' }).on('shown', function() {
42         $("#barcode").prop("disabled", true);
43     }).on('hidden', function() {
44         $("#barcode").prop("disabled", false).focus();
45     });
46
47     [% IF print_slip %]
48         Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]');
49     [% END %]
50
51     var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
52     var returns_table = KohaTable("#checkedintable", {
53             "bFilter":false,
54             "bPaginate":false,
55             "bInfo":false,
56             "bSort":false,
57             "dom": 'B<"clearfix">t',
58             }, columns_settings);
59
60     $("#return_date_override").datetimepicker({
61         onClose: function(dateText, inst) {
62             if (validate_date(dateText, inst) ) {
63                 $("#barcode").focus();
64             }
65         },
66         defaultDate: -1,
67         hour: 23,
68         minute: 59,
69         maxDate: 0
70     });
71     $("#return_date_override").on("blur", function() {
72             check_valid_return_date();
73     });
74     $("#checkin-form").submit(function( event ) {
75         if ( !check_valid_return_date() ) {
76             event.preventDefault();
77         }
78     });
79
80     function check_valid_return_date() {
81         if ( $("#return_date_override").val() ) {
82             var datetime = DateTime_from_syspref( $("#return_date_override").val() );
83             var now = new Date();
84             if ( !datetime || datetime > now ) {
85                 alert("Invalid return date/time!");
86                 $("#return_date_override").val("")
87                 return false;
88             }
89         }
90         return true;
91     }
92
93     $("#exemptcheck").change(function () {
94         if (this.checked == true) {
95             $("#barcode").addClass("alert");
96             $("#exemptfines").show();
97         } else {
98             $("#barcode").removeClass("alert");
99             $("#exemptfines").hide();
100         }
101         $("#barcode").focus();
102     });
103     $("#dropboxcheck").change(function () {
104         if (this.checked == true) {
105             $("#barcode").addClass("alert");
106             $("#dropboxmode").show();
107
108             $("#return_date_override_fields :input").prop('disabled', true);
109             $("#return_date_override").datetimepicker("disable");
110         } else {
111             $("#barcode").removeClass("alert");
112             $("#dropboxmode").hide();
113
114             $("#return_date_override_fields :input").prop('disabled', false);
115             $("#return_date_override").datetimepicker("enable");
116         }
117         $("#barcode").focus();
118     });
119     $("#forgivemanualholdsexpire").change(function () {
120         if (this.checked == true) {
121             $("#barcode").addClass("alert");
122             $("#forgivemanualholdsexpire-alert").show();
123         } else {
124             $("#barcode").removeClass("alert");
125             $("#forgivemanualholdsexpire-alert").hide();
126         }
127         $("#barcode").focus();
128     });
129     [% IF(overduecharges) %] $("#barcode").focus(function () {
130         if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
131             $("#barcode").addClass("alert");
132         } else {
133             $("#barcode").removeClass("alert");
134         }
135     });
136     $("#barcode").blur(function () {
137         $("#barcode").removeClass("alert");
138     });
139     [% END %]
140     $('.openWin').on("click",function(e){
141         e.preventDefault();
142         Dopop( $(this).data("url") );
143     });
144 });
145 //]]>
146 </script>
147 </head>
148 <body id="circ_returns" class="circ">
149 <span class="audio-alert-success"></span>
150
151 [% INCLUDE 'header.inc' %]
152 [% INCLUDE 'checkin-search.inc' %]
153
154 <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>
155
156 <div id="doc" class="yui-t7">
157
158    <div id="bd">
159         <div id="yui-main">
160
161 <div class="yui-g">
162
163 [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
164     <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>
165 [% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
166     <div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
167 [% END %]
168
169 [% IF additional_materials %]
170     <div class="dialog message" id="materials">Note about the accompanying materials: <br />
171     [% additional_materials %]
172     </div>
173 [% END %]
174
175 [% IF ( collectionItemNeedsTransferred ) %]
176  <div id="rotating-collection" class="dialog message">
177         <h3>Please transfer item to: [% collectionBranchName %]</h3>
178             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
179             <p>This item is part of a rotating collection.</p>
180             <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>
181 </div>
182 [% END %]
183
184 <!-- Patron has fines -->
185 [% IF ( fines ) %]
186     <div class="dialog alert">
187         <h3>Patron has outstanding fines of [% fines %].</h3>
188         <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber %]">Make payment</a>.</p>
189     </div>
190 [% END %]
191
192 <!-- Patron has waiting holds -->
193 [% IF ( waiting_holds ) %]
194     <div id="awaiting-pickup" class="dialog message">
195         <h3>[% holdsfirstname %] [% holdssurname %] has [% waiting_holds %] hold(s) waiting for pickup.</h3>
196         <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber %]">Check out to this patron</a>.</p>
197     </div>
198 [% END %]
199
200 <!-- Patron is restricted and checkin was backdated -->
201 [% IF return_date_was_overriden && Borrowers.IsDebarred( borrower ) %]
202     <div id="restricted_backdated" class="dialog message">
203         <h3>
204             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">
205                 [% borrower.firstname %] [% borrower.surname %]
206             </a>
207             is restricted. Please verify this patron should still be restricted.
208         </h3>
209     </div>
210 [% END %]
211
212 [% IF ( wrongbranch ) %]
213     <div class="dialog alert"><h3>Cannot check in</h3>
214         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
215         </p><strong>NOT CHECKED IN</strong></p>
216         <p>This item must be checked in at following library: <strong>[% Branches.GetName( rightbranch ) %]</strong></p>
217     </div>
218 [% END %]
219 <!-- case of a mistake in transfer loop -->
220 [% IF ( WrongTransfer ) %]
221     <div id="return2" class="dialog message">
222         <!-- WrongTransfer -->
223         <h3>Please return item to: [% Branches.GetName( TransferWaitingAt ) %]</h3>
224             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
225         <button type="submit" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% homebranch %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
226         <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>
227 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
228         <ul><li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
229             [% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
230         <li>[% wborstnum %] [% wboraddress %][% IF ( wboraddress2 ) %]<br />
231                 [% wboraddress2 %]<br />[% END %]
232         [% wborcity %]  [% wborzip %]</li>
233         [% IF ( wborphone ) %]<li>[% wborphone %]</li>[% END %]
234                 [% IF ( wboremail ) %]<li><a id="boremail" href="mailto:[% wboremail %]">[% wboremail %]</a></li>[% END %]
235         </ul>
236
237     <form method="post" action="returns.pl" class="confirm">
238             <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem %]" />
239             <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt %]" />
240             <input type="hidden" name="WT-From" value="[% wtransfertFrom %]" />
241             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
242             <input type="hidden" name="print_slip" value="0" />
243             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
244             <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
245             <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>
246         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
247         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
248     </form>
249     [% END %]</div>
250 [% END %]
251
252 [% IF ( found ) %]
253     [% IF ( waiting ) %]
254         <div id="hold-found1" class="modal fade audio-alert-action">
255             <form method="post" action="returns.pl" class="confirm">
256                 <div class="modal-header">
257                     <h3>
258                         Hold found (item is already waiting):
259                         <br/>
260                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
261                             [% itembarcode |html %]: [% title |html %]
262                         </a>
263                     </h3>
264                 </div>
265
266                 <div class="modal-body">
267                     [% IF ( reservenotes ) %]
268                         <h4>Notes: [% reservenotes %]</h4>
269                     [% END %]
270
271                     <h4>Hold for:</h4>
272
273                     <li>
274                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])
275                     </li>
276
277                     <li>
278                         [% borstnum %] [% boraddress %]<br />
279                         [% IF ( boraddress2 ) %]
280                             [% boraddress2 %]<br />
281                         [% END %]
282                         [% borcity %] [% borzip %]
283                     </li>
284
285                     [% IF ( borphone ) %]
286                         <li> [% borphone %]</li>
287                     [% END %]
288
289                     [% IF ( boremail ) %]
290                         <li><a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a></li>
291                     [% END %]
292
293                     [% IF ( debarred ) %]
294                         <li class="error">Patron is RESTRICTED</li>
295                     [% END %]
296
297                     [% IF ( gonenoaddress ) %]
298                         <li class="error">Patron's address is in doubt</li>
299                     [% END %]
300
301                     [% IF ( transfertodo ) %]
302                         <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
303                     [% ELSE %]
304                         <h4><strong>Hold at</strong> [% destbranchname %]</h4>
305                     [% END %]
306
307                     [% FOREACH inputloo IN inputloop %]
308                         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
309                         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
310                         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
311                     [% END %]
312
313                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
314                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
315                     <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
316                     <input type="hidden" name="resbarcode" value="[% barcode | html %]" />
317                     <input type="hidden" name="reserve_id" value="[% reserve_id %]" />
318                     <input type="hidden" name="diffBranch" value="[% destbranch %]" />
319                     <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
320                     <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
321                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
322
323                     <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
324                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
325                 </div>
326
327                 <div class="modal-footer">
328                     <input type="hidden" name="cancel_reserve" value="0" />
329
330                     <button type="submit" class="btn approve">
331                         <i class="fa fa-check"></i> Confirm
332                     </button>
333
334                     <input type="hidden" name="print_slip" value="0" />
335                     <button type="submit" class="btn print" onclick="this.form.print_slip.value = 1; this.form.submit();">
336                         <i class="fa fa-print"></i> Print and confirm
337                     </button>
338
339                     <button type="submit" class="btn deny" onclick="this.form.cancel_reserve.value = 1; this.form.submit();">
340                         <i class="fa fa-times"></i> Cancel hold
341                     </button>
342                 </div>
343             </form>
344         </div>
345     [% END %]
346
347     [% IF ( diffbranch ) %]
348                 <!-- diffbranch -->
349         <div id="transfer-needed" class="dialog message audio-alert-action">
350             <h3>Hold needing transfer found</h3>
351                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
352                 <h4>Hold for: </h4>
353                     <ul>
354                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
355                         <li>[% borstnum %] [% boraddress %]<br />
356                                                 [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
357                                                 [% borcity %]  [% borzip %]</li>
358                         [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
359                         [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
360 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
361 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
362                     </ul>
363                 [% IF ( transfertodo ) %]
364             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
365                 [% ELSE %]
366                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
367         [% END %]
368
369         <form method="post" action="returns.pl" class="confirm">
370             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
371             <input type="hidden" name="print_slip" value="0" />
372             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
373             <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
374             <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>
375             [% FOREACH inputloo IN inputloop %]
376                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
377                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
378                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
379             [% END %]
380             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
381             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
382             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
383             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
384             <input type="hidden" name="barcode" value="0" />
385
386             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
387             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
388         </form>
389                 </div>
390     [% END %]
391
392     [% IF ( transfer ) %]
393     <!-- transfer: item with no reservation, must be returned according to home library circulation rules -->
394         <div id="return1" class="dialog message audio-alert-action">
395             <h3>Please return item to: [% Branches.GetName( returnbranch ) %]</h3>
396             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
397             <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>
398         </div>
399     [% END %]
400
401     [% IF ( needstransfer ) %]
402         <!-- needstransfer -->
403     <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) %]</h3>
404     Transfer now?<br />
405     <form method="post" action="returns.pl" name="mainform" id="mainform">
406     [% IF itemnumber %]
407         <button type="submit" name="dotransfer" 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>
408     [% END %]
409         <button type="submit" name="dotransfer" class="submit"><i class="fa fa-check"></i> Yes</button>
410         <button type="submit" name="notransfer" class="submit"><i class="fa fa-times"></i> No</button>
411     <input type="hidden" name="tobranch" value="[% returnbranch %]" />
412         <input type="hidden" name="transferitem" value="[% itemnumber %]" />
413         <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
414         <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
415         <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
416         [% FOREACH inputloo IN inputloop %]
417         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
418         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
419         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
420         [% END %]
421         <input type="hidden" name="barcode" value="0" />
422         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
423         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
424         </form>   </div>
425     [% END %]
426
427     [% IF ( diffbranch ) %]
428         <!-- diffbranch -->
429         <h3 class="audio-alert-action">Item consigned:</h3>
430         <table>
431         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a></caption>
432         <tr>
433             <th>Hold for:</th>
434             <td>[% name %]</td>
435         </tr>
436         </table>
437         <form method="post" action="returns.pl"><input type="submit" value="OK" />
438             [% FOREACH inputloo IN inputloop %]
439                 [% UNLESS ( inputloo.first ) %]
440                     <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
441                     <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
442                     <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
443                 [% END %]
444             [% END %]
445
446             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
447             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
448
449             <input type="hidden" name="barcode" value="0" />
450         </form>
451     [% END %]
452
453
454     <!-- case of simple return no issue or transfer but with a reservation  -->
455     [% IF ( reserved ) %]
456         <!--  reserved  -->
457         <div id="hold-found2" class="modal fade audio-alert-action">
458             <form method="post" action="returns.pl" class="confirm">
459                 <div class="modal-header">
460                     <h3>
461                         Hold found:
462                         <br/>
463                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
464                             [% itembarcode |html %]: [% title |html %]
465                         </a>
466                 </div>
467
468                 <div class="modal-body">
469                     [% IF ( reservenotes ) %]
470                         <h4>Notes: [% reservenotes %]</h4>
471                     [% END %]
472                     <h5>Hold for:</h5>
473
474                         <li>
475                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
476                                 [% borsurname %], [% borfirstname %]
477                             </a>
478                             ([% borcnum %])
479                         </li>
480
481                         <li>
482                             [% borstnum %] [% boraddress %]<br />
483                             [% IF ( boraddress2 ) %]
484                                 [% boraddress2 %]<br />
485                             [% END %]
486                             [% borcity %] [% borzip %]
487                         </li>
488
489                         [% IF ( borphone ) %]
490                             <li>[% borphone %]</li>
491                         [% END %]
492
493                         [% IF ( boremail ) %]
494                             <li>
495                                 [% IF ( transfertodo ) %]
496                                     [% boremail %]
497                                 [% ELSE %]
498                                     <a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>
499                                 [% END %]
500                             </li>
501                         [% END %]
502
503                         [% UNLESS ( transfertodo) %]
504                             [% INCLUDE display_bormessagepref %]
505                         [% END %]
506
507                         [% IF ( debarred ) %]
508                             <li class="error">Patron is RESTRICTED</li>
509                         [% END %]
510
511                         [% IF ( gonenoaddress ) %]
512                             <li class="error">Patron's address is in doubt</li>
513                         [% END %]
514
515                     [% IF ( transfertodo ) %]
516                         <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
517                     [% ELSE %]
518                         <h4><strong>Hold at</strong> [% destbranchname %]</h4>
519                     [% END %]
520
521                     <input type="hidden" name="print_slip" value="0" />
522
523
524                     [% FOREACH inputloo IN inputloop %]
525                         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
526                         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
527                         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
528                     [% END %]
529
530                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
531                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
532                     <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
533                     <input type="hidden" name="resbarcode" value="[% barcode %]" />
534                     <input type="hidden" name="reserve_id" value="[% reserve_id %]" />
535                     <input type="hidden" name="diffBranch" value="[% destbranch %]" />
536                     <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
537                     <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
538                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
539                     <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
540                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
541                 </div>
542
543                 <div class="modal-footer">
544                     [% IF ( transfertodo ) %]
545                         <button type="submit" class="btn approve">
546                             <i class="fa fa-check"></i> Confirm hold and transfer
547                         </button>
548                         <button type="submit" class="btn print" onclick="this.form.print_slip.value = 1; this.form.submit()">
549                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
550                         </button>
551                     [% ELSE %]
552                         <button type="submit" class="btn approve">
553                             <i class="fa fa-check"></i> Confirm hold
554                         </button>
555                         <button type="submit" class="btn print" onclick="this.form.print_slip.value = 1; this.form.submit();">
556                             <i class="fa fa-print"></i> Print slip and confirm
557                         </button>
558                     [% END %]
559
560                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
561                         <i class="fa fa-times"></i> Ignore
562                     </button>
563                 </div>
564             </form>
565         </div>
566     [% END %]
567 [% END %]
568
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: [% 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
632             [% END %]
633         [% ELSE %]
634         [% END %]
635     </div>
636
637 [% IF ( checkinmsg ) %]
638     [% IF ( checkinmsgtype == 'alert' ) %]
639         <div class="dialog alert">
640     [% ELSE %]
641         <div class="dialog message">
642     [% END %]
643             <p class="problem">[% checkinmsg | html_line_break %]</p>
644         </div>
645 [% END%]
646
647     <div id="exemptfines" class="dialog message" style="display:none;">
648         <p>Fines for returned items are forgiven.</p>
649     </div>
650     <div id="forgivemanualholdsexpire-alert" class="dialog message" style="display:none;">
651         <p>Fines are not charged for manually cancelled holds.</p>
652     </div>
653     <div id="dropboxmode" class="dialog message" style="display:none;">
654         <p>Book drop mode.  (Effective checkin date is [% dropboxdate %] ).</p>
655     </div>
656 </div>
657         <div class="yui-g">
658     <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
659     <div class="yui-u first">
660             <fieldset>
661         <legend>Check in</legend>
662             <label for="barcode">Enter item barcode: </label>
663                         [% IF ( exemptfine ) %]
664                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
665                         [% ELSIF ( dropboxmode ) %]
666                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
667                         [% ELSE %]
668                         <input name="barcode" id="barcode" size="14" class="focus"/>
669                         [% END %]
670             <input type="submit" class="submit" value="Submit" />
671
672             [% IF Koha.Preference('SpecifyReturnDate') %]
673                 <div class="date-select" id="return_date_override_fields">
674                     <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
675
676                     <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override %]" />
677
678                     <label for="return_date_override_remember"> Remember for next check in:</label>
679                     [% IF ( return_date_override_remember ) %]
680                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" checked="checked" />
681                     [% ELSE %]
682                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" />
683                     [% END %]
684
685                     <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;" />
686             </div>
687         [% END %]
688             [% FOREACH inputloo IN inputloop %]
689                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
690                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
691                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
692             [% END %]
693
694
695             </fieldset>
696             </div>
697             <div class="yui-u">
698             <fieldset id="checkin_options">
699                 <legend>Options</legend>
700                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
701                     <p>
702                         [% IF ( exemptfine ) %]
703                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
704                         [% ELSE %]
705                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
706                         [% END %]
707                         <label for="exemptcheck">Forgive overdue charges</label>
708                     </p>
709                     [% END %] <!-- overduecharges -->
710                     <p>
711                         [% IF ( dropboxmode ) %]
712                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
713                         [% ELSE %]
714                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
715                         [% END %]
716                         <label for="dropboxcheck">Book drop mode</label>
717                     </p>
718                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
719                     <p>
720                         [% IF ( forgivemanualholdsexpire ) %]
721                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
722                         [% ELSE %]
723                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
724                         [% END %]
725                         <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
726                     </p>
727                     [% END %] <!-- overduecharges -->
728             </fieldset>
729         </div>
730     </form>
731 </div>
732
733 [% IF ( riloop ) %]
734     <h2>Checked-in items</h2>
735     <table id="checkedintable">
736     <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>
737
738         [% FOREACH riloo IN riloop %]
739             <tr>
740             <td class="ci-duedate">[% IF ( riloo.duedate ) %]
741                     [% IF ( riloo.return_overdue ) %]
742                         <span class="overdue">[% riloo.duedate %] (overdue)</span>
743                     [% ELSE %][% riloo.duedate %]
744                     [% END %]
745                 [% ELSE %]Not checked out
746                 [% END %]
747             </td>
748             <td class="ci-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber %]">
749                     [% riloo.itemtitle |html %]
750                 </a>
751                 [% IF ( riloo.enumchron ) %]
752                     <br/>
753                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron %]</span>
754                 [% END %]
755             </td>
756             <td class="ci-author">[% riloo.itemauthor %]</td>
757             <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>
758             <td class="ci-homelibrary">[% Branches.GetName( riloo.homebranch ) %]</td>
759             <td class="ci-holdinglibrary">[% Branches.GetName( riloo.holdingbranch ) %]</td>
760             <td class="ci-shelvinglocation">[% riloo.location %]</td>
761             <td class="ci-callnumber">[% riloo.itemcallnumber %]</td>
762             <td class="ci-dateaccessioned">[% riloo.dateaccessioned | $KohaDates %]</td>
763             <td class="ci-type">[% ItemTypes.GetDescription( riloo.itemtype ) %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) %]</td>
764             <td class="ci-patron">[% IF ( riloo.duedate ) %]
765                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.borrowernumber %]">
766                     [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
767                 </a>
768             [% ELSE %]Not checked out[% END %]</td>
769             <td class="ci-note">
770                 [% IF ( riloo.bornote ) %]<p><span class="circ-hlt patron-note">[% riloo.bornote %]</p></span>[% END %]
771                 [% IF ( riloo.itemnote ) %]<p><span class="circ-hlt item-note-public">[% riloo.itemnote %]</p></span>[% END %]
772                 [% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic %]</p></span>[% END %]
773             </td>
774            </tr>
775         [% END %]
776     </table></div>
777 [% END %]
778
779
780 </div>
781 [% INCLUDE 'intranet-bottom.inc' %]