Bug 33806: Retain specified date when confirming item parts at checkin
[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 'i18n.inc' %]
10 [% PROCESS 'member-display-address-style.inc' %]
11 [% SET footerjs = 1 %]
12 [% BLOCK display_bormessagepref %]
13     [% IF ( bormessagepref ) %]
14         <li class="notification_method"><span>Patron notification:</span>
15             [% FOREACH mtt IN bormessagepref.keys %]
16                 [%~ IF ( mtt == 'email' ) %] <span>Email</span>[% END ~%]
17                 [%~ IF ( mtt == 'phone' ) %] <span>Phone</span>[% END ~%]
18                 [%~ IF ( mtt == 'sms' ) %] <span>SMS</span>[% END ~%]
19                 [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
20             [% END %]
21         </li>
22            [% ELSE %]
23         <li class="notification_method none">Patron is not notified.</li>
24     [% END %]
25 [% END %]
26
27 [% BLOCK display_holdpatron_address %]
28     [% PROCESS 'display-address-style' %]
29 [% END %]
30
31 [% INCLUDE 'doc-head-open.inc' %]
32 <title>Check in [% title | html %] &rsaquo; Circulation &rsaquo; Koha</title>
33 [% INCLUDE 'doc-head-close.inc' %]
34 </head>
35
36 <body id="circ_returns" class="circ">
37     <span class="audio-alert-success"></span>
38
39     [% WRAPPER 'header.inc' %]
40         [% INCLUDE 'checkin-search.inc' %]
41     [% END %]
42
43     [% WRAPPER 'sub-header.inc' %]
44         [% WRAPPER breadcrumbs %]
45             [% WRAPPER breadcrumb_item %]
46                 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
47             [% END %]
48             [% WRAPPER breadcrumb_item bc_active= 1 %]
49                 <span>Check in</span>
50             [% END %]
51         [% END #/ WRAPPER breadcrumbs %]
52     [% END #/ WRAPPER sub-header.inc %]
53
54     <div class="main container-fluid">
55         <div class="row">
56             <div class="col-sm-12">
57                 <main>
58                     <div class="row">
59
60                         [% IF Koha.Preference('CircSidebar') %]
61                             <div class="col-sm-10 col-sm-push-2">
62                         [% ELSE %]
63                             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
64                         [% END %]
65
66                         [% BLOCK all_checkin_messages %]
67                             [% IF hold_auto_filled %]
68                                 <div class="dialog message hold-auto-filled">
69                                     [% IF ( reservenotes ) %]
70                                         <h4>Notes: [% reservenotes | html %]</h4>
71                                     [% END %]
72                                     <h3>Hold filled for:</h3>
73                                     <ul>
74                                         <li>
75                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 %]
76                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
77                                         </li>
78
79                                         [% INCLUDE display_holdpatron_address %]
80
81                                         [% IF ( patron.phone ) %]
82                                             <li>[% patron.phone | html %]</li>
83                                         [% END %]
84
85                                         [% IF ( patron.email ) %]
86                                             <li>
87                                                 [% IF ( transfertodo ) %]
88                                                     [% patron.email | html %]
89                                                 [% ELSE %]
90                                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
91                                                 [% END %]
92                                             </li>
93                                         [% END %]
94
95                                         [% UNLESS ( transfertodo) %]
96                                             [% INCLUDE display_bormessagepref %]
97                                         [% END %]
98
99                                         [% IF ( patron.is_debarred ) %]
100                                             <li class="error">Patron is RESTRICTED</li>
101                                         [% END %]
102
103                                         [% IF ( patron.gonenoaddress ) %]
104                                             <li class="error">Patron's address is in doubt</li>
105                                         [% END %]
106                                     </ul>
107
108                                     [% IF ( transfertodo ) %]
109                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
110                                     [% ELSE %]
111                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
112                                     [% END %]
113
114                                     <a href="#" class="btn btn-default print print-slip">
115                                         <i class="fa fa-print"></i> Print
116                                     </a>
117                                 </div> <!-- /.hold-auto-filled -->
118                             [% END # /IF hold_auto_filled %]
119
120                             [% IF ( trigger ) %]
121                                  <div id="transfer-trigger" class="dialog message">
122                                      <h3>Reason for transfer</h3>
123                                      <p>
124                                          [%- SWITCH trigger -%]
125                                              [%- CASE 'Manual' -%]<span>Manual</span>
126                                              [%- CASE 'StockrotationAdvance' -%]<span>Stock rotation advance</span>
127                                              [%- CASE 'StockrotationRepatriation' -%]<span>Stock rotation repatriation</span>
128                                              [%- CASE 'ReturnToHome' -%]<span>Return to home library</span>
129                                              [%- CASE 'ReturnToHolding' -%]<span>Return to holding library</span>
130                                              [%- CASE 'RotatingCollection' -%]<span>Rotating collection</span>
131                                              [%- CASE 'Reserve' -%]<span>Hold</span>
132                                              [%- CASE 'LostReserve' -%]<span>Lost hold</span>
133                                              [%- CASE 'CancelReserve' -%]<span>Cancelled hold</span>
134                                              [%- CASE 'TransferCancellation' -%]<span>Transfer was cancelled whilst in transit</span>
135                                          [%- END -%]
136                                      </p>
137                                  </div>
138                             [% END %]
139
140                             [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
141                                 <div class="dialog alert">
142                                     <strong>Error:</strong>
143                                     This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
144                                 </div>
145                             [% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
146                                 <div class="dialog alert">
147                                     <strong>Error:</strong>
148                                     The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.
149                                 </div>
150                             [% END %]
151
152                             [% IF additional_materials && !needs_confirm && !multiple_confirmed %]
153                                 <div id="materials" class="dialog message">
154                                     Note about the accompanying materials: [% additional_materials | html %]
155                                 </div>
156                             [% END %]
157
158                             [% IF ( collectionItemNeedsTransferred ) %]
159                                  <div id="rotating-collection" class="dialog message">
160                                     <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) | html %]</h3>
161                                     <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% item.barcode | html %]: [% title | html %]</a></p>
162                                     <p>This item is part of a rotating collection.</p>
163                                     <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>
164                                 </div>
165                             [% END %]
166
167                             <!-- Patron has added an issue note -->
168                             [% IF ( issue.note) %]
169                                 <div class="dialog message">
170                                     <h1>Patron note</h1>
171                                     <p>[% issue.notedate | $KohaDates %]</p>
172                                     <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber | uri %]"> [% title | html %]</a> [% author | html %]</p>
173                                     <p>[% issue.note | html %]</p>
174                                 </div>
175                             [% END %]
176
177                             <!-- Patron has fines -->
178                             [% IF ( fines ) %]
179                                 <div class="dialog alert">
180                                     <h3>Patron has outstanding fines of [% fines | html %].</h3>
181                                     <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber | uri %]">Make payment</a>.</p>
182                                 </div>
183                             [% END %]
184
185                             <!-- Item has return claim(s) -->
186                             [% IF ( ReturnClaims ) %]
187                                 <div class="dialog alert return-claim">
188                                     <h3>This item has been claimed as returned by:</h3>
189                                     <ul>
190                                         [% FOREACH rc IN ReturnClaims %]
191                                             <li>
192                                                 [% INCLUDE 'patron-title.inc' patron=rc.patron hide_patron_infos_if_needed=1 invert_name=1 %] <a class="btn btn-default btn-xs return-claim-tools-resolve" role="button" data-return-claim-id="[% rc.id | html %]" data-current-lost-status="0"><i class="fa fa-check-square"></i> Resolve</a>
193                                             </li>
194                                         [% END %]
195                                     </ul>
196                                 </div>
197                             [% END %]
198
199                             <!-- Patron has waiting holds -->
200                             [% IF ( waiting_holds ) %]
201                                 <div id="awaiting-pickup" class="dialog message">
202                                     <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>
203                                     <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber | uri %]">Check out to this patron</a>.</p>
204                                 </div>
205                             [% END %]
206
207                             <!-- Patron is restricted and checkin was backdated -->
208                             [% IF return_date_was_overriden && issue.patron.is_debarred %]
209                                 <div id="restricted_backdated" class="dialog message">
210                                     <h3>
211                                         [% INCLUDE 'patron-title.inc' patron=issue.patron hide_patron_infos_if_needed=1 invert_name=1 %]
212                                         is restricted. Please verify this patron should still be restricted.
213                                     </h3>
214                                 </div>
215                             [% END %]
216
217                             <!-- Bundle has items missing -->
218                             [% IF missing_items %]
219                                 <div id="bundle_missing_items" class="dialog alert">
220                                     <h3>Bundle had missing items</h3>
221                                     <p>Bundle contents list updated</p>
222                                     <p>
223                                         <a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleContentsModal"><i class="fa fa-eye" aria-hidden="true"></i> View updated contents list</a>
224                                         <a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleMissingModal"><i class="fa fa-eye" aria-hidden="true"></i> View list of missing items</a>
225                                     </p>
226                                 </div>
227                             [% END %]
228
229                             <!-- Bundle contained unexpected items -->
230                             [% IF unexpected_items %]
231                                 <div id="bundle_unexpected_items" class="dialog alert">
232                                     <h3>Bundle had unexpected items</h3>
233                                     <p>Please place the following items to one side</p>
234                                     <ul>
235                                     [% FOREACH unexpected_item IN unexpected_items %]
236                                         <li>[% INCLUDE 'biblio-title.inc' biblio=unexpected_item.biblio %] - [% unexpected_item.barcode | html %]</li>
237                                     [% END %]
238                                     </ul>
239                                 </div>
240                             [% END %]
241
242                             <!-- Item checked in outside of bundle -->
243                             [% IF InBundle %]
244                                 <div id="bundle_item_outside" class="dialog alert audio-alert-warning">
245                                     <h3>Item belongs in bundle</h3>
246                                     <p>This item belongs to a bundle: [% INCLUDE 'biblio-title.inc' biblio=InBundle.biblio %] - [% InBundle.barcode | html %]</p>
247                                     <p><button class="btn btn-default btn-xs bundle_remove" role="button" data-itemnumber="[% itemnumber | uri %]" data-hostnumber="[% InBundle.itemnumber | uri %]"><i class="fa fa-minus"></i> Remove from bundle</button></p>
248                                 </div>
249                             [% END %]
250
251                             [% IF ( errmsgloop ) %]
252                                 <div class="dialog alert audio-alert-warning">
253                                     <h3>Check in message</h3>
254                                     [% IF itembiblionumber %]
255                                         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% item.barcode | html %]: [% title | html %]</a></p>
256                                     [% END %]
257                                     [% FOREACH errmsgloo IN errmsgloop %]
258                                         [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
259                                             <p class="problem ret_nflupdate">
260                                             [% IF errmsgloo.NotForLoanStatusUpdated.to == 'ONLYMESSAGE' %]
261                                                 [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) | html %]
262                                             [% ELSE %]
263                                                 Not for loan status updated.
264                                                 <br />Old value:
265                                                 [% IF errmsgloo.NotForLoanStatusUpdated.from %]
266                                                     <span class="ret_updatedfrom">
267                                                         [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => errmsgloo.NotForLoanStatusUpdated.from ) | html %].
268                                                     </span>
269                                                 [% ELSE %]
270                                                     Available for loan.
271                                                 [% END %]
272                                                 <br />New value:
273                                                 [% IF errmsgloo.NotForLoanStatusUpdated.to %]
274                                                     <span class="ret_updatedto">
275                                                         [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => errmsgloo.NotForLoanStatusUpdated.to ) | html %].
276                                                     </span>
277                                                 [% ELSE %]
278                                                     Available for loan.
279                                                 [% END %]
280                                             [% END %]
281                                             </p>
282                                         [% END %]
283                                         [% IF ( errmsgloo.ItemLocationUpdated ) %]
284                                              <p class="problem ret_location_update">
285                                                  Item shelving location updated.
286                                                 <br /><span>Old value:</span>
287                                                 [% IF errmsgloo.ItemLocationUpdated.from %]
288                                                     [% SET av_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => errmsgloo.ItemLocationUpdated.from ) %]
289                                                     [% IF errmsgloo.ItemLocationUpdated.from == '' %]
290                                                         <span>empty</span>
291                                                     [% ELSIF av_description == '' %]
292                                                         [% errmsgloo.ItemLocationUpdated.from | html %] (<span>No description available</span>)
293                                                     [% ELSE %]
294                                                         [% av_description | html %]
295                                                     [% END %]
296                                                 [% ELSE %]
297                                                     <span>"Blank"</span>
298                                                 [% END %]
299                                                 <br />New value:
300                                                 [% IF errmsgloo.ItemLocationUpdated.to %]
301                                                     [% SET av_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => errmsgloo.ItemLocationUpdated.to ) %]
302                                                     [% IF errmsgloo.ItemLocationUpdated.to == '' %]
303                                                         empty
304                                                     [% ELSIF av_description == '' %]
305                                                         [% errmsgloo.ItemLocationUpdated.to | html %] (Not an authorized value)
306                                                     [% ELSE %]
307                                                         [% av_description | html %]
308                                                     [% END %]
309                                                 [% ELSE %]
310                                                     "Blank"
311                                                 [% END %]
312                                              </p>
313                                         [% END %]
314                                         [% IF ( errmsgloo.badbarcode ) %]
315                                             <p class="problem ret_badbarcode">No item with barcode: [% errmsgloo.msg | html %]</p>
316                                         [% END %]
317                                         [% IF ( errmsgloo.ispermanent ) %]
318                                             <p class="problem ret_ispermenant">Please return item to: [% Branches.GetName( errmsgloo.msg ) | html %]</p>
319                                         [% END %]
320                                         [% IF ( errmsgloo.notissued ) %]
321                                             <p class="problem ret_notissued">Not checked out.</p>
322                                         [% END %]
323                                         [% IF ( errmsgloo.localuse) %]
324                                             <p class="problem ret_localuse">Local use recorded</p>
325                                         [% END %]
326                                         [% IF ( errmsgloo.transferred ) %]
327                                             <p class="problem ret_transferred">Item received from [% Branches.GetName( errmsgloo.transferred ) | html %]</p>
328                                         [% END %]
329                                         [% IF ( errmsgloo.waslost ) %]
330                                             [% IF Koha.Preference('BlockReturnOfLostItems') %]
331                                                 <p class="problem ret_blocked">Item is lost, cannot be checked in.</p>
332                                             [% ELSE %]
333                                                 <p class="problem ret_checkedin">Item was lost, now found.</p>
334                                             [% END %]
335                                             [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
336                                                 <p class="problem ret_refund">A refund for the lost item charge has been applied to the borrowing patron's account.</p>
337                                             [% ELSIF LostItemFeeCharged and not Koha.Preference('BlockReturnOfLostItems') %]
338                                                 <p class="problem ret_charged">A refund for the lost item charge has been applied to the borrowing patron's account, and new overdue charge has been calculated and applied.</p>
339                                             [% ELSIF LostItemFeeRestored and not Koha.Preference('BlockReturnOfLostItems') %]
340                                                 <p class="problem ret_restored">A refund for the lost item charge has been applied to the borrowing patron's account and if an overdue fine was forgiven when the item was marked as lost, it has been reverted.</p>
341                                             [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
342                                                <h5>Cannot check in</h5>
343                                                <p><strong>NOT CHECKED IN</strong></p>
344                                             [% ELSE %]
345                                                 <p class="problem ret_feeremains">Any lost item fees for this item will remain on the patron's account.</p>
346                                             [% END %]
347                                             [% IF ProcessingFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
348                                                 <p class="problem ret_refund">A refund for the lost item processing charge has been applied to the borrowing patron's account.</p>
349                                             [% ELSE %]
350                                                 <p class="problem ret_feeremains">Any processing fees for this item will remain on the patron's account.</p>
351                                             [% END %]
352                                         [% END %]
353                                         [% IF ( errmsgloo.withdrawn ) %]
354                                             [% IF Koha.Preference('BlockReturnOfWithdrawnItems') %]
355                                                <h5>Cannot check in</h5>
356                                                <p><strong>NOT CHECKED IN</strong></p>
357                                             [% END %]
358                                            <p class="problem ret_withdrawn">
359                                                <span>Item has been withdrawn</span>
360                                                [% item_withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
361                                                [% IF (item_withdrawn_lib) %]<span class="ci-withdrawn">([% item_withdrawn_lib | html %])</span>[% END %]
362                                            </p>
363                                         [% END %]
364                                         [% IF ( errmsgloo.debarred ) %]
365                                             <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>
366                                         [% END %]
367                                         [% IF ( errmsgloo.prevdebarred ) %]
368                                             <p class="problem ret_prevdebarred"><strong>Reminder: </strong>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
369                                         [% END %]
370                                         [% IF ( errmsgloo.foreverdebarred ) %]
371                                             <p class="problem ret_foreverdebarred"><strong>Reminder: </strong>Patron has an indefinite restriction.</p>
372                                         [% END %]
373                                         [% IF errmsgloo.data_corrupted %]
374                                             <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 correct all errors shown on the "System information" tab</p>
375                                         [% END %]
376                                     [% END # /FOREACH errmsgloo %]
377                                 </div> <!-- /.dialog.dialog-alert -->
378                             [% END #/IF errmsgloop %]
379
380                             [% IF ( checkinmsg ) %]
381                                 [% IF ( checkinmsgtype == 'alert' ) %]
382                                     <div class="dialog alert">
383                                 [% ELSE %]
384                                     <div class="dialog message">
385                                 [% END %]
386                                         <p class="ret_checkinmsg">[% checkinmsg | html_line_break %]</p>
387                                     </div>
388                             [% END # /IF checkinmsg %]
389
390                             [% IF bundle_items && !missing_items %]
391                                 <div class="dialog message">
392                                     <h3>Bundle verified</h3>
393                                     <p>The bundle content was verified</p>
394                                     <p><a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleContentsModal"><i class="fa fa-eye" aria-hidden="true"></i> View contents list</a></p>
395                                 </div>
396                             [% END %]
397                         [% END # /BLOCK all_checkin_messages %]
398
399                         [% IF needs_confirm %]
400                             <div id="circ-needsconfirmation-modal" class="modal fade audio-alert-action block">
401                                 <div class="modal-dialog">
402                                     <div class="modal-content">
403                                         <div class="modal-header">
404                                             <h3>Please confirm checkin</h3>
405                                         </div>
406                                         <div class="modal-body">
407                                             <ul>
408                                                 <li>
409                                                     Please confirm that the accompanying materials are present: <strong>[% additional_materials | html %]</strong>
410                                                 </li>
411                                             </ul>
412                                         </div>
413                                         <div class="modal-footer">
414                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
415                                                 <input type="hidden" name="barcode" value="[% item.barcode | html %]" />
416                                                 <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
417                                                 <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
418                                                 <input type="hidden" name="multiple_confirm" value="1" />
419                                                 <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
420                                                 [% FOREACH inputloo IN inputloop %]
421                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
422                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
423                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
424                                                 [% END %]
425                                                 <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, checkin (Y)</button>
426                                             </form>
427                                             <button type="button" data-dismiss="modal" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't checkin (N)</button>
428                                         </div>
429                                     </div>
430                                 </div>
431                             </div>
432                         [% END %]
433
434                         [% IF items_bundle_return_confirmation %]
435                         <div id="bundle-needsconfirmation-modal" class="modal fade audio-alert-action block">
436                             <div class="modal-dialog modal-wide">
437                                 <div class="modal-content">
438                                     <form method="post">
439                                         <div class="modal-header">
440                                             <h3>Please confirm bundle contents for [% item.barcode | html %]</h3>
441                                         </div>
442                                         <div class="modal-body">
443
444                                             <table class="table table-condensed table-bordered" id="items-bundle-contents-table">
445                                                 <thead>
446                                                     <tr>
447                                                         <th>Title</th>
448                                                         <th>Author</th>
449                                                         <th>Item type</th>
450                                                         <th>Barcode</th>
451                                                         [% IF !item.onloan %]
452                                                         <th>Status</th>
453                                                         [% END %]
454                                                     </tr>
455                                                 </thead>
456                                                 <tbody>
457                                                     [% FOREACH bundle_item IN item.bundle_items %]
458                                                     [% IF !item.onloan %]
459                                                     <tr data-barcode="[% bundle_item.barcode | html %]">
460                                                         <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio link = 1 %]</td>
461                                                         <td>[% bundle_item.biblio.author | html %]</td>
462                                                         <td>[% ItemTypes.GetDescription(bundle_item.itype) | html %]</td>
463                                                         <td>[% bundle_item.barcode | html %]</td>
464                                                         <td>
465                                                             [% IF bundle_item.itemlost %]
466                                                                 [% itemlost_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.itemlost', authorised_value = bundle_item.itemlost }) %]
467                                                                 <span class="lost">[% itemlost_description | html %]</span>
468                                                             [% ELSE %]
469                                                                 Present
470                                                             [% END %]
471                                                         </td>
472                                                     </tr>
473                                                     [% ELSIF !bundle_item.itemlost %]
474                                                     <tr data-barcode="[% bundle_item.barcode | html %]">
475                                                         <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio link = 1 %]</td>
476                                                         <td>[% bundle_item.biblio.author | html %]</td>
477                                                         <td>[% ItemTypes.GetDescription(bundle_item.itype) | html %]</td>
478                                                         <td>[% bundle_item.barcode | html %]</td>
479                                                     </tr>
480                                                     [% END %]
481                                                     [% END %]
482                                                 </tbody>
483                                             </table>
484
485                                             <div class="form-group">
486                                                 <label for="verify-items-bundle-contents-barcodes">Barcodes <span id="verify-progress" class="pull-right" style="display: none"><span id="verified">0</span> of <span id="expected"></span> verified</span></label>
487                                                 <textarea autocomplete="off" id="verify-items-bundle-contents-barcodes" name="verify-items-bundle-contents-barcodes" class="form-control"></textarea>
488                                                 [% IF item.onloan %]
489                                                 <div class="help-block">Scan all barcodes of items found in the items bundle. If any items are missing, they will be marked as lost</div>
490                                                 [% ELSE %]
491                                                 <div class="help-block">Optionally scan all barcodes of items found in the items bundle to perform an inventory check. If any items are missing, they will be marked as lost</div>
492                                                 [% END %]
493                                             </div>
494
495                                             <div id="bundle-feedback" class="alert" style="display:none"></div>
496
497                                         </div>
498                                         <div class="modal-footer">
499                                             <input type="hidden" name="barcode" value="[% item.barcode | html %]">
500                                             <input type="hidden" name="confirm_items_bundle_return" value="1">
501                                             [% FOREACH inputloo IN inputloop %]
502                                             <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
503                                             <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
504                                             <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
505                                             [% END %]
506                                             [% IF item.onloan %]
507                                             <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> Confirm checkin and mark missing items as lost</button>
508                                             <button type="submit" class="btn btn-default" name="do_not_verify_items_bundle_contents" value="1"><i class="fa fa-check"></i> Confirm checkin without verifying bundle contents</button>
509                                             [% ELSE %]
510                                             <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> Confirm inventory check and mark items as lost</button>
511                                             [% END %]
512                                             <button type="button" data-dismiss="modal" class="btn btn-default"><i class="fa fa-close"></i> Cancel</button>
513                                         </div>
514                                     </form>
515                                 </div>
516                             </div>
517                         </div>
518                         [% END %]
519
520                         [% IF wrongbranch %]
521                             <div id="wrong-branch-modal" class="modal fade audio-alert-action block">
522                                 <div class="modal-dialog">
523                                     <div class="modal-content">
524                                         <form method="post" action="returns.pl" name="mainform" id="mainform">
525                                             <div class="modal-header">
526                                                 <h3>
527                                                     Cannot check in
528                                                 </h3>
529                                             </div>
530                                             <div class="modal-body">
531                                                 <p>
532                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
533                                                         [% item.barcode | html %]: [% title | html %]
534                                                     </a>
535                                                 </p>
536                                                 <p>
537                                                     <strong>
538                                                         NOT CHECKED IN
539                                                     </strong>
540                                                 </p>
541                                                 <p>
542                                                     This item must be checked in at following library:
543                                                     <strong>
544                                                         [% Branches.GetName( rightbranch ) | html %]
545                                                     </strong>
546                                                 </p>
547                                                 [% INCLUDE all_checkin_messages %]
548                                             </div> <!-- /.modal-body -->
549                                             <div class="modal-footer">
550                                                 <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
551                                             </div>
552                                         </form> <!-- /#mainform -->
553                                     </div> <!-- /.modal-content -->
554                                 </div> <!-- /.modal-dialog -->
555                             </div> <!-- /#wrong-branch-modal -->
556                         [% END # /IF wrongbranch %]
557
558                         <!-- case of a mistake in transfer loop -->
559                         [% UNLESS ( hold_auto_filled && diffbranch ) %]
560                             [% IF WrongTransfer && !transfertodo %]
561                                 [% IF Koha.Preference('TransfersBlockCirc') %]
562                                     <div id="wrong-transfer-modal" class="modal fade audio-alert-action block">
563                                 [% ELSE %]
564                                     <div id="wrong-transfer-modal" class="modal fade audio-alert-action noblock">
565                                 [% END %]
566                                     <div class="modal-dialog">
567                                         <div class="modal-content">
568                                             <form method="post" action="returns.pl" name="wrongtransferform" id="wrongtransferform">
569                                                 <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
570                                                 <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
571                                                 <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
572                                                 <input type="hidden" name="transit" value="[% NewTransfer | html %]" />
573                                                 [% FOREACH inputloo IN inputloop %]
574                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
575                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
576                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
577                                                 [% END %]
578
579                                                 <div class="modal-header">
580                                                     <h3>
581                                                         Wrong transfer detected, please return item to: [% Branches.GetName( TransferWaitingAt ) | html %]
582                                                     </h3>
583                                                 </div>
584
585                                                 <div class="modal-body">
586                                                     <p>
587                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% item.barcode | html %]: [% title | html %]</a>
588                                                     </p>
589
590                                                     [% INCLUDE all_checkin_messages %]
591                                                 </div>
592
593                                                 <div class="modal-footer">
594                                                     <!-- CONFIRM -->
595                                                     <button class="btn btn-default approve" type="submit" accesskey="y"><i class="fa fa-check"></i> OK (Y)</button>
596                                                     <!-- PRINT SLIP -->
597                                                     <button type="button" data-dismiss="modal" class="btn btn-default submit openWin" data-transfer="[% NewTransfer | html %]" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;&amp;branchcode=[% TransferWaitingAt | uri %]&amp;op=slip" accesskey="p"><i class="fa fa-print"></i> Print transfer slip (P)</button>
598                                                     <!-- CANCEL TRANSFER -->
599                                                     <button type="button" data-dismiss="modal" class="btn btn-default deny cancel" accesskey="x"><i class="fa fa-times"></i> Cancel transfer (X)</button>
600                                                 </div> <!-- /.modal-footer -->
601                                             </form> <!-- /wrongtransferform -->
602                                         </div> <!-- /.modal-content -->
603                                     </div> <!-- /.modal-dialog -->
604                                 </div> <!-- /#wrong-transfer-modal -->
605                             [% END # /IF WrongTransfer && !transfertodo %]
606                         [% END # /UNLESS hold_auto_filled && diffbranch %]
607
608                         [% IF ( found ) %]
609                             [% IF ( waiting ) %]
610                                 <div id="hold-found1" class="modal fade audio-alert-action block">
611                                     <div class="modal-dialog">
612                                         <div class="modal-content">
613                                             <form method="post" action="returns.pl" class="confirm">
614                                                 <div class="modal-header">
615                                                     <h3>
616                                                         Hold found (item is already waiting):
617                                                         <br/>
618                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
619                                                         <div class="hold-found-barcode">
620                                                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>
621                                                         </div>
622                                                     </h3>
623                                                 </div>
624
625                                                 <div class="modal-body">
626                                                     [% IF ( reservenotes ) %]
627                                                         <h4>Notes: [% reservenotes | html %]</h4>
628                                                     [% END %]
629
630                                                     <h4>Hold for:</h4>
631                                                     <ul>
632                                                         <li>
633                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
634                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
635                                                         </li>
636                                                         [% INCLUDE display_holdpatron_address %]
637                                                         [% IF ( patron.phone ) %]
638                                                             <li> [% patron.phone | html %]</li>
639                                                         [% END %]
640
641                                                         [% IF ( patron.email ) %]
642                                                             <li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li>
643                                                         [% END %]
644
645                                                         [% IF ( patron.is_debarred ) %]
646                                                             <li class="error">Patron is RESTRICTED</li>
647                                                         [% END %]
648
649                                                         [% IF ( patron.gonenoaddress ) %]
650                                                             <li class="error">Patron's address is in doubt</li>
651                                                         [% END %]
652                                                     </ul>
653
654                                                     [% IF ( transfertodo ) %]
655                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
656                                                     [% ELSE %]
657                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
658                                                     [% END %]
659
660                                                     [% FOREACH inputloo IN inputloop %]
661                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
662                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
663                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
664                                                     [% END %]
665
666                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
667                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
668                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
669                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
670                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
671                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
672                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
673                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
674
675                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
676                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
677                                                     [% INCLUDE all_checkin_messages %]
678                                                 </div> <!-- /.modal-body -->
679
680                                                 <div class="modal-footer">
681                                                     <input type="hidden" name="cancel_reserve" value="0" />
682                                                     <input id="confirm-hold-barcode" type="hidden" name="barcode" value="[% barcode | html %]" />
683
684                                                     <button type="submit" class="btn btn-default approve" data-dismiss="modal" accesskey="y">
685                                                         <i class="fa fa-check"></i> Confirm hold (Y)
686                                                     </button>
687
688                                                     <input type="hidden" name="print_slip" value="0" />
689                                                     <button type="button" class="btn btn-default print" accesskey="P">
690                                                         <i class="fa fa-print"></i> Print slip and confirm (P)
691                                                     </button>
692                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default" accesskey="I">
693                                                         <i class="fa fa-remove"></i> Ignore (I)
694                                                     </button>
695
696                                                     <button type="button" class="btn btn-default deny cancel-hold" accesskey="X">
697                                                         <i class="fa fa-trash"></i> Cancel hold (X)
698                                                     </button>
699                                                 </div> <!-- /.modal-footer -->
700                                             </form> <!-- /.confirm -->
701                                         </div> <!-- /.modal-content -->
702                                     </div> <!-- /.modal-dialog -->
703                                 </div> <!-- /#hold-found1 -->
704                             [% END # /IF waiting %]
705
706                             [% IF transfer || needstransfer %]
707                                 [% IF Koha.Preference('TransfersBlockCirc') %]
708                                     <div id="item-transfer-modal" class="modal fade audio-alert-action block">
709                                 [% ELSE %]
710                                     <div id="item-transfer-modal" class="modal fade audio-alert-action noblock">
711                                 [% END %]
712                                     <div class="modal-dialog">
713                                         <div class="modal-content">
714                                             <form method="post" action="returns.pl" name="mainform" id="mainform">
715
716                                                 <input type="hidden" name="print_slip" value="0" />
717
718                                                 <div class="modal-header">
719                                                     <h3>
720                                                         Please return this item to [% IF transfer %][% Branches.GetName( transfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
721                                                     </h3>
722                                                 </div>
723                                                 <div class="modal-body">
724                                                     <p>
725                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
726                                                             [% item.barcode | html %]: [% title | html %]
727                                                         </a>
728                                                     </p>
729                                                     [% IF !transfer %]
730                                                         <p>
731                                                             Transfer now?
732                                                         </p>
733                                                     [% END %]
734                                                     <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
735                                                     <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
736                                                     <input type="hidden" name="barcode" value="0" />
737                                                     <input type="hidden" name="trigger" value="[% trigger | html %]" />
738                                                     [% INCLUDE all_checkin_messages %]
739                                                 </div>
740                                                 <div class="modal-footer">
741                                                     [% IF !transfer %]
742                                                         <button type="submit" name="dotransfer" value="Yes" class="btn btn-default approve" accesskey="y"><i class="fa fa-check"></i> Yes (Y)</button>
743                                                         <button type="button" name="dotransfer" 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>
744                                                         <button type="button" data-dismiss="modal" class="btn btn-default deny" name="notransfer" value="No" accesskey="n"><i class="fa fa-times"></i> No (N)</button>
745                                                     [% ELSE %]
746                                                         <button type="button" data-dismiss="modal" class="btn btn-default approve" accesskey="y"><i class="fa fa-check"></i> OK (Y)</button>
747                                                         <button type="button" data-dismiss="modal" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;branchcode=[% transfer | uri %]&amp;op=slip" accesskey="p"><i class="fa fa-print"></i> Print slip (P)</button>
748                                                     [% END %]
749                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
750                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
751                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
752                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
753                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
754                                                     [% FOREACH inputloo IN inputloop %]
755                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
756                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
757                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
758                                                     [% END %]
759                                                 </div> <!-- /.modal-footer -->
760                                             </form> <!-- /#mainform -->
761                                         </div> <!-- /.modal-content -->
762                                     </div> <!-- /.modal-dialog -->
763                                 </div> <!-- /#item-transfer-modal -->
764                             [% END # /IF transfer || needstransfer %]
765
766                             <!-- case of simple return no issue or transfer but with a hold  -->
767                             [% IF ( reserved and !recalled and !waitingrecall ) %]
768                                 <!-- reserved -->
769                                 <div id="hold-found2" class="modal fade audio-alert-action block">
770                                     <div class="modal-dialog">
771                                         <div class="modal-content">
772                                             <form method="post" action="returns.pl" class="confirm">
773
774                                                 <input type="hidden" name="print_slip" value="0" />
775
776                                                 <div class="modal-header">
777                                                     <h3>
778                                                         Hold found:
779                                                         <br/>
780                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
781                                                         <div class="hold-found-barcode">
782                                                             (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>)
783                                                         </div>
784                                                     </h3>
785                                                 </div>
786
787                                                 <div class="modal-body">
788                                                     [% IF ( reservenotes ) %]
789                                                         <h4>Notes:</h4>
790                                                         <p>[% reservenotes | html %]</p>
791                                                         <hr />
792                                                     [% END %]
793                                                     <h5>Hold for:</h5>
794                                                     <ul>
795                                                         <li>
796                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
797                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
798                                                         </li>
799
800                                                         [% INCLUDE display_holdpatron_address %]
801
802                                                         [% IF ( patron.phone ) %]
803                                                             <li>[% patron.phone | html %]</li>
804                                                         [% END %]
805
806                                                         [% IF ( patron.email ) %]
807                                                             <li>
808                                                                 [% IF ( transfertodo ) %]
809                                                                     [% patron.email | html %]
810                                                                 [% ELSE %]
811                                                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
812                                                                 [% END %]
813                                                             </li>
814                                                         [% END %]
815
816                                                         [% UNLESS ( transfertodo) %]
817                                                             [% INCLUDE display_bormessagepref %]
818                                                         [% END %]
819
820                                                         [% IF ( patron.is_debarred ) %]
821                                                             <li class="error">Patron is RESTRICTED</li>
822                                                         [% END %]
823
824                                                         [% IF ( patron.gonenoaddress ) %]
825                                                             <li class="error">Patron's address is in doubt</li>
826                                                         [% END %]
827                                                     </ul>
828                                                     [% IF ( transfertodo ) %]
829                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
830                                                     [% ELSE %]
831                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
832                                                     [% END %]
833
834                                                     [% FOREACH inputloo IN inputloop %]
835                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
836                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
837                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
838                                                     [% END %]
839
840                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
841                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
842                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
843                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
844                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
845                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
846                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
847                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
848                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
849                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
850                                                     [% INCLUDE all_checkin_messages %]
851                                                 </div>
852
853                                                 <div class="modal-footer">
854                                                     [% IF ( transfertodo ) %]
855                                                         <button type="submit" class="btn btn-default approve" accesskey="y">
856                                                             <i class="fa fa-check"></i> Confirm hold and transfer (Y)
857                                                         </button>
858                                                         <button type="button" class="btn btn-default print" accesskey="p">
859                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm (P)
860                                                         </button>
861                                                     [% ELSE %]
862                                                         <button type="submit" class="btn btn-default approve" accesskey="y">
863                                                             <i class="fa fa-check"></i> Confirm hold (Y)
864                                                         </button>
865                                                         <button type="button" class="btn btn-default print" accesskey="p">
866                                                             <i class="fa fa-print"></i> Print slip and confirm (P)
867                                                         </button>
868                                                     [% END %]
869
870                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny" accesskey="i">
871                                                         <i class="fa fa-remove"></i> Ignore (I)
872                                                     </button>
873                                                 </div> <!-- /.modal-footer -->
874                                             </form> <!-- /.confirm -->
875                                         </div> <!-- /.modal-content -->
876                                     </div> <!-- /.modal-dialog -->
877                                 </div> <!-- /#hold-found2 -->
878                             [% END #/IF reserved %]
879
880                             [% IF ( recalled ) %]
881                                 <!-- recalled -->
882                                 <div id="recalled" class="modal fade audio-alert-action block">
883                                     <div class="modal-dialog">
884                                         <div class="modal-content">
885                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
886
887                                                 <div class="modal-header">
888                                                     <h3>
889                                                         Recall found:
890                                                         <br/>
891                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
892                                                         [% IF recall.item %]
893                                                             <div class="recall-found-barcode">
894                                                                 (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
895                                                             </div>
896                                                         [% END %]
897                                                     </h3>
898                                                 </div>
899
900                                                 <div class="modal-body">
901                                                     [% IF ( recall.notes ) %]
902                                                         <h4>Notes:</h4>
903                                                         <p>[% recall.notes | html %]</p>
904                                                         <hr />
905                                                     [% END %]
906                                                     <h5>Recall placed by:</h5>
907                                                     <ul>
908                                                         <li>
909                                                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_recalls" %]
910                                                             <span class="patron-category"> - [% recall.patron.category.description | html %]</span>
911                                                         </li>
912
913                                                         [% INCLUDE display_holdpatron_address patron=recall.patron %]
914
915                                                         [% IF ( recall.patron.phone ) %]
916                                                             <li>[% recall.patron.phone | html %]</li>
917                                                         [% END %]
918
919                                                         [% IF ( recall.patron.email ) %]
920                                                             <li>
921                                                                 [% IF ( transfertodo ) %]
922                                                                     [% recall.patron.email | html %]
923                                                                 [% ELSE %]
924                                                                     <a id="boremail" href="mailto:[% recall.patron.email | html %]">[% recall.patron.email | html %]</a>
925                                                                 [% END %]
926                                                             </li>
927                                                         [% END %]
928
929                                                         [% UNLESS ( transfertodo) %]
930                                                             [% INCLUDE display_bormessagepref %]
931                                                         [% END %]
932
933                                                         [% IF ( recall.patron.is_debarred ) %]
934                                                             <li class="error">Patron is RESTRICTED</li>
935                                                         [% END %]
936
937                                                         [% IF ( recall.patron.gonenoaddress ) %]
938                                                             <li class="error">Patron's address is in doubt</li>
939                                                         [% END %]
940                                                     </ul>
941                                                     [% IF ( transfertodo ) %]
942                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
943                                                     [% ELSE %]
944                                                         <h4><strong>Recall at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
945                                                     [% END %]
946
947                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
948                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
949                                                     <input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
950                                                     <input type="hidden" name="recall_slip" value="0">
951
952                                                 </div>
953
954                                                 <div class="modal-footer">
955                                                     [% IF ( transfertodo ) %]
956                                                         <button type="submit" class="btn btn-default approve" accesskey="Y">
957                                                             <i class="fa fa-check"></i> Confirm recall and transfer (Y)
958                                                         </button>
959                                                         <button type="button" class="btn btn-default print-recall" accesskey="P">
960                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm (P)
961                                                         </button>
962                                                     [% ELSE %]
963                                                         <button type="submit" class="btn btn-default approve" accesskey="Y">
964                                                             <i class="fa fa-check"></i> Confirm recall (Y)
965                                                         </button>
966                                                         <button type="button" class="btn btn-default print-recall" accesskey="P">
967                                                             <i class="fa fa-print"></i> Print slip and confirm (P)
968                                                         </button>
969                                                     [% END %]
970
971                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default">
972                                                         <i class="fa fa-remove"></i> Ignore
973                                                     </button>
974                                                 </div> <!-- /.modal-footer -->
975                                             </form> <!-- /.confirm -->
976                                         </div> <!-- /.modal-content -->
977                                     </div> <!-- /.modal-dialog -->
978                                 </div> <!-- /#recalled -->
979                             [% END #/IF recalled %]
980
981                             [% IF ( waitingrecall ) %]
982                                 <!-- recalled -->
983                                 <div id="recalledwaiting" class="modal fade audio-alert-action block">
984                                     <div class="modal-dialog">
985                                         <div class="modal-content">
986                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
987
988                                                 <div class="modal-header">
989                                                     <h3>
990                                                         Recall found (item is already waiting):
991                                                         <br/>
992                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
993                                                         [% IF recall.item %]
994                                                             <div class="recall-found-barcode">
995                                                                 (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
996                                                             </div>
997                                                         [% END %]
998                                                     </h3>
999                                                 </div>
1000
1001                                                 <div class="modal-body">
1002                                                     [% IF ( recall.notes ) %]
1003                                                         <h4>Notes:</h4>
1004                                                         <p>[% recall.notes | html %]</p>
1005                                                         <hr />
1006                                                     [% END %]
1007                                                     <h5>Recall placed by:</h5>
1008                                                     <ul>
1009                                                         <li>
1010                                                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_recalls" %]
1011                                                             <span class="patron-category"> - [% recall.patron.category.description | html %]</span>
1012                                                         </li>
1013
1014                                                         [% INCLUDE display_holdpatron_address patron=recall.patron %]
1015
1016                                                         [% IF ( recall.patron.phone ) %]
1017                                                             <li>[% recall.patron.phone | html %]</li>
1018                                                         [% END %]
1019
1020                                                         [% IF ( recall.patron.email ) %]
1021                                                             <li>
1022                                                                 [% IF ( transfertodo ) %]
1023                                                                     [% recall.patron.email | html %]
1024                                                                 [% ELSE %]
1025                                                                     <a id="boremail" href="mailto:[% recall.patron.email | html %]">[% recall.patron.email | html %]</a>
1026                                                                 [% END %]
1027                                                             </li>
1028                                                         [% END %]
1029
1030                                                         [% UNLESS ( transfertodo) %]
1031                                                             [% INCLUDE display_bormessagepref %]
1032                                                         [% END %]
1033
1034                                                         [% IF ( recall.patron.is_debarred ) %]
1035                                                             <li class="error">Patron is RESTRICTED</li>
1036                                                         [% END %]
1037
1038                                                         [% IF ( recall.patron.gonenoaddress ) %]
1039                                                             <li class="error">Patron's address is in doubt</li>
1040                                                         [% END %]
1041                                                     </ul>
1042                                                     [% IF ( transfertodo ) %]
1043                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
1044                                                     [% ELSE %]
1045                                                         <h4><strong>Wait for pickup at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
1046                                                     [% END %]
1047
1048                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
1049                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
1050                                                     <input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
1051                                                     <input type="hidden" name="recall_slip" value="0">
1052
1053                                                 </div>
1054
1055                                                 <div class="modal-footer">
1056                                                     <button type="submit" class="btn btn-default approve" accesskey="Y">
1057                                                         <i class="fa fa-check"></i> Confirm recall (Y)
1058                                                     </button>
1059                                                     <button type="button" class="btn btn-default print-recall" accesskey="P">
1060                                                         <i class="fa fa-print"></i> Print slip and confirm (P)
1061                                                     </button>
1062
1063                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny" accesskey="I">
1064                                                         <i class="fa fa-remove"></i> Ignore (I)
1065                                                     </button>
1066                                                 </div> <!-- /.modal-footer -->
1067                                             </form> <!-- /.confirm -->
1068                                         </div> <!-- /.modal-content -->
1069                                     </div> <!-- /.modal-dialog -->
1070                                 </div> <!-- /#recalledwaiting-->
1071                             [% END #/IF recalledwaiting %]
1072                         [% END # /IF found %]
1073
1074                         <div class="static_checkin_messages">
1075                             [% INCLUDE all_checkin_messages %]
1076                         </div>
1077
1078                         <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
1079                             <fieldset id="circ_returns_checkin">
1080                                 <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>
1081                                 <h1>Check in</h1>
1082                                 <div class="row">
1083                                     <div class="col-sm-6">
1084                                             <div class="form-control-group">
1085                                                 [% IF ( exemptfine ) %]
1086                                                     <input name="barcode" id="barcode" size="14" placeholder="Enter item barcode" class="focus input-warning" type="text" />
1087                                                 [% ELSIF ( dropboxmode ) %]
1088                                                     <input name="barcode" id="barcode" size="14" placeholder="Enter item barcode" class="barcode focus input-warning" />
1089                                                 [% ELSE %]
1090                                                     <input name="barcode" id="barcode" size="14" placeholder="Enter item barcode" class="barcode focus" />
1091                                                 [% END %]
1092
1093                                                 <div id="show-circ-settings">
1094                                                     <a href="#" title="Checkin settings"><i class="fa fa-sliders"></i></a>
1095                                                 </div>
1096
1097                                                 <button type="submit" class="btn btn-primary">Check in</button>
1098                                                 [% FOREACH inputloo IN inputloop %]
1099                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
1100                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
1101                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
1102                                                 [% END %]
1103                                             </div>
1104                                     </div>
1105                                     <div class="col-sm-6">
1106                                         [% IF ( exemptfine ) %]
1107                                             <div id="exemptfines" class="checkin-active-setting">
1108                                         [% ELSE %]
1109                                             <div id="exemptfines" class="checkin-active-setting" style="display:none;">
1110                                         [% END %]
1111                                             <p><i class="fa fa-check"></i> Fines for returned items are forgiven.</p>
1112                                         </div>
1113
1114                                         [% IF ( forgivemanualholdsexpire ) %]
1115                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting">
1116                                         [% ELSE %]
1117                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting" style="display:none;">
1118                                         [% END %]
1119                                                 <p><i class="fa fa-check"></i> Fines are not charged for manually cancelled holds.</p>
1120                                             </div>
1121
1122                                         [% IF ( dropboxmode ) %]
1123                                             <div id="dropboxmode" class="checkin-active-setting">
1124                                         [% ELSE %]
1125                                             <div id="dropboxmode" class="checkin-active-setting" style="display:none;">
1126                                         [% END %]
1127                                             <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>
1128                                         </div>
1129                                         [% IF ( return_date_override_remember ) %]
1130                                             <div id="return_date_remember" class="checkin-active-setting">
1131                                         [% ELSE %]
1132                                             <div id="return_date_remember" class="checkin-active-setting" style="display:none;">
1133                                         [% END %]
1134                                             <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>
1135                                         </div>
1136                                     </div>
1137                                 </div>
1138
1139                                 <div class="circ-settings">
1140                                     [% IF Koha.Preference('SpecifyReturnDate') %]
1141                                         <div class="date-select" id="return_date_override_fields">
1142                                             <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
1143
1144                                             <input type="text" size="20" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" class="flatpickr" data-flatpickr-pastinclusive="true" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
1145
1146                                             <div class="circ-setting">
1147                                                 [% IF ( return_date_override_remember ) %]
1148                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" />
1149                                                 [% ELSE %]
1150                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" />
1151                                                 [% END %]
1152                                                 <label for="return_date_override_remember"> Remember return date for next check in</label>
1153                                             </div>
1154                                         </div> <!-- /.date-select -->
1155                                     [% END %]
1156
1157                                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
1158                                         <div id="forgive-overdue-fines" class="circ-setting">
1159                                             [% IF ( exemptfine ) %]
1160                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
1161                                             [% ELSE %]
1162                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
1163                                             [% END %]
1164                                             <label for="exemptcheck">Forgive overdue charges</label>
1165                                         </div>
1166                                     [% END %] <!-- overduecharges -->
1167
1168                                     <div id="book-drop-mode" class="circ-setting">
1169                                         [% IF ( dropboxmode ) %]
1170                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
1171                                         [% ELSE %]
1172                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
1173                                         [% END %]
1174                                         <label for="dropboxcheck">Book drop mode</label>
1175                                     </div>
1176
1177                                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
1178                                         <div class="forgive-manual-hold-fees circ-setting">
1179                                             [% IF ( forgivemanualholdsexpire ) %]
1180                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
1181                                             [% ELSE %]
1182                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
1183                                             [% END %]
1184                                             <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
1185                                         </div>
1186                                     [% END %] <!-- overduecharges -->
1187
1188                                 </div> <!-- /.circ-settings -->
1189                             </fieldset> <!-- /#circ_returns_checkin -->
1190                         </form> <!-- /#checkin-form -->
1191
1192                         [% IF ( riloop ) %]
1193                             <div class="page-section">
1194                                 <h2>Checked-in items</h2>
1195                                 <table id="checkedintable">
1196                                     <thead>
1197                                         <tr>
1198                                             <th class="ci-duedate">Due date</th>
1199                                             <th class="ci-title">Title</th>
1200                                             <th class="ci-author">Author</th>
1201                                             <th class="ci-barcode">Barcode</th>
1202                                             <th class="ci-homelibrary">Home library</th>
1203                                             <th class="ci-transferlibrary">Transfer to</th>
1204                                             <th class="ci-shelvinglocation">Shelving location</th>
1205                                             <th class="ci-callnumber">Call number</th>
1206                                             <th class="ci-dateaccessioned">Date acquired</th>
1207                                             <th class="ci-recordlevelitemtype">Record-level itemtype</th>
1208                                             <th class="ci-itemtype">Item type</th>
1209                                             <th class="ci-collection">Collection</th>
1210                                             <th class="ci-patron">Patron</th>
1211                                             <th class="ci-note">Note</th>
1212                                         </tr>
1213                                     </thead>
1214
1215                                     [% FOREACH riloo IN riloop %]
1216                                         <tr>
1217                                             <td class="ci-duedate">
1218                                                 [% IF ( riloo.duedate ) %]
1219                                                     [% IF ( riloo.return_overdue ) %]
1220                                                         <span class="overdue">[% riloo.duedate | $KohaDates as_due_date => 1 %] (overdue)</span>
1221                                                     [% ELSE %]
1222                                                         [% riloo.duedate | $KohaDates as_due_date => 1 %]
1223                                                     [% END %]
1224                                                 [% ELSE %]
1225                                                     <span>Not checked out</span>
1226                                                 [% END %]
1227                                                 [% IF ( riloo.damaged ) %]
1228                                                     <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => riloo.damaged ) | html %]</span>
1229                                                 [% END %]
1230                                             </td>
1231                                             <td class="ci-title">
1232                                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">
1233                                                     [% riloo.itemtitle | html %]
1234                                                     [% FOREACH subtitle IN riloo.subtitle.split(' \\| ') %] <span class="subtitle">[% subtitle | html %]</span>[% END %]
1235                                                     [% FOREACH part_number IN riloo.part_number.split(' \\| ') %] <span class="part_number">[% part_number | html %]</span>[% END %]
1236                                                     [% FOREACH part_name IN riloo.part_name.split(' \\| ') %] <span class="part_name">[% part_name | html %]<span>[% END %]
1237                                                 </a>
1238                                                 [% IF ( riloo.enumchron ) %]
1239                                                     <br/>
1240                                                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron | html %]</span>
1241                                                 [% END %]
1242                                             </td>
1243                                             <td class="ci-author">[% riloo.itemauthor | html %]</td>
1244                                             <td class="ci-barcode">
1245                                                 <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>
1246                                             </td>
1247                                             <td class="ci-homelibrary">
1248                                                 [% Branches.GetName( riloo.homebranch ) | html %]
1249                                             </td>
1250                                             <td class="ci-transferlibrary">
1251                                                 [% Branches.GetName( riloo.transferbranch ) | html %]
1252                                             </td>
1253                                             <td class="ci-shelvinglocation">
1254                                                 <span class="shelvingloc">[% riloo.location | html %]</span>
1255                                             </td>
1256                                             <td class="ci-callnumber">
1257                                                 [% riloo.itemcallnumber | html %]
1258                                             </td>
1259                                             <td class="ci-dateaccessioned">
1260                                                 [% riloo.dateaccessioned | $KohaDates %]
1261                                             </td>
1262                                             <td class="ci-recordlevelitemtype">
1263                                                 [% ItemTypes.GetDescription( riloo.recordtype ) | html %]
1264                                             </td>
1265                                             <td class="ci-itemtype">
1266                                                 [% ItemTypes.GetDescription( riloo.itemtype ) | html %]
1267                                             </td>
1268                                             <td class="ci-collection">
1269                                                 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => riloo.ccode) | html %]
1270                                             </td>
1271                                             <td class="ci-patron">
1272                                                 [% IF ( riloo.duedate ) %]
1273                                                     [% INCLUDE 'patron-title.inc' patron=riloo.patron hide_patron_infos_if_needed=1 invert_name=1 %]
1274                                                     [% IF riloo.borissuescount %]
1275                                                         <span class="results_summary nowrap">
1276                                                             <span class="label">Checkouts:</span>
1277                                                             <span class="number_box">
1278                                                                 <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">[% riloo.borissuescount | html %]</a>
1279                                                             </span>
1280                                                         </span>
1281                                                     [% END %]
1282                                                     <a class="btn btn-default btn-xs printcheckinslip" href="#" data-borrowernumber="[% riloo.patron.borrowernumber | html %]"><i class="fa fa-print"></i> Print checkin slip</a>
1283                                                 [% ELSE %]
1284                                                     Not checked out
1285                                                 [% END %]
1286                                             </td>
1287                                             <td class="ci-note">
1288                                                 [% IF ( riloo.patron.borrowernotes ) %]
1289                                                     <p><span class="circ-hlt patron-note">[% riloo.patron.borrowernotes | $raw | html_line_break %]</span></p>
1290                                                 [% END %]
1291                                                 [% IF ( riloo.itemnote ) %]
1292                                                     <p><span class="circ-hlt item-note-public">[% riloo.itemnote | html %]</span></p>
1293                                                 [% END %]
1294                                                 [% IF ( riloo.itemnotes_nonpublic ) %]
1295                                                     <p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic | html %]</span></p>
1296                                                 [% END %]
1297                                             </td>
1298                                         </tr>
1299                                     [% END # /FOREACH riloo %]
1300                                 </table> <!-- /#checkedintable -->
1301                             </div><!-- /.page-section -->
1302                         [% END # /IF riloop %]
1303
1304                     [% IF Koha.Preference('CircSidebar') %]
1305                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
1306                             <div class="col-sm-2 col-sm-pull-10">
1307                                 <aside>
1308                                     [% INCLUDE 'circ-nav.inc' %]
1309                                 </aside>
1310                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1311                         </div> <!-- /.row -->
1312                     [% ELSE %]
1313                             </div> <!-- /.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 -->
1314                         </div> <!-- /.row -->
1315                     [% END %]
1316
1317                 </main>
1318             </div> <!-- /.col-sm-12 -->
1319         </div> <!-- /.row -->
1320
1321     [% IF ( ReturnClaims ) %]
1322         [% INCLUDE 'modals/resolve_return_claim.inc' %]
1323     [% END %]
1324
1325     [% INCLUDE 'modals/bundle_contents.inc' %]
1326
1327     [% IF ( missing_items ) %]
1328     <!-- Bundle missing modal -->
1329     <div class="modal printable" id="bundleMissingModal" tabindex="-1" role="dialog" aria-labelledby="bundleMissingLabel">
1330         <div class="modal-dialog" role="document">
1331             <div class="modal-content">
1332                 <div class="modal-header">
1333                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1334                     <h4 class="modal-title" id="bundleMissingLabel">Items missing from bundle at checkin for [% item.barcode | html %]</h4>
1335                 </div>
1336                 <div class="modal-body">
1337                     <table style="width:100%">
1338                         <thead>
1339                             <tr>
1340                                 <th>Barcode</th>
1341                                 <th>Title</th>
1342                             </tr>
1343                         </thead>
1344                         <tbody>
1345                         [% FOREACH bundle_item IN missing_items %]
1346                             <tr>
1347                                 <td>[% bundle_item.barcode | html %]</td>
1348                                 <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio %]</td>
1349                             </tr>
1350                         [% END %]
1351                         </tbody>
1352                         <tfoot>
1353                         </tfoot>
1354                     </table>
1355                 </div> <!-- /.modal-body -->
1356                 <div class="modal-footer">
1357                     <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1358                     <button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button>
1359                 </div> <!-- /.modal-footer -->
1360             </div> <!-- /.modal-content -->
1361         </div> <!-- /.modal-dialog -->
1362     </div> <!-- /#bundleMissingModal -->
1363     [% END %]
1364
1365 [% IF ( Koha.Preference('CatalogConcerns') ) %]
1366 [% INCLUDE 'modals/add_catalog_concern.inc' %]
1367 [% END %]
1368
1369 [% MACRO jsinclude BLOCK %]
1370     [% INCLUDE 'datatables.inc' %]
1371     [% INCLUDE 'columns_settings.inc' %]
1372     [% INCLUDE 'calendar.inc' %]
1373     [% Asset.js("js/pages/circulation.js") | $raw %]
1374     [% IF ( ReturnClaims ) %]
1375         <script>
1376             /* Set a variable needed by resolve_claim_modal.js */
1377             var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1378         </script>
1379         [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1380     [% END %]
1381     [% IF ( Koha.Preference('CatalogConcerns') ) %]
1382         <script>
1383             /* Set a variable needed by add_catalog_concern.js */
1384             var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1385         </script>
1386         [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1387     [% END %]
1388     <script>
1389         function Dopop(link) {
1390             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1391             $("#barcode").focus();
1392         }
1393         $(document).ready(function () {
1394             $("#checkin-form").preventDoubleFormSubmit();
1395             $(".modal.block").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
1396                 $("#barcode").prop("disabled", true);
1397                 $(".show_checkin_dialog").show();
1398             }).on('hidden.bs.modal', function() {
1399                 $("#barcode").prop("disabled", false).focus();
1400             });
1401             $(".modal.noblock").on('show.bs.modal', function() {
1402                 /* If the modal doesn't block further action, the backdrop should be hidden.
1403                    In order for this to happen smoothly we add a class to the body tag which
1404                    targeted in the CSS */
1405                 $("body").addClass("nobackdrop");
1406             }).modal()
1407             .on('shown.bs.modal', function() {
1408                 $("#barcode").prop("disabled", false).focus();
1409             }).on('hidden.bs.modal', function() {
1410                 $("#barcode").prop("disabled", false).focus();
1411             });
1412
1413             $("body").on("click", ".show_checkin_dialog button", function(e){
1414                 e.preventDefault();
1415                 $(".modal").modal("show");
1416             });
1417             [% IF reserve_id %]
1418                 $(".print-slip").on('click', function(e) {
1419                     e.preventDefault();
1420                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1421                 });
1422                 [% IF print_slip %]
1423                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1424                 [% END %]
1425             [% END %]
1426             var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]
1427
1428             [% IF recall_slip %]
1429                 Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% recall_id | uri %]');
1430             [% END %]
1431
1432             var returns_table = KohaTable("checkedintable", {
1433                     "bFilter":false,
1434                     "bPaginate":false,
1435                     "bInfo":false,
1436                     "bSort":false,
1437                     "dom": '<"table_controls"B>rt',
1438                     }, table_settings);
1439
1440             $("#exemptcheck").change(function () {
1441                 if (this.checked == true) {
1442                     $("#barcode").addClass("input-warning");
1443                     $("#exemptfines").show();
1444                 } else {
1445                     $("#barcode").removeClass("input-warning");
1446                     $("#exemptfines").hide();
1447                 }
1448                 $("#barcode").focus();
1449             });
1450
1451             $("#dropboxcheck").change(function () {
1452                 if (this.checked == true) {
1453                     $("#barcode").addClass("input-warning");
1454                     $("#dropboxmode").show();
1455
1456                     $("#return_date_override_fields :input").prop('disabled', true);
1457                 } else {
1458                     $("#barcode").removeClass("input-warning");
1459                     $("#dropboxmode").hide();
1460
1461                     $("#return_date_override_fields :input").prop('disabled', false);
1462                 }
1463                 $("#barcode").focus();
1464             });
1465
1466             $("#forgivemanualholdsexpire").change(function () {
1467                 if (this.checked == true) {
1468                     $("#barcode").addClass("input-warning");
1469                     $("#forgivemanualholdsexpire-alert").show();
1470                 } else {
1471                     $("#barcode").removeClass("input-warning");
1472                     $("#forgivemanualholdsexpire-alert").hide();
1473                 }
1474                 $("#barcode").focus();
1475             });
1476
1477             [% IF(overduecharges) %]
1478                 $("#barcode").focus(function () {
1479                     if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
1480                         $("#barcode").addClass("input-warning");
1481                     } else {
1482                         $("#barcode").removeClass("input-warning");
1483                     }
1484                 });
1485                 $("#barcode").blur(function () {
1486                     $("#barcode").removeClass("input-warning");
1487                 });
1488             [% END %]
1489
1490             $('.openWin').on("click",function(e){
1491                 Dopop( $(this).data("url") );
1492             });
1493
1494             $('.submit').on("click",function(e){
1495                 this.form.submit();
1496             });
1497
1498             $('.cancel').on("click",function(e){
1499                 var docancel = $("<input>").attr("type", "hidden").attr("name", "canceltransfer").val(1);
1500                 $('#wrongtransferform').append(docancel);
1501                 this.form.submit();
1502             });
1503
1504             $('.print').on("click",function(e){
1505                 this.form.print_slip.value = 1;
1506                 let barcode = document.getElementById('confirm-hold-barcode');
1507                 if ( barcode ) barcode.remove();
1508                 if ($(this).attr('name') == "dotransfer") {
1509                     var dotransfer = $("<input>").attr("type", "hidden").attr("name", "dotransfer").val("Yes");
1510                     $('#mainform').append(dotransfer);
1511                 }
1512                 this.form.submit();
1513             });
1514
1515             $('.print-recall').on("click",function(e){
1516                 this.form.recall_slip.value = 1;
1517                 this.form.submit();
1518             });
1519
1520             $('.approve').on("click",function(e){
1521                 let barcode = document.getElementById('confirm-hold-barcode');
1522                 if ( barcode ) barcode.remove();
1523                 this.form.submit();
1524             });
1525             $('.cancel-hold').on("click",function(e){
1526                 this.form.cancel_reserve.value = 1;
1527                 this.form.submit();
1528             });
1529
1530             $('.action').on("click",function(e){
1531                 this.checked = false;
1532                 this.form.return_date_override.value = '';
1533                 this.form.return_date_override_remember.checked = false;
1534                 this.form.barcode.focus();
1535                 $("#return_date_remember").hide();
1536                 return false;
1537             });
1538
1539             $("#return_date_override_remember").on("change", function(){
1540                 if( $(this).prop("checked" ) ){
1541                     if( $("#return_date_override").val() == "" ){
1542                         $("#saved_return_date").text( _("No date selected") );
1543                     } else {
1544                         $("#saved_return_date").text( $("#return_date_override").val() );
1545                     }
1546                     $("#return_date_remember").show();
1547                 } else {
1548                     $("#return_date_remember").hide();
1549                 }
1550             });
1551             $('[data-toggle="tooltip"]').tooltip();
1552
1553             $(".printcheckinslip").on("click", function(e){
1554                 e.preventDefault();
1555                 var borrowernumber = $(this).data('borrowernumber');
1556                 window.open("/cgi-bin/koha/members/printslip.pl?borrowernumber=" + borrowernumber + "&amp;print=checkinslip", "printwindow");
1557             });
1558
1559             // item bundles
1560             $('#verify-items-bundle-contents-barcodes').on('input', function (ev) {
1561                 let char = ev.target.value.slice(-1);
1562                 if ( char.match(/\n/) ) {
1563                     const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim().toUpperCase() });
1564                     const expected = [];
1565                     let found = 0;
1566                     $('#items-bundle-contents-table tbody > tr').each(function () {
1567                         const barcode = this.getAttribute('data-barcode').toUpperCase();
1568                         expected.push(barcode);
1569                         if (barcodes.includes(barcode)) {
1570                             this.classList.add('ok');
1571                             found++;
1572                         } else {
1573                             this.classList.remove('ok');
1574                         }
1575                     });
1576                     const last = barcodes[barcodes.length -2];
1577                     const feedback = $('#bundle-feedback');
1578                     let string;
1579                     if ( !expected.includes(last) ) {
1580                         feedback.fadeOut(100, function(){
1581                             string = _("Unexpected: ") +last;
1582                             feedback.addClass('alert-danger').removeClass('alert-success').html(string).fadeIn(100);
1583                         });
1584                     } else {
1585                         feedback.fadeOut(100, function(){
1586                             string = _("Verified: ")+last;
1587                             feedback.addClass('alert-success').removeClass('alert-danger').html(string).fadeIn(100);
1588                         });
1589                     }
1590                     $('#verify-progress').show();
1591                     $('#verified').text(found);
1592                     $('#expected').text(expected.length);
1593                 }
1594             });
1595
1596             $('.bundle_remove').on('click', function() {
1597                 var component_itemnumber = $(this).data('itemnumber');
1598                 var host_itemnumber = $(this).data('hostnumber');
1599                 var alert = $(this).closest('div');
1600                 var unlink_item_url = "/api/v1/items/" + host_itemnumber + "/bundled_items/item/" + component_itemnumber;
1601                 $.ajax({
1602                     type: "DELETE",
1603                     url: unlink_item_url,
1604                     success: function(){
1605                         alert.remove();
1606                     }
1607                 });
1608             });
1609
1610             $('#items-bundle-contents-table').dataTable($.extend(true, {}, dataTablesDefaults, {
1611                 "bFilter": false,
1612                 "bPaginate": false,
1613                 "bInfo": false,
1614                 "order": [[ 1, 'asc' ], [ 0, 'asc' ]]
1615             }));
1616
1617             // print modals
1618             $('.modal.printable').on('shown.bs.modal', function() {
1619                 $('.modal-dialog', this).addClass('focused');
1620                 $('body').addClass('modalprinter');
1621
1622                 if ($(this).hasClass('autoprint')) {
1623                     window.print();
1624                 }
1625             }).on('hidden.bs.modal', function() {
1626                 $('.modal-dialog', this).removeClass('focused');
1627                 $('body').removeClass('modalprinter');
1628             });
1629
1630             $('.printModal').click(function() {
1631                 window.print();
1632             });
1633             [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %]
1634                 $("#wrong-transfer-modal").on('hidden.bs.modal',function(){
1635                     $("#wrongtransferform").submit();
1636                 });
1637                 [% IF (transfer) %]
1638                     $("#item-transfer-modal").on('hidden.bs.modal',function(){
1639                         $("#mainform").submit();
1640                     });
1641                 [% END %]
1642             [% END %]
1643         });
1644     </script>
1645
1646 [% END %]
1647
1648 [% INCLUDE 'intranet-bottom.inc' %]