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