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