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