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