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