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