Bug 11360 - Disable barcode field and submit button when a hold is found
[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                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
256                             [% itembarcode |html %]: [% title |html %]
257                         </a>
258                     </h3>
259                 </div>
260
261                 <div class="modal-body">
262                     [% IF ( reservenotes ) %]
263                         <h4>Notes: [% reservenotes %]</h4>
264                     [% END %]
265
266                     <h4>Hold for:</h4>
267
268                     <li>
269                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])
270                     </li>
271
272                     <li>
273                         [% borstnum %] [% boraddress %]<br />
274                         [% IF ( boraddress2 ) %]
275                             [% boraddress2 %]<br />
276                         [% END %]
277                         [% borcity %] [% borzip %]
278                     </li>
279
280                     [% IF ( borphone ) %]
281                         <li> [% borphone %]</li>
282                     [% END %]
283
284                     [% IF ( boremail ) %]
285                         <li><a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a></li>
286                     [% END %]
287
288                     [% IF ( debarred ) %]
289                         <li class="error">Patron is RESTRICTED</li>
290                     [% END %]
291
292                     [% IF ( gonenoaddress ) %]
293                         <li class="error">Patron's address is in doubt</li>
294                     [% END %]
295
296                     [% IF ( transfertodo ) %]
297                         <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
298                     [% ELSE %]
299                         <h4><strong>Hold at</strong> [% destbranchname %]</h4>
300                     [% END %]
301
302                     [% FOREACH inputloo IN inputloop %]
303                         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
304                         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
305                         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
306                     [% END %]
307
308                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
309                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
310                     <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
311                     <input type="hidden" name="resbarcode" value="[% barcode | html %]" />
312                     <input type="hidden" name="diffBranch" value="[% destbranch %]" />
313                     <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
314                     <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
315                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
316
317                     <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
318                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
319                 </div>
320
321                 <div class="modal-footer">
322                     <input type="hidden" name="cancel_reserve" value="0" />
323                     <button type="submit" class="btn btn-danger deny" onclick="this.form.cancel_reserve.value = 1; this.form.submit();">
324                         <i class="fa fa-times"></i> Cancel hold
325                     </button>
326
327                     <button type="submit" class="btn approve">
328                         <i class="fa fa-check"></i> Confirm
329                     </button>
330
331                     <input type="hidden" name="print_slip" value="0" />
332                     <button type="submit" class="btn btn-primary print" onclick="this.form.print_slip.value = 1; this.form.submit();">
333                         <i class="fa fa-print"></i> Print and confirm
334                     </button>
335                 </div>
336             </form>
337         </div>
338     [% END %]
339
340     [% IF ( diffbranch ) %]
341                 <!-- diffbranch -->
342         <div id="transfer-needed" class="dialog message audio-alert-action">
343             <h3>Hold needing transfer found</h3>
344                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
345                 <h4>Hold for: </h4>
346                     <ul>
347                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
348                         <li>[% borstnum %] [% boraddress %]<br />
349                                                 [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
350                                                 [% borcity %]  [% borzip %]</li>
351                         [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
352                         [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
353 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
354 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
355                     </ul>
356                 [% IF ( transfertodo ) %]
357             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
358                 [% ELSE %]
359                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
360         [% END %]
361
362         <form method="post" action="returns.pl" class="confirm">
363             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
364             <input type="hidden" name="print_slip" value="0" />
365             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
366             <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
367             <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>
368             [% FOREACH inputloo IN inputloop %]
369                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
370                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
371                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
372             [% END %]
373             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
374             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
375             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
376             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
377             <input type="hidden" name="barcode" value="0" />
378
379             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
380             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
381         </form>
382                 </div>
383     [% END %]
384
385     [% IF ( transfer ) %]
386     <!-- transfer: item with no reservation, must be returned according to home library circulation rules -->
387         <div id="return1" class="dialog message audio-alert-action">
388             <h3>Please return item to: [% Branches.GetName( returnbranch ) %]</h3>
389             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
390             <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>
391         </div>
392     [% END %]
393
394     [% IF ( needstransfer ) %]
395         <!-- needstransfer -->
396     <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) %]</h3>
397     Transfer now?<br />
398     <form method="post" action="returns.pl" name="mainform" id="mainform">
399     [% IF itemnumber %]
400         <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>
401     [% END %]
402         <button type="submit" name="dotransfer" class="submit"><i class="fa fa-check"></i> Yes</button>
403         <button type="submit" name="notransfer" class="submit"><i class="fa fa-times"></i> No</button>
404     <input type="hidden" name="tobranch" value="[% returnbranch %]" />
405         <input type="hidden" name="transferitem" value="[% itemnumber %]" />
406         <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
407         <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
408         <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
409         [% FOREACH inputloo IN inputloop %]
410         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
411         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
412         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
413         [% END %]
414         <input type="hidden" name="barcode" value="0" />
415         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
416         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
417         </form>   </div>
418     [% END %]
419
420     [% IF ( diffbranch ) %]
421         <!-- diffbranch -->
422         <h3 class="audio-alert-action">Item consigned:</h3>
423         <table>
424         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a></caption>
425         <tr>
426             <th>Hold for:</th>
427             <td>[% name %]</td>
428         </tr>
429         </table>
430         <form method="post" action="returns.pl"><input type="submit" value="OK" />
431             [% FOREACH inputloo IN inputloop %]
432                 [% UNLESS ( inputloo.first ) %]
433                     <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
434                     <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
435                     <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
436                 [% END %]
437             [% END %]
438
439             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
440             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
441
442             <input type="hidden" name="barcode" value="0" />
443         </form>
444     [% END %]
445
446
447     <!-- case of simple return no issue or transfer but with a reservation  -->
448     [% IF ( reserved ) %]
449         <!--  reserved  -->
450         <div id="hold-found2" class="modal fade audio-alert-action">
451             <form method="post" action="returns.pl" class="confirm">
452                 <div class="modal-header">
453                     <h3>
454                         Hold found:
455                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
456                             [% itembarcode |html %]: [% title |html %]
457                         </a>
458                 </div>
459
460                 <div class="modal-body">
461                     [% IF ( reservenotes ) %]
462                         <h4>Notes: [% reservenotes %]</h4>
463                     [% END %]
464                     <h5>Hold for:</h5>
465
466                         <li>
467                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
468                                 [% borsurname %], [% borfirstname %]
469                             </a>
470                             ([% borcnum %])
471                         </li>
472
473                         <li>
474                             [% borstnum %] [% boraddress %]<br />
475                             [% IF ( boraddress2 ) %]
476                                 [% boraddress2 %]<br />
477                             [% END %]
478                             [% borcity %] [% borzip %]
479                         </li>
480
481 <<<<<<< HEAD
482     <div id="hold-found2" class="dialog message audio-alert-action">
483       <h3>Hold found</h3>
484           <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
485         [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %]
486         <h5>Hold for:</h5>
487                 <ul>
488             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
489                 [% borsurname %], [% borfirstname %]
490             </a> ([% borcnum %])</li>
491             <li>[% borstnum %] [% boraddress %]<br />
492                         [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
493                         [% borcity %] [% borzip %]</li>
494             [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
495             [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
496             [% UNLESS ( transfertodo) %]
497                 [% INCLUDE display_bormessagepref %]
498             [% END %]
499 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
500 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
501         </ul>
502         [% IF ( transfertodo ) %]
503             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
504                 [% ELSE %]
505                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
506         [% END %]
507         <form method="post" action="returns.pl" class="confirm">
508             <input type="hidden" name="print_slip" value="0" />
509             [% IF ( transfertodo ) %]
510                 <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm hold and transfer</button>
511                 <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>
512             [% ELSE %]
513                 <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm hold</button>
514                 <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>
515             [% END %]
516                 <button type="submit" class="deny" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;"><i class="fa fa-times"></i> Ignore</button>
517             [% FOREACH inputloo IN inputloop %]
518         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
519         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
520         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %]
521             <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
522             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
523             <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
524             <input type="hidden" name="resbarcode" value="[% barcode | html %]" />
525             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
526             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
527             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
528             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
529             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
530             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
531         </form>
532         </div>
533 =======
534                         [% IF ( borphone ) %]
535                             <li>[% borphone %]</li>
536                         [% END %]
537
538                         [% IF ( boremail ) %]
539                             <li>
540                                 [% IF ( transfertodo ) %]
541                                     [% boremail %]
542                                 [% ELSE %]
543                                     <a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>
544                                 [% END %]
545                             </li>
546                         [% END %]
547
548                         [% IF ( debarred ) %]
549                             <li class="error">Patron is RESTRICTED</li>
550                         [% END %]
551
552                         [% IF ( gonenoaddress ) %]
553                             <li class="error">Patron's address is in doubt</li>
554                         [% END %]
555
556                     [% IF ( transfertodo ) %]
557                         <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
558                     [% ELSE %]
559                         <h4><strong>Hold at</strong> [% destbranchname %]</h4>
560                     [% END %]
561
562                     <input type="hidden" name="print_slip" value="0" />
563
564
565                     [% FOREACH inputloo IN inputloop %]
566                         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
567                         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
568                         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
569                     [% END %]
570
571                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
572                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
573                     <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
574                     <input type="hidden" name="resbarcode" value="[% barcode %]" />
575                     <input type="hidden" name="diffBranch" value="[% destbranch %]" />
576                     <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
577                     <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
578                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
579                     <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
580                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
581                 </div>
582
583                 <div class="modal-footer">
584                     [% IF ( transfertodo ) %]
585                         <button type="submit" class="btn approve">
586                             <i class="fa fa-check"></i> Confirm hold and transfer
587                         </button>
588                         <button type="submit" class="btn btn-primary print" onclick="this.form.print_slip.value = 1; this.form.submit()">
589                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
590                         </button>
591                     [% ELSE %]
592                         <button type="submit" class="btn approve">
593                             <i class="fa fa-check"></i> Confirm hold
594                         </button>
595                         <button type="submit" class="btn btn-primary print" onclick="this.form.print_slip.value = 1; this.form.submit();">
596                             <i class="fa fa-print"></i> Print slip and confirm
597                         </button>
598                     [% END %]
599
600                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
601                         <i class="fa fa-times"></i> Ignore
602                     </button>
603                 </div>
604             </form>
605         </div>
606 >>>>>>> Bug 11360 - Disable barcode field and submit button when a hold is found
607     [% END %]
608 [% END %]
609
610 [% IF ( errmsgloop ) %]
611     <div class="dialog alert audio-alert-warning">
612         <h3>Check in message</h3>
613         [% IF itembiblionumber %]
614             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
615         [% END %]
616         [% FOREACH errmsgloo IN errmsgloop %]
617                     [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
618                         <p class="problem">
619                             Not for loan status updated.
620                             <br />Old value:
621                             [% IF errmsgloo.NotForLoanStatusUpdated.from %]
622                                 [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
623                             [% ELSE %]
624                                 Available for loan.
625                             [% END %]
626                             <br />New value:
627                             [% IF errmsgloo.NotForLoanStatusUpdated.to %]
628                                 [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
629                             [% ELSE %]
630                                 Available for loan.
631                             [% END %]
632                         </p>
633                     [% END %]
634                     [% IF ( errmsgloo.badbarcode ) %]
635                         <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
636                     [% END %]
637                     [% IF ( errmsgloo.ispermanent ) %]
638                         <p class="problem">Please return item to: [% errmsgloo.msg %]</p>
639                     [% END %]
640                     [% IF ( errmsgloo.notissued ) %]
641                         <p class="problem">Not checked out.</p>
642                     [% END %]
643                     [% IF ( errmsgloo.localuse) %]
644                         <p class="problem">Local use recorded</p>
645                     [% END %]
646                     [% IF ( errmsgloo.waslost ) %]
647                         <p class="problem">Item was lost, now found.</p>
648                         [% IF ( LostItemFeeRefunded ) %]
649                             <p class="problem">A refund has been applied to the borrowing patron's account.</p>
650                         [% ELSE %]
651                             <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
652                         [% END %]
653                     [% END %]
654                     [% IF ( errmsgloo.withdrawn ) %]
655                         [% IF BlockReturnOfWithdrawnItems %]
656                            <h5>Cannot check in</h5>
657                            <p><strong>NOT CHECKED IN</strong></p>
658                            <p class="problem">Item is withdrawn.</p>
659                         [% ELSE %]
660                            <p class="problem">Item is withdrawn.</p>
661                         [% END %]
662                     [% END %]
663                     [% IF ( errmsgloo.debarred ) %]
664                         <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>
665                     [% END %]
666                     [% IF ( errmsgloo.prevdebarred ) %]
667                         <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
668                     [% END %]
669                     [% IF ( errmsgloo.foreverdebarred ) %]
670                         <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction.</p>
671                     [% END %]
672
673             [% END %]
674         [% ELSE %]
675         [% END %]
676     </div>
677
678 [% IF ( checkinmsg ) %]
679     [% IF ( checkinmsgtype == 'alert' ) %]
680         <div class="dialog alert">
681     [% ELSE %]
682         <div class="dialog message">
683     [% END %]
684             <p class="problem">[% checkinmsg | html_line_break %]</p>
685         </div>
686 [% END%]
687
688     <div id="exemptfines" class="dialog message" style="display:none;">
689         <p>Fines for returned items are forgiven.</p>
690     </div>
691     <div id="forgivemanualholdsexpire-alert" class="dialog message" style="display:none;">
692         <p>Fines are not charged for manually cancelled holds.</p>
693     </div>
694     <div id="dropboxmode" class="dialog message" style="display:none;">
695         <p>Book drop mode.  (Effective checkin date is [% dropboxdate %] ).</p>
696     </div>
697 </div>
698         <div class="yui-g">
699     <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
700     <div class="yui-u first">
701             <fieldset>
702         <legend>Check in</legend>
703             <label for="barcode">Enter item barcode: </label>
704                         [% IF ( exemptfine ) %]
705                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
706                         [% ELSIF ( dropboxmode ) %]
707                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
708                         [% ELSE %]
709                         <input name="barcode" id="barcode" size="14" class="focus"/>
710                         [% END %]
711             <input type="submit" class="submit" value="Submit" />
712
713             [% IF Koha.Preference('SpecifyReturnDate') %]
714                 <div class="date-select" id="return_date_override_fields">
715                     <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
716
717                     <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override %]" />
718
719                     <label for="return_date_override_remember"> Remember for next check in:</label>
720                     [% IF ( return_date_override_remember ) %]
721                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" checked="checked" />
722                     [% ELSE %]
723                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" />
724                     [% END %]
725
726                     <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;" />
727             </div>
728         [% END %]
729             [% FOREACH inputloo IN inputloop %]
730                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
731                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
732                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
733             [% END %]
734
735
736             </fieldset>
737             </div>
738             <div class="yui-u">
739             <fieldset id="checkin_options">
740                 <legend>Options</legend>
741                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
742                     <p>
743                         [% IF ( exemptfine ) %]
744                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
745                         [% ELSE %]
746                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
747                         [% END %]
748                         <label for="exemptcheck">Forgive overdue charges</label>
749                     </p>
750                     [% END %] <!-- overduecharges -->
751                     <p>
752                         [% IF ( dropboxmode ) %]
753                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
754                         [% ELSE %]
755                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
756                         [% END %]
757                         <label for="dropboxcheck">Book drop mode</label>
758                     </p>
759                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
760                     <p>
761                         [% IF ( forgivemanualholdsexpire ) %]
762                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
763                         [% ELSE %]
764                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
765                         [% END %]
766                         <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
767                     </p>
768                     [% END %] <!-- overduecharges -->
769             </fieldset>
770         </div>
771     </form>
772 </div>
773
774 [% IF ( riloop ) %]
775     <h2>Checked-in items</h2>
776     <table id="checkedintable">
777     <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>
778
779         [% FOREACH riloo IN riloop %]
780             <tr>
781             <td class="ci-duedate">[% IF ( riloo.duedate ) %]
782                     [% IF ( riloo.return_overdue ) %]
783                         <span class="overdue">[% riloo.duedate %] (overdue)</span>
784                     [% ELSE %][% riloo.duedate %]
785                     [% END %]
786                 [% ELSE %]Not checked out
787                 [% END %]
788             </td>
789             <td class="ci-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber %]">
790                     [% riloo.itemtitle |html %]
791                 </a>
792                 [% IF ( riloo.enumchron ) %]
793                     <br/>
794                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron %]</span>
795                 [% END %]
796             </td>
797             <td class="ci-author">[% riloo.itemauthor %]</td>
798             <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>
799             <td class="ci-homelibrary">[% Branches.GetName( riloo.homebranch ) %]</td>
800             <td class="ci-holdinglibrary">[% Branches.GetName( riloo.holdingbranch ) %]</td>
801             <td class="ci-shelvinglocation">[% riloo.location %]</td>
802             <td class="ci-callnumber">[% riloo.itemcallnumber %]</td>
803             <td class="ci-dateaccessioned">[% riloo.dateaccessioned | $KohaDates %]</td>
804             <td class="ci-type">[% ItemTypes.GetDescription( riloo.itemtype ) %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) %]</td>
805             <td class="ci-patron">[% IF ( riloo.duedate ) %]
806                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.borrowernumber %]">
807                     [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
808                 </a>
809             [% ELSE %]Not checked out[% END %]</td>
810             <td class="ci-note">
811                 [% IF ( riloo.bornote ) %]<p><span class="circ-hlt patron-note">[% riloo.bornote %]</p></span>[% END %]
812                 [% IF ( riloo.itemnote ) %]<p><span class="circ-hlt item-note-public">[% riloo.itemnote %]</p></span>[% END %]
813                 [% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic %]</p></span>[% END %]
814             </td>
815            </tr>
816         [% END %]
817     </table></div>
818 [% END %]
819
820
821 </div>
822 [% INCLUDE 'intranet-bottom.inc' %]