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