Bug 23286: Improve style of hold confirmation modal
[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 class="notification_method">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 class="notification_method none">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 %]">[% title | html %]</a>
258                         <div class="hold-found-barcode">
259                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% itembarcode | html %]</a>
260                         </div>
261                     </h3>
262                 </div>
263
264                 <div class="modal-body">
265                     [% IF ( reservenotes ) %]
266                         <h4>Notes: [% reservenotes | html %]</h4>
267                     [% END %]
268
269                     <h4>Hold for:</h4>
270                     <ul>
271                     <li>
272                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.surname | html %], [% patron.firstname | html %]</a> ([% patron.cardnumber | html %])
273                         <span class="patron-category"> - [% patron.category.description | html %]</span>
274                     </li>
275                     [% INCLUDE display_holdpatron_address %]
276                     [% IF ( patron.phone ) %]
277                         <li> [% patron.phone | html %]</li>
278                     [% END %]
279
280                     [% IF ( patron.email ) %]
281                         <li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li>
282                     [% END %]
283
284                     [% IF ( patron.debarred ) %]
285                         <li class="error">Patron is RESTRICTED</li>
286                     [% END %]
287
288                     [% IF ( patron.gonenoaddress ) %]
289                         <li class="error">Patron's address is in doubt</li>
290                     [% END %]
291                     </ul>
292
293                     [% IF ( transfertodo ) %]
294                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
295                     [% ELSE %]
296                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
297                     [% END %]
298
299                     [% FOREACH inputloo IN inputloop %]
300                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
301                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
302                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
303                     [% END %]
304
305                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
306                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
307                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
308                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
309                     <input type="hidden" name="diffBranch" value="[% destbranch | 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
314                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
315                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
316                 </div>
317
318                 <div class="modal-footer">
319                     <input type="hidden" name="cancel_reserve" value="0" />
320
321                     <button type="submit" class="btn btn-default approve" data-dismiss="modal">
322                         <i class="fa fa-check"></i> Confirm hold
323                     </button>
324
325                     <input type="hidden" name="print_slip" value="0" />
326                     <button type="submit" class="btn btn-default print">
327                         <i class="fa fa-print"></i> Print slip and confirm
328                     </button>
329
330                     <button type="submit" class="btn btn-default deny cancel-hold">
331                         <i class="fa fa-times"></i> Cancel hold
332                     </button>
333                 </div>
334             </form>
335            </div>
336            </div>
337         </div>
338     [% END %]
339
340     [% IF ( diffbranch ) %]
341                 <!-- diffbranch -->
342         <div id="transfer-needed" class="dialog message audio-alert-action">
343             <h3>Hold needing transfer found</h3>
344                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
345                 <h4>Hold for: </h4>
346                     <ul>
347                         <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>
348                         [% INCLUDE display_holdpatron_address %]
349                         [% IF ( patron.phone ) %]<li>[% patron.phone | html %]</li>[% END %]
350                         [% 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 %]
351 [% IF ( patron.debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
352 [% IF ( patron.gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
353                     </ul>
354         [% IF ( transfertodo ) %]
355             <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
356         [% ELSE %]
357             <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
358         [% END %]
359
360         <form method="post" action="returns.pl" class="confirm">
361             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
362             <input type="hidden" name="print_slip" value="0" />
363             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
364             <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
365             <button type="submit" class="print"><i class="fa fa-print"></i> Print slip and continue</button>
366             [% FOREACH inputloo IN inputloop %]
367                 <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
368                 <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
369                 <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
370             [% END %]
371             <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
372             <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
373             <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
374             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
375             <input type="hidden" name="barcode" value="0" />
376
377             <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
378             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
379         </form>
380                 </div>
381     [% END %]
382
383     [% IF transfer || needstransfer %]
384     <div id="item-transfer-modal" class="modal fade audio-alert-action">
385         <div class="modal-dialog">
386             <div class="modal-content">
387                 <form method="post" action="returns.pl" name="mainform" id="mainform">
388                     <div class="modal-header">
389                         <h3>
390                             Please return this item to [% Branches.GetName( returnbranch ) | html %]
391                         </h3>
392                     </div>
393                     <div class="modal-body">
394                         <p>
395                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
396                             [% itembarcode | html %]: [% title | html %]
397                         </a>
398                         </p>
399                         [% IF !transfer %]
400                         <p>
401                         Transfer now?
402                         </p>
403                         [% END %]
404                         <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
405                         <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
406                         <input type="hidden" name="barcode" value="0" />
407                     </div>
408                     <div class="modal-footer">
409                         [% IF !transfer %]
410                         <button type="submit" name="dotransfer" value="Yes" class="btn btn-default approve"><i class="fa fa-check"></i> Yes</button>
411                         <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>
412                         <button type="button" data-dismiss="modal" class="btn btn-default deny" name="notransfer" value="No"><i class="fa fa-times"></i> No</button>
413                         [% ELSE %]
414                         <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
415                         <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>
416                         [% END %]
417                         <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
418                         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
419                         <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
420                         <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
421                         <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
422                         [% FOREACH inputloo IN inputloop %]
423                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
424                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
425                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
426                         [% END %]
427                     </div>
428                 </form>
429             </div>
430         </div>
431     </div>
432     [% END %]
433
434     [% IF ( diffbranch ) %]
435         <!-- diffbranch -->
436         <h3 class="audio-alert-action">Item consigned:</h3>
437         <table>
438         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a></caption>
439         <tr>
440             <th>Hold for:</th>
441             <td>[% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]</td>
442         </tr>
443         </table>
444         <form method="post" action="returns.pl"><input type="submit" value="OK" />
445             [% FOREACH inputloo IN inputloop %]
446                 [% UNLESS ( inputloo.first ) %]
447                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
448                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
449                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
450                 [% END %]
451             [% END %]
452
453             <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
454             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
455
456             <input type="hidden" name="barcode" value="0" />
457         </form>
458     [% END %]
459
460
461     <!-- case of simple return no issue or transfer but with a reservation  -->
462     [% IF ( reserved ) %]
463         <!--  reserved  -->
464         <div id="hold-found2" class="modal fade audio-alert-action">
465             <div class="modal-dialog">
466             <div class="modal-content">
467             <form method="post" action="returns.pl" class="confirm">
468                 <div class="modal-header">
469                     <h3>
470                         Hold found:
471                         <br/>
472                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
473                         <div class="hold-found-barcode">
474                             (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | html %]">[% itembarcode | html %]</a>)
475                         </div>
476                     </h3>
477                 </div>
478
479                 <div class="modal-body">
480                     [% IF ( reservenotes ) %]
481                         <h4>Notes:</h4>
482                         <p>[% reservenotes | html %]</p>
483                         <hr />
484                     [% END %]
485                     <h5>Hold for:</h5>
486                         <ul>
487                         <li>
488                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]
489                             <span class="patron-category"> - [% patron.category.description | html %]</span>
490                         </li>
491
492                         [% INCLUDE display_holdpatron_address %]
493
494                         [% IF ( patron.phone ) %]
495                             <li>[% patron.phone | html %]</li>
496                         [% END %]
497
498                         [% IF ( patron.email ) %]
499                             <li>
500                                 [% IF ( transfertodo ) %]
501                                     [% patron.email | html %]
502                                 [% ELSE %]
503                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
504                                 [% END %]
505                             </li>
506                         [% END %]
507
508                         [% UNLESS ( transfertodo) %]
509                             [% INCLUDE display_bormessagepref %]
510                         [% END %]
511
512                         [% IF ( patron.debarred ) %]
513                             <li class="error">Patron is RESTRICTED</li>
514                         [% END %]
515
516                         [% IF ( patron.gonenoaddress ) %]
517                             <li class="error">Patron's address is in doubt</li>
518                         [% END %]
519                         </ul>
520                     [% IF ( transfertodo ) %]
521                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
522                     [% ELSE %]
523                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
524                     [% END %]
525
526                     <input type="hidden" name="print_slip" value="0" />
527
528
529                     [% FOREACH inputloo IN inputloop %]
530                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
531                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
532                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
533                     [% END %]
534
535                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
536                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
537                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
538                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
539                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
540                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
541                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
542                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
543                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
544                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
545                 </div>
546
547                 <div class="modal-footer">
548                     [% IF ( transfertodo ) %]
549                         <button type="submit" class="btn btn-default approve">
550                             <i class="fa fa-check"></i> Confirm hold and transfer
551                         </button>
552                         <button type="submit" class="btn btn-default print">
553                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
554                         </button>
555                     [% ELSE %]
556                         <button type="submit" class="btn btn-default approve">
557                             <i class="fa fa-check"></i> Confirm hold
558                         </button>
559                         <button type="submit" class="btn btn-default print">
560                             <i class="fa fa-print"></i> Print slip and confirm
561                         </button>
562                     [% END %]
563
564                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny">
565                         <i class="fa fa-times"></i> Ignore
566                     </button>
567                 </div>
568             </form>
569             </div>
570             </div>
571         </div>
572     [% END %]
573 [% END %]
574
575 [% IF ( errmsgloop ) %]
576     <div class="dialog alert audio-alert-warning">
577         <h3>Check in message</h3>
578         [% IF itembiblionumber %]
579             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
580         [% END %]
581         [% FOREACH errmsgloo IN errmsgloop %]
582             [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
583                 <p class="problem">
584                     Not for loan status updated.
585                     <br />Old value:
586                     [% IF errmsgloo.NotForLoanStatusUpdated.from %]
587                         [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) | html %].
588                     [% ELSE %]
589                         Available for loan.
590                     [% END %]
591                     <br />New value:
592                     [% IF errmsgloo.NotForLoanStatusUpdated.to %]
593                         [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) | html %].
594                     [% ELSE %]
595                         Available for loan.
596                     [% END %]
597                 </p>
598             [% END %]
599             [% IF ( errmsgloo.ItemLocationUpdated ) %]
600                  <p class="problem">
601                      Item shelving location updated.
602                     <br />Old value:
603                     [% IF errmsgloo.ItemLocationUpdated.from %]
604                         [% IF errmsgloo.ItemLocationUpdated.from == '' %]
605                             empty
606                         [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
607                             [% errmsgloo.ItemLocationUpdated.from | html %] (No description available)
608                         [% ELSE %]
609                             [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) | html %]
610                         [% END %]
611                     [% ELSE %]
612                         "Blank"
613                     [% END %]
614                     <br />New value:
615                     [% IF errmsgloo.ItemLocationUpdated.to %]
616                         [% IF errmsgloo.ItemLocationUpdated.to == '' %]
617                             empty
618                         [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
619                             [% errmsgloo.ItemLocationUpdated.to | html %] (Not an authorized value)
620                         [% ELSE %]
621                             [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) | html %]
622                         [% END %]
623                     [% ELSE %]
624                         "Blank"
625                     [% END %]
626                  </p>
627             [% END %]
628             [% IF ( errmsgloo.badbarcode ) %]
629                 <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
630             [% END %]
631             [% IF ( errmsgloo.ispermanent ) %]
632                 <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) | html %]</p>
633             [% END %]
634             [% IF ( errmsgloo.notissued ) %]
635                 <p class="problem">Not checked out.</p>
636             [% END %]
637             [% IF ( errmsgloo.localuse) %]
638                 <p class="problem">Local use recorded</p>
639             [% END %]
640             [% IF ( errmsgloo.waslost ) %]
641                 [% IF Koha.Preference('BlockReturnOfLostItems') %]
642                     <p class="problem">Item is lost, cannot be checked in.</p>
643                 [% ELSE %]
644                     <p class="problem">Item was lost, now found.</p>
645                 [% END %]
646                 [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
647                     <p class="problem">A refund has been applied to the borrowing patron's account.</p>
648                 [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
649                    <h5>Cannot check in</h5>
650                    <p><strong>NOT CHECKED IN</strong></p>
651                 [% ELSE %]
652                     <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
653                 [% END %]
654             [% END %]
655             [% IF ( errmsgloo.withdrawn ) %]
656                 [% IF Koha.Preference('BlockReturnOfWithdrawnItems') %]
657                    <h5>Cannot check in</h5>
658                    <p><strong>NOT CHECKED IN</strong></p>
659                 [% END %]
660                <p class="problem">Item is withdrawn.</p>
661             [% END %]
662             [% IF ( errmsgloo.debarred ) %]
663                 <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>
664             [% END %]
665             [% IF ( errmsgloo.prevdebarred ) %]
666                 <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
667             [% END %]
668             [% IF ( errmsgloo.foreverdebarred ) %]
669                 <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction.</p>
670             [% END %]
671
672             [% IF errmsgloo.data_corrupted %]
673                 <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>
674             [% END %]
675         [% END %]
676     </div>
677 [% END %]
678
679 [% IF ( checkinmsg ) %]
680     [% IF ( checkinmsgtype == 'alert' ) %]
681         <div class="dialog alert">
682     [% ELSE %]
683         <div class="dialog message">
684     [% END %]
685             <p class="problem">[% checkinmsg | html_line_break %]</p>
686         </div>
687 [% END%]
688
689     <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
690         <fieldset id="circ_returns_checkin">
691             <h3>Check in</h3>
692             <div class="row">
693         <div class="col-sm-6">
694             <div class="hint">Enter item barcode:</div>
695                 <div class="form-control-group">
696                     [% IF ( exemptfine ) %]
697                         <input name="barcode" id="barcode" size="14" class="focus input-warning" type="text" />
698                     [% ELSIF ( dropboxmode ) %]
699                         <input name="barcode" id="barcode" size="14" class="barcode focus input-warning" />
700                     [% ELSE %]
701                         <input name="barcode" id="barcode" size="14" class="barcode focus" />
702                     [% END %]
703                     <button type="submit" class="btn btn-default">Check in</button>
704                     [% FOREACH inputloo IN inputloop %]
705                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
706                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
707                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
708                     [% END %]
709                 </div>
710             <div id="show-circ-settings">
711                 <a href="#"><i class="fa circ-settings-icon fa-caret-down"></i> Checkin settings</a>
712             </div>
713         </div>
714         <div class="col-sm-6">
715             [% IF ( exemptfine ) %]
716                 <div id="exemptfines" class="checkin-active-setting">
717             [% ELSE %]
718                 <div id="exemptfines" class="checkin-active-setting" style="display:none;">
719             [% END %]
720                 <p><i class="fa fa-check"></i> Fines for returned items are forgiven.</p>
721             </div>
722
723             [% IF ( forgivemanualholdsexpire ) %]
724                 <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting">
725             [% ELSE %]
726                 <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting" style="display:none;">
727             [% END %]
728                     <p><i class="fa fa-check"></i> Fines are not charged for manually cancelled holds.</p>
729                 </div>
730
731                 [% IF ( dropboxmode ) %]
732                     <div id="dropboxmode" class="checkin-active-setting">
733                 [% ELSE %]
734                     <div id="dropboxmode" class="checkin-active-setting" style="display:none;">
735                 [% END %]
736                     <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>
737                 </div>
738                 [% IF ( return_date_override_remember ) %]
739                     <div id="return_date_remember" class="checkin-active-setting">
740                 [% ELSE %]
741                     <div id="return_date_remember" class="checkin-active-setting" style="display:none;">
742                 [% END %]
743                     <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>
744                 </div>
745             </div>
746         </div>
747
748             <div class="circ-settings">
749             [% IF Koha.Preference('SpecifyReturnDate') %]
750                 <div class="date-select" id="return_date_override_fields">
751                     <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
752
753                     <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" />
754
755
756
757                     <button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button>
758                     <div class="circ-setting">
759                         [% IF ( return_date_override_remember ) %]
760                             <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" />
761                         [% ELSE %]
762                             <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" />
763                         [% END %]
764                         <label for="return_date_override_remember"> Remember due date for next check in</label>
765                     </div>
766             </div>
767         [% END %]
768                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
769                         <div id="forgive-overdue-fines" class="circ-setting">
770                         [% IF ( exemptfine ) %]
771                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
772                         [% ELSE %]
773                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
774                         [% END %]
775                         <label for="exemptcheck">Forgive overdue charges</label>
776                         </div>
777                     [% END %] <!-- overduecharges -->
778                         <div id="book-drop-mode" class="circ-setting">
779                         [% IF ( dropboxmode ) %]
780                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
781                         [% ELSE %]
782                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
783                         [% END %]
784                         <label for="dropboxcheck">Book drop mode</label>
785                         </div>
786                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
787                         <div class="forgive-manual-hold-fees circ-setting">
788                         [% IF ( forgivemanualholdsexpire ) %]
789                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
790                         [% ELSE %]
791                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
792                         [% END %]
793                         <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
794                         </div>
795                     [% END %] <!-- overduecharges -->
796                 </div> <!-- /.circ-settings -->
797             </fieldset> <!-- /#circ_returns_checkin -->
798         </form> <!-- /#checkin-form -->
799
800 [% IF ( riloop ) %]
801     <h2>Checked-in items</h2>
802     <table id="checkedintable">
803     <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>
804
805         [% FOREACH riloo IN riloop %]
806             <tr>
807             <td class="ci-duedate">[% IF ( riloo.duedate ) %]
808                     [% IF ( riloo.return_overdue ) %]
809                         <span class="overdue">[% riloo.duedate | html %] (overdue)</span>
810                     [% ELSE %][% riloo.duedate | html %]
811                     [% END %]
812                 [% ELSE %]Not checked out
813                 [% END %]
814             </td>
815             <td class="ci-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">
816                     [% riloo.itemtitle | html %]
817                 </a>
818                 [% IF ( riloo.enumchron ) %]
819                     <br/>
820                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron | html %]</span>
821                 [% END %]
822             </td>
823             <td class="ci-author">[% riloo.itemauthor | html %]</td>
824             <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>
825             <td class="ci-homelibrary">[% Branches.GetName( riloo.homebranch ) | html %]</td>
826             <td class="ci-holdinglibrary">[% Branches.GetName( riloo.holdingbranch ) | html %]</td>
827             <td class="ci-shelvinglocation"><span class="shelvingloc">[% riloo.location | html %]</span></td>
828             <td class="ci-callnumber">[% riloo.itemcallnumber | html %]</td>
829             <td class="ci-dateaccessioned">[% riloo.dateaccessioned | $KohaDates %]</td>
830             <td class="ci-type">[% ItemTypes.GetDescription( riloo.itemtype ) | html %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) | html %]</td>
831             <td class="ci-patron">[% IF ( riloo.duedate ) %]
832                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">
833                     [% riloo.patron.surname | html %], [% riloo.patron.firstname | html %] ([% riloo.patron.category.description | html %])
834                 </a>
835                 [% IF riloo.borissuescount %]
836                     <span class="results_summary nowrap">
837                         <span class="label">Checkouts:</span>
838                         <span class="number_box">
839                             <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">[% riloo.borissuescount | html %]</a>
840                         </span>
841                     </span>
842                 [% END %]
843             [% ELSE %]Not checked out[% END %]</td>
844             <td class="ci-note">
845                 [% IF ( riloo.patron.borrowernotes ) %]<p><span class="circ-hlt patron-note">[% riloo.patron.borrowernotes | html %]</p></span>[% END %]
846                 [% IF ( riloo.itemnote ) %]<p><span class="circ-hlt item-note-public">[% riloo.itemnote | html %]</p></span>[% END %]
847                 [% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic | html %]</p></span>[% END %]
848             </td>
849            </tr>
850         [% END %]
851     </table>
852 [% END %]
853
854                 [% IF Koha.Preference('CircSidebar') %]
855                         </div> <!-- /.col-sm-10.col-sm-push-2 -->
856                         <div class="col-sm-2 col-sm-pull-10">
857                             <aside>
858                                 [% INCLUDE 'circ-nav.inc' %]
859                             </aside>
860                         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
861                     </div> <!-- /.row -->
862                 [% ELSE %]
863                         </div> <!-- /.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 -->
864                     </div> <!-- /.row -->
865                 [% END %]
866
867             </main>
868         </div> <!-- /.col-sm-12 -->
869     </div> <!-- /.row -->
870
871 [% MACRO jsinclude BLOCK %]
872     [% INCLUDE 'datatables.inc' %]
873     [% INCLUDE 'columns_settings.inc' %]
874     [% INCLUDE 'calendar.inc' %]
875     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
876     [% Asset.js("js/pages/circulation.js") | $raw %]
877     [% INCLUDE 'timepicker.inc' %]
878
879     <script>
880         function Dopop(link) {
881             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
882             $("#barcode").focus();
883         }
884         $(document).ready(function () {
885             $(".modal").modal({ backdrop: 'static' }).on('shown.bs.modal', function() {
886                 $("#barcode").prop("disabled", true);
887             }).on('hidden.bs.modal', function() {
888                 $("#barcode").prop("disabled", false).focus();
889             });
890
891             $(".modal").on('hidden.bs.modal', function (e) { $("#barcode").focus(); });
892
893             $(".print-slip").on('click', function(e) {
894                 e.preventDefault();
895                 Dopop('hold-transfer-slip.pl?borrowernumber=[% patron.borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]');
896             });
897
898             [% IF print_slip %]
899                 Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]&amp;itemnumber=[% itemnumber | html %]');
900             [% END %]
901
902             var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]
903             var returns_table = KohaTable("checkedintable", {
904                     "bFilter":false,
905                     "bPaginate":false,
906                     "bInfo":false,
907                     "bSort":false,
908                     "dom": 'B<"clearfix">t',
909                     }, columns_settings);
910
911             $("#return_date_override").datetimepicker({
912                 onClose: function(dateText, inst) {
913                     if (validate_date(dateText, inst) ) {
914                         $("#barcode").focus();
915                     }
916                 },
917                 defaultDate: -1,
918                 hour: 23,
919                 minute: 59,
920                 maxDate: 0
921             }).on("change", function(e, value) {
922                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
923             });
924             $("#return_date_override").on("blur", function() {
925                 check_valid_return_date();
926             });
927             $("#checkin-form").submit(function( event ) {
928                 if ( !check_valid_return_date() ) {
929                     event.preventDefault();
930                 }
931             });
932
933             function check_valid_return_date() {
934                 if ( $("#return_date_override").val() ) {
935                     var datetime = DateTime_from_syspref( $("#return_date_override").val() );
936                     var now = new Date();
937                     if ( !datetime || datetime > now ) {
938                         alert("Invalid return date/time!");
939                         $("#return_date_override").val("")
940                         return false;
941                     }
942                 }
943                 // Add saved date information to onscreen message, which
944                 // may or may not be hidden
945                 $("#saved_return_date").text( $("#return_date_override").val() );
946                 return true;
947             }
948
949             $("#exemptcheck").change(function () {
950                 if (this.checked == true) {
951                     $("#barcode").addClass("input-warning");
952                     $("#exemptfines").show();
953                 } else {
954                     $("#barcode").removeClass("input-warning");
955                     $("#exemptfines").hide();
956                 }
957                 $("#barcode").focus();
958             });
959             $("#dropboxcheck").change(function () {
960                 if (this.checked == true) {
961                     $("#barcode").addClass("input-warning");
962                     $("#dropboxmode").show();
963
964                     $("#return_date_override_fields :input").prop('disabled', true);
965                     $("#return_date_override").datetimepicker("disable");
966                 } else {
967                     $("#barcode").removeClass("input-warning");
968                     $("#dropboxmode").hide();
969
970                     $("#return_date_override_fields :input").prop('disabled', false);
971                     $("#return_date_override").datetimepicker("enable");
972                 }
973                 $("#barcode").focus();
974             });
975             $("#forgivemanualholdsexpire").change(function () {
976                 if (this.checked == true) {
977                     $("#barcode").addClass("input-warning");
978                     $("#forgivemanualholdsexpire-alert").show();
979                 } else {
980                     $("#barcode").removeClass("input-warning");
981                     $("#forgivemanualholdsexpire-alert").hide();
982                 }
983                 $("#barcode").focus();
984             });
985
986             [% IF(overduecharges) %]
987                 $("#barcode").focus(function () {
988                     if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
989                         $("#barcode").addClass("input-warning");
990                     } else {
991                         $("#barcode").removeClass("input-warning");
992                     }
993                 });
994                 $("#barcode").blur(function () {
995                     $("#barcode").removeClass("input-warning");
996                 });
997             [% END %]
998
999             $('.openWin').on("click",function(e){
1000                 Dopop( $(this).data("url") );
1001             });
1002
1003             $('.print').on("click",function(e){
1004                 this.form.print_slip.value = 1;
1005                 this.form.submit();
1006             });
1007
1008             $('.cancel-hold').on("click",function(e){
1009                 this.form.cancel_reserve.value = 1;
1010                 this.form.submit();
1011             });
1012
1013             $('.action').on("click",function(e){
1014                 this.checked = false;
1015                 this.form.return_date_override.value = '';
1016                 this.form.return_date_override_remember.checked = false;
1017                 this.form.barcode.focus();
1018                 $("#return_date_remember").hide();
1019                 return false;
1020             });
1021
1022             $("#return_date_override_remember").on("change", function(){
1023                 if( $(this).prop("checked" ) ){
1024                     if( $("#return_date_override").val() == "" ){
1025                         $("#saved_return_date").text( _("No date selected") );
1026                     } else {
1027                         $("#saved_return_date").text( $("#return_date_override").val() );
1028                     }
1029                     $("#return_date_remember").show();
1030                 } else {
1031                     $("#return_date_remember").hide();
1032                 }
1033             });
1034         });
1035     </script>
1036 [% END %]
1037
1038 [% INCLUDE 'intranet-bottom.inc' %]