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