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