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