Bug 17055 - Add classes to different note types to allow for styling on checkins...
[koha.git] / 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
42     [% IF print_slip %]
43         Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]');
44     [% END %]
45
46     var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
47     var returns_table = KohaTable("#checkedintable", {
48             "bFilter":false,
49             "bPaginate":false,
50             "bInfo":false,
51             "bSort":false,
52             "dom": 'B<"clearfix">t',
53             }, columns_settings);
54
55     $("#return_date_override").datetimepicker({
56         onClose: function(dateText, inst) { $("#barcode").focus(); },
57         defaultDate: -1,
58         hour: 23,
59         minute: 59,
60         maxDate: 0
61     });
62     $("#return_date_override").on("blur", function() {
63             check_valid_return_date();
64     });
65     $("#checkin-form").submit(function( event ) {
66         if ( !check_valid_return_date() ) {
67             event.preventDefault();
68         }
69     });
70
71     function check_valid_return_date() {
72         if ( $("#return_date_override").val() ) {
73             var datetime = DateTime_from_syspref( $("#return_date_override").val() );
74             var now = new Date();
75             if ( !datetime || datetime > now ) {
76                 alert("Invalid return date/time!");
77                 $("#return_date_override").val("")
78                 return false;
79             }
80         }
81         return true;
82     }
83
84     $("#exemptcheck").change(function () {
85         if (this.checked == true) {
86             $("#barcode").addClass("alert");
87             $("#exemptfines").show();
88         } else {
89             $("#barcode").removeClass("alert");
90             $("#exemptfines").hide();
91         }
92         $("#barcode").focus();
93     });
94     $("#dropboxcheck").change(function () {
95         if (this.checked == true) {
96             $("#barcode").addClass("alert");
97             $("#dropboxmode").show();
98
99             $("#return_date_override_fields :input").prop('disabled', true);
100             $("#return_date_override").datetimepicker("disable");
101         } else {
102             $("#barcode").removeClass("alert");
103             $("#dropboxmode").hide();
104
105             $("#return_date_override_fields :input").prop('disabled', false);
106             $("#return_date_override").datetimepicker("enable");
107         }
108         $("#barcode").focus();
109     });
110     $("#forgivemanualholdsexpire").change(function () {
111         if (this.checked == true) {
112             $("#barcode").addClass("alert");
113             $("#forgivemanualholdsexpire-alert").show();
114         } else {
115             $("#barcode").removeClass("alert");
116             $("#forgivemanualholdsexpire-alert").hide();
117         }
118         $("#barcode").focus();
119     });
120     [% IF(overduecharges) %] $("#barcode").focus(function () {
121         if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
122             $("#barcode").addClass("alert");
123         } else {
124             $("#barcode").removeClass("alert");
125         }
126     });
127     $("#barcode").blur(function () {
128         $("#barcode").removeClass("alert");
129     });
130     [% END %]
131     $('.openWin').on("click",function(e){
132         e.preventDefault();
133         Dopop( $(this).data("url") );
134     });
135 });
136 //]]>
137 </script>
138 </head>
139 <body id="circ_returns" class="circ">
140 <span class="audio-alert-success"></span>
141
142 [% INCLUDE 'header.inc' %]
143 [% INCLUDE 'checkin-search.inc' %]
144
145 <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>
146
147 <div id="doc" class="yui-t7">
148
149    <div id="bd">
150         <div id="yui-main">
151
152 <div class="yui-g">
153
154 [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
155     <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>
156 [% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
157     <div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
158 [% END %]
159
160 [% IF additional_materials %]
161     <div class="dialog message" id="materials">Note about the accompanying materials: <br />
162     [% additional_materials %]
163     </div>
164 [% END %]
165
166 [% IF ( collectionItemNeedsTransferred ) %]
167  <div id="rotating-collection" class="dialog message">
168         <h3>Please transfer item to: [% collectionBranchName %]</h3>
169             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
170             <p>This item is part of a rotating collection.</p>
171             <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>
172 </div>
173 [% END %]
174
175 <!-- Patron has fines -->
176 [% IF ( fines ) %]
177     <div class="dialog alert">
178         <h3>Patron has outstanding fines of [% fines %].</h3>
179         <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber %]">Make payment</a>.</p>
180     </div>
181 [% END %]
182
183 <!-- Patron has waiting holds -->
184 [% IF ( waiting_holds ) %]
185     <div id="awaiting-pickup" class="dialog message">
186         <h3>[% holdsfirstname %] [% holdssurname %] has [% waiting_holds %] hold(s) waiting for pickup.</h3>
187         <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber %]">Check out to this patron</a>.</p>
188     </div>
189 [% END %]
190
191 <!-- Patron is restricted and checkin was backdated -->
192 [% IF return_date_was_overriden && Borrowers.IsDebarred( borrower ) %]
193     <div id="restricted_backdated" class="dialog message">
194         <h3>
195             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">
196                 [% borrower.firstname %] [% borrower.surname %]
197             </a>
198             is restricted. Please verify this patron should still be restricted.
199         </h3>
200     </div>
201 [% END %]
202
203 [% IF ( wrongbranch ) %]
204     <div class="dialog alert"><h3>Cannot check in</h3>
205         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
206         </p><strong>NOT CHECKED IN</strong></p>
207         <p>This item must be checked in at following library: <strong>[% Branches.GetName( rightbranch ) %]</strong></p>
208     </div>
209 [% END %]
210 <!-- case of a mistake in transfer loop -->
211 [% IF ( WrongTransfer ) %]
212     <div id="return2" class="dialog message">
213         <!-- WrongTransfer -->
214         <h3>Please return item to: [% Branches.GetName( TransferWaitingAt ) %]</h3>
215             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
216         <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>
217         <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>
218 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
219         <ul><li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
220             [% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
221         <li>[% wborstnum %] [% wboraddress %][% IF ( wboraddress2 ) %]<br />
222                 [% wboraddress2 %]<br />[% END %]
223         [% wborcity %]  [% wborzip %]</li>
224         [% IF ( wborphone ) %]<li>[% wborphone %]</li>[% END %]
225                 [% IF ( wboremail ) %]<li><a id="boremail" href="mailto:[% wboremail %]">[% wboremail %]</a></li>[% END %]
226         </ul>
227
228     <form method="post" action="returns.pl" class="confirm">
229             <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem %]" />
230             <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt %]" />
231             <input type="hidden" name="WT-From" value="[% wtransfertFrom %]" />
232             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
233             <input type="hidden" name="print_slip" value="0" />
234             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
235             <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
236             <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>
237         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
238         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
239     </form>
240     [% END %]</div>
241 [% END %]
242
243 [% IF ( found ) %]
244 <!-- found -->
245 <!-- case of a reservation found, and display info -->
246     [% IF ( waiting ) %]
247         <!-- waiting -->
248
249     <div id="hold-found1" class="dialog message audio-alert-action">
250         <h3>Hold found (item is already waiting)</h3>
251         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
252         [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %]
253         <h4>Hold for:</h4>
254                         <ul>
255             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
256             <li>[% borstnum %] [% boraddress %]<br />
257                         [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
258             [% borcity %] [% borzip %]</li>
259            [% IF ( borphone ) %]<li> [% borphone %]</li>[% END %]
260                    [% IF ( boremail ) %]<li><a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a></li>[% END %]
261             [% INCLUDE display_bormessagepref %]
262 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
263 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]</ul>
264                 [% IF ( transfertodo ) %]
265             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
266                 [% ELSE %]
267                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
268         [% END %]
269         <form method="post" action="returns.pl" class="confirm">
270             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
271
272             <input type="hidden" name="cancel_reserve" value="0" />
273             <button type="submit" class="deny" onclick="this.form.cancel_reserve.value = 1; this.form.submit();"><i class="fa fa-times"></i> Cancel</button>
274
275             <input type="hidden" name="print_slip" value="0" />
276             <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print and confirm</button>
277             [% FOREACH inputloo IN inputloop %]
278                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
279                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
280                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
281             [% END %]
282                 <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
283                 <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
284                 <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
285                 <input type="hidden" name="resbarcode" value="[% barcode | html %]" />
286                 <input type="hidden" name="diffBranch" value="[% destbranch %]" />
287                 <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
288                 <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
289                 <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
290
291                 <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
292                 <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
293                 </form>
294         </div>
295     [% END %]
296
297     [% IF ( diffbranch ) %]
298                 <!-- diffbranch -->
299         <div id="transfer-needed" class="dialog message audio-alert-action">
300             <h3>Hold needing transfer found</h3>
301                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
302                 <h4>Hold for: </h4>
303                     <ul>
304                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
305                         <li>[% borstnum %] [% boraddress %]<br />
306                                                 [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
307                                                 [% borcity %]  [% borzip %]</li>
308                         [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
309                         [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
310 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
311 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
312                     </ul>
313                 [% IF ( transfertodo ) %]
314             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
315                 [% ELSE %]
316                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
317         [% END %]
318
319         <form method="post" action="returns.pl" class="confirm">
320             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
321             <input type="hidden" name="print_slip" value="0" />
322             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
323             <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
324             <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>
325             [% FOREACH inputloo IN inputloop %]
326                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
327                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
328                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
329             [% END %]
330             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
331             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
332             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
333             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
334             <input type="hidden" name="barcode" value="0" />
335
336             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
337             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
338         </form>
339                 </div>
340     [% END %]
341
342     [% IF ( transfer ) %]
343     <!-- transfer: item with no reservation, must be returned according to home library circulation rules -->
344         <div id="return1" class="dialog message audio-alert-action">
345             <h3>Please return item to: [% Branches.GetName( returnbranch ) %]</h3>
346             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
347             <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>
348         </div>
349     [% END %]
350
351     [% IF ( needstransfer ) %]
352         <!-- needstransfer -->
353     <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) %]</h3>
354     Transfer now?<br />
355     <form method="post" action="returns.pl" name="mainform" id="mainform">
356     [% IF itemnumber %]
357         <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>
358     [% END %]
359         <button type="submit" name="dotransfer" class="submit"><i class="fa fa-check"></i> Yes</button>
360         <button type="submit" name="notransfer" class="submit"><i class="fa fa-times"></i> No</button>
361     <input type="hidden" name="tobranch" value="[% returnbranch %]" />
362         <input type="hidden" name="transferitem" value="[% itemnumber %]" />
363         <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
364         <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
365         <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
366         [% FOREACH inputloo IN inputloop %]
367         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
368         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
369         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
370         [% END %]
371         <input type="hidden" name="barcode" value="0" />
372         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
373         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
374         </form>   </div>
375     [% END %]
376
377     [% IF ( diffbranch ) %]
378         <!-- diffbranch -->
379         <h3 class="audio-alert-action">Item consigned:</h3>
380         <table>
381         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a></caption>
382         <tr>
383             <th>Hold for:</th>
384             <td>[% name %]</td>
385         </tr>
386         </table>
387         <form method="post" action="returns.pl"><input type="submit" value="OK" />
388             [% FOREACH inputloo IN inputloop %]
389                 [% UNLESS ( inputloo.first ) %]
390                     <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
391                     <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
392                     <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
393                 [% END %]
394             [% END %]
395
396             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
397             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
398
399             <input type="hidden" name="barcode" value="0" />
400         </form>
401     [% END %]
402
403
404     <!-- case of simple return no issue or transfer but with a reservation  -->
405     [% IF ( reserved ) %]
406         <!--  reserved  -->
407
408     <div id="hold-found2" class="dialog message audio-alert-action">
409       <h3>Hold found</h3>
410           <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
411         [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %]
412         <h5>Hold for:</h5>
413                 <ul>
414             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
415                 [% borsurname %], [% borfirstname %]
416             </a> ([% borcnum %])</li>
417             <li>[% borstnum %] [% boraddress %]<br />
418                         [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
419                         [% borcity %] [% borzip %]</li>
420             [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
421             [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
422             [% UNLESS ( transfertodo) %]
423                 [% INCLUDE display_bormessagepref %]
424             [% END %]
425 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
426 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
427         </ul>
428         [% IF ( transfertodo ) %]
429             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
430                 [% ELSE %]
431                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
432         [% END %]
433         <form method="post" action="returns.pl" class="confirm">
434             <input type="hidden" name="print_slip" value="0" />
435             [% IF ( transfertodo ) %]
436                 <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm hold and transfer</button>
437                 <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit()"><i class="fa fa-print"></i> Print slip, transfer, and confirm</button>
438             [% ELSE %]
439                 <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm hold</button>
440                 <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>
441             [% END %]
442                 <button type="submit" class="deny" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;"><i class="fa fa-times"></i> Ignore</button>
443             [% FOREACH inputloo IN inputloop %]
444         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
445         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
446         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %]
447             <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
448             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
449             <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
450             <input type="hidden" name="resbarcode" value="[% barcode | html %]" />
451             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
452             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
453             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
454             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
455             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
456             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
457         </form>
458         </div>
459     [% END %]
460 [% END %]
461
462 [% IF ( errmsgloop ) %]
463     <div class="dialog alert audio-alert-warning">
464         <h3>Check in message</h3>
465         [% IF itembiblionumber %]
466             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
467         [% END %]
468         [% FOREACH errmsgloo IN errmsgloop %]
469                     [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
470                         <p class="problem">
471                             Not for loan status updated.
472                             <br />Old value:
473                             [% IF errmsgloo.NotForLoanStatusUpdated.from %]
474                                 [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
475                             [% ELSE %]
476                                 Available for loan.
477                             [% END %]
478                             <br />New value:
479                             [% IF errmsgloo.NotForLoanStatusUpdated.to %]
480                                 [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
481                             [% ELSE %]
482                                 Available for loan.
483                             [% END %]
484                         </p>
485                     [% END %]
486                     [% IF ( errmsgloo.badbarcode ) %]
487                         <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
488                     [% END %]
489                     [% IF ( errmsgloo.ispermanent ) %]
490                         <p class="problem">Please return item to: [% errmsgloo.msg %]</p>
491                     [% END %]
492                     [% IF ( errmsgloo.notissued ) %]
493                         <p class="problem">Not checked out.</p>
494                     [% END %]
495                     [% IF ( errmsgloo.localuse) %]
496                         <p class="problem">Local use recorded</p>
497                     [% END %]
498                     [% IF ( errmsgloo.waslost ) %]
499                         <p class="problem">Item was lost, now found.</p>
500                         [% IF ( LostItemFeeRefunded ) %]
501                             <p class="problem">A refund has been applied to the borrowing patron's account.</p>
502                         [% ELSE %]
503                             <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
504                         [% END %]
505                     [% END %]
506                     [% IF ( errmsgloo.withdrawn ) %]
507                         [% IF BlockReturnOfWithdrawnItems %]
508                            <h5>Cannot check in</h5>
509                            <p><strong>NOT CHECKED IN</strong></p>
510                            <p class="problem">Item is withdrawn.</p>
511                         [% ELSE %]
512                            <p class="problem">Item is withdrawn.</p>
513                         [% END %]
514                     [% END %]
515                     [% IF ( errmsgloo.debarred ) %]
516                         <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>
517                     [% END %]
518                     [% IF ( errmsgloo.prevdebarred ) %]
519                         <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
520                     [% END %]
521                     [% IF ( errmsgloo.foreverdebarred ) %]
522                         <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction.</p>
523                     [% END %]
524
525             [% END %]
526         [% ELSE %]
527         [% END %]
528     </div>
529
530 [% IF ( checkinmsg ) %]
531     [% IF ( checkinmsgtype == 'alert' ) %]
532         <div class="dialog alert">
533     [% ELSE %]
534         <div class="dialog message">
535     [% END %]
536             <p class="problem">[% checkinmsg | html_line_break %]</p>
537         </div>
538 [% END%]
539
540     <div id="exemptfines" class="dialog message" style="display:none;">
541         <p>Fines for returned items are forgiven.</p>
542     </div>
543     <div id="forgivemanualholdsexpire-alert" class="dialog message" style="display:none;">
544         <p>Fines are not charged for manually cancelled holds.</p>
545     </div>
546     <div id="dropboxmode" class="dialog message" style="display:none;">
547         <p>Book drop mode.  (Effective checkin date is [% dropboxdate %] ).</p>
548     </div>
549 </div>
550         <div class="yui-g">
551     <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
552     <div class="yui-u first">
553             <fieldset>
554         <legend>Check in</legend>
555             <label for="barcode">Enter item barcode: </label>
556                         [% IF ( exemptfine ) %]
557                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
558                         [% ELSIF ( dropboxmode ) %]
559                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
560                         [% ELSE %]
561                         <input name="barcode" id="barcode" size="14" class="focus"/>
562                         [% END %]
563             <input type="submit" class="submit" value="Submit" />
564
565             [% IF Koha.Preference('SpecifyReturnDate') %]
566                 <div class="date-select" id="return_date_override_fields">
567                     <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
568
569                     <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override %]" />
570
571                     <label for="return_date_override_remember"> Remember for next check in:</label>
572                     [% IF ( return_date_override_remember ) %]
573                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" checked="checked" />
574                     [% ELSE %]
575                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" />
576                     [% END %]
577
578                     <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;" />
579             </div>
580         [% END %]
581             [% FOREACH inputloo IN inputloop %]
582                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
583                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
584                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
585             [% END %]
586
587
588             </fieldset>
589             </div>
590             <div class="yui-u">
591             <fieldset id="checkin_options">
592                 <legend>Options</legend>
593                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
594                     <p>
595                         [% IF ( exemptfine ) %]
596                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
597                         [% ELSE %]
598                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
599                         [% END %]
600                         <label for="exemptcheck">Forgive overdue charges</label>
601                     </p>
602                     [% END %] <!-- overduecharges -->
603                     <p>
604                         [% IF ( dropboxmode ) %]
605                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
606                         [% ELSE %]
607                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
608                         [% END %]
609                         <label for="dropboxcheck">Book drop mode</label>
610                     </p>
611                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
612                     <p>
613                         [% IF ( forgivemanualholdsexpire ) %]
614                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
615                         [% ELSE %]
616                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
617                         [% END %]
618                         <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
619                     </p>
620                     [% END %] <!-- overduecharges -->
621             </fieldset>
622         </div>
623     </form>
624 </div>
625
626 [% IF ( riloop ) %]
627     <h2>Checked-in items</h2>
628     <table id="checkedintable">
629     <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>
630
631         [% FOREACH riloo IN riloop %]
632             <tr>
633             <td class="ci-duedate">[% IF ( riloo.duedate ) %]
634                     [% IF ( riloo.return_overdue ) %]
635                         <span class="overdue">[% riloo.duedate %] (overdue)</span>
636                     [% ELSE %][% riloo.duedate %]
637                     [% END %]
638                 [% ELSE %]Not checked out
639                 [% END %]
640             </td>
641             <td class="ci-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber %]">
642                     [% riloo.itemtitle |html %]
643                 </a>
644                 [% IF ( riloo.enumchron ) %]
645                     <br/>
646                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron %]</span>
647                 [% END %]
648             </td>
649             <td class="ci-author">[% riloo.itemauthor %]</td>
650             <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>
651             <td class="ci-homelibrary">[% Branches.GetName( riloo.homebranch ) %]</td>
652             <td class="ci-holdinglibrary">[% Branches.GetName( riloo.holdingbranch ) %]</td>
653             <td class="ci-shelvinglocation">[% riloo.location %]</td>
654             <td class="ci-callnumber">[% riloo.itemcallnumber %]</td>
655             <td class="ci-dateaccessioned">[% riloo.dateaccessioned | $KohaDates %]</td>
656             <td class="ci-type">[% ItemTypes.GetDescription( riloo.itemtype ) %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) %]</td>
657             <td class="ci-patron">[% IF ( riloo.duedate ) %]
658                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.borrowernumber %]">
659                     [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
660                 </a>
661             [% ELSE %]Not checked out[% END %]</td>
662             <td class="ci-note">
663                 [% IF ( riloo.bornote ) %]<p><span class="circ-hlt patron-note">[% riloo.bornote %]</p></span>[% END %]
664                 [% IF ( riloo.itemnote ) %]<p><span class="circ-hlt item-note-public">[% riloo.itemnote %]</p></span>[% END %]
665                 [% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic %]</p></span>[% END %]
666             </td>
667            </tr>
668         [% END %]
669     </table></div>
670 [% END %]
671
672
673 </div>
674 [% INCLUDE 'intranet-bottom.inc' %]