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