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