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