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