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