Bug 34289: Add missing class to one condition of the checkin template
[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-solid 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-solid 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-solid 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-xmark"></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-times"></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-can"></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                                                             [% IF patron.primary_contact_method %]
819                                                                 <li id="main_contact_method">Main contact method: <span>[% patron.primary_contact_method | html %]</span></li>
820                                                             [% END %]
821                                                         [% END %]
822
823                                                         [% IF ( patron.is_debarred ) %]
824                                                             <li class="error">Patron is RESTRICTED</li>
825                                                         [% END %]
826
827                                                         [% IF ( patron.gonenoaddress ) %]
828                                                             <li class="error">Patron's address is in doubt</li>
829                                                         [% END %]
830                                                     </ul>
831                                                     [% IF ( transfertodo ) %]
832                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
833                                                     [% ELSE %]
834                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
835                                                     [% END %]
836
837                                                     [% FOREACH inputloo IN inputloop %]
838                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
839                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
840                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
841                                                     [% END %]
842
843                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
844                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
845                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
846                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
847                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
848                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
849                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
850                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
851                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
852                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
853                                                     [% INCLUDE all_checkin_messages %]
854                                                 </div>
855
856                                                 <div class="modal-footer">
857                                                     [% IF ( transfertodo ) %]
858                                                         <button type="submit" class="btn btn-default approve" accesskey="y">
859                                                             <i class="fa fa-check"></i> Confirm hold and transfer (Y)
860                                                         </button>
861                                                         <button type="button" class="btn btn-default print" accesskey="p">
862                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm (P)
863                                                         </button>
864                                                     [% ELSE %]
865                                                         <button type="submit" class="btn btn-default approve" accesskey="y">
866                                                             <i class="fa fa-check"></i> Confirm hold (Y)
867                                                         </button>
868                                                         <button type="button" class="btn btn-default print" accesskey="p">
869                                                             <i class="fa fa-print"></i> Print slip and confirm (P)
870                                                         </button>
871                                                     [% END %]
872
873                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny" accesskey="i">
874                                                         <i class="fa fa-times"></i> Ignore (I)
875                                                     </button>
876                                                 </div> <!-- /.modal-footer -->
877                                             </form> <!-- /.confirm -->
878                                         </div> <!-- /.modal-content -->
879                                     </div> <!-- /.modal-dialog -->
880                                 </div> <!-- /#hold-found2 -->
881                             [% END #/IF reserved %]
882
883                             [% IF ( recalled ) %]
884                                 <!-- recalled -->
885                                 <div id="recalled" class="modal fade audio-alert-action block">
886                                     <div class="modal-dialog">
887                                         <div class="modal-content">
888                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
889
890                                                 <div class="modal-header">
891                                                     <h3>
892                                                         Recall found:
893                                                         <br/>
894                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
895                                                         [% IF recall.item %]
896                                                             <div class="recall-found-barcode">
897                                                                 (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
898                                                             </div>
899                                                         [% END %]
900                                                     </h3>
901                                                 </div>
902
903                                                 <div class="modal-body">
904                                                     [% IF ( recall.notes ) %]
905                                                         <h4>Notes:</h4>
906                                                         <p>[% recall.notes | html %]</p>
907                                                         <hr />
908                                                     [% END %]
909                                                     <h5>Recall placed by:</h5>
910                                                     <ul>
911                                                         <li>
912                                                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_recalls" %]
913                                                             <span class="patron-category"> - [% recall.patron.category.description | html %]</span>
914                                                         </li>
915
916                                                         [% INCLUDE display_holdpatron_address patron=recall.patron %]
917
918                                                         [% IF ( recall.patron.phone ) %]
919                                                             <li>[% recall.patron.phone | html %]</li>
920                                                         [% END %]
921
922                                                         [% IF ( recall.patron.email ) %]
923                                                             <li>
924                                                                 [% IF ( transfertodo ) %]
925                                                                     [% recall.patron.email | html %]
926                                                                 [% ELSE %]
927                                                                     <a id="boremail" href="mailto:[% recall.patron.email | html %]">[% recall.patron.email | html %]</a>
928                                                                 [% END %]
929                                                             </li>
930                                                         [% END %]
931
932                                                         [% UNLESS ( transfertodo) %]
933                                                             [% INCLUDE display_bormessagepref %]
934                                                         [% END %]
935
936                                                         [% IF ( recall.patron.is_debarred ) %]
937                                                             <li class="error">Patron is RESTRICTED</li>
938                                                         [% END %]
939
940                                                         [% IF ( recall.patron.gonenoaddress ) %]
941                                                             <li class="error">Patron's address is in doubt</li>
942                                                         [% END %]
943                                                     </ul>
944                                                     [% IF ( transfertodo ) %]
945                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
946                                                     [% ELSE %]
947                                                         <h4><strong>Recall at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
948                                                     [% END %]
949
950                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
951                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
952                                                     <input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
953                                                     <input type="hidden" name="recall_slip" value="0">
954
955                                                 </div>
956
957                                                 <div class="modal-footer">
958                                                     [% IF ( transfertodo ) %]
959                                                         <button type="submit" class="btn btn-default approve" accesskey="Y">
960                                                             <i class="fa fa-check"></i> Confirm recall and transfer (Y)
961                                                         </button>
962                                                         <button type="button" class="btn btn-default print-recall" accesskey="P">
963                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm (P)
964                                                         </button>
965                                                     [% ELSE %]
966                                                         <button type="submit" class="btn btn-default approve" accesskey="Y">
967                                                             <i class="fa fa-check"></i> Confirm recall (Y)
968                                                         </button>
969                                                         <button type="button" class="btn btn-default print-recall" accesskey="P">
970                                                             <i class="fa fa-print"></i> Print slip and confirm (P)
971                                                         </button>
972                                                     [% END %]
973
974                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default">
975                                                         <i class="fa fa-times"></i> Ignore
976                                                     </button>
977                                                 </div> <!-- /.modal-footer -->
978                                             </form> <!-- /.confirm -->
979                                         </div> <!-- /.modal-content -->
980                                     </div> <!-- /.modal-dialog -->
981                                 </div> <!-- /#recalled -->
982                             [% END #/IF recalled %]
983
984                             [% IF ( waitingrecall ) %]
985                                 <!-- recalled -->
986                                 <div id="recalledwaiting" class="modal fade audio-alert-action block">
987                                     <div class="modal-dialog">
988                                         <div class="modal-content">
989                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
990
991                                                 <div class="modal-header">
992                                                     <h3>
993                                                         Recall found (item is already waiting):
994                                                         <br/>
995                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
996                                                         [% IF recall.item %]
997                                                             <div class="recall-found-barcode">
998                                                                 (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
999                                                             </div>
1000                                                         [% END %]
1001                                                     </h3>
1002                                                 </div>
1003
1004                                                 <div class="modal-body">
1005                                                     [% IF ( recall.notes ) %]
1006                                                         <h4>Notes:</h4>
1007                                                         <p>[% recall.notes | html %]</p>
1008                                                         <hr />
1009                                                     [% END %]
1010                                                     <h5>Recall placed by:</h5>
1011                                                     <ul>
1012                                                         <li>
1013                                                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_recalls" %]
1014                                                             <span class="patron-category"> - [% recall.patron.category.description | html %]</span>
1015                                                         </li>
1016
1017                                                         [% INCLUDE display_holdpatron_address patron=recall.patron %]
1018
1019                                                         [% IF ( recall.patron.phone ) %]
1020                                                             <li>[% recall.patron.phone | html %]</li>
1021                                                         [% END %]
1022
1023                                                         [% IF ( recall.patron.email ) %]
1024                                                             <li>
1025                                                                 [% IF ( transfertodo ) %]
1026                                                                     [% recall.patron.email | html %]
1027                                                                 [% ELSE %]
1028                                                                     <a id="boremail" href="mailto:[% recall.patron.email | html %]">[% recall.patron.email | html %]</a>
1029                                                                 [% END %]
1030                                                             </li>
1031                                                         [% END %]
1032
1033                                                         [% UNLESS ( transfertodo) %]
1034                                                             [% INCLUDE display_bormessagepref %]
1035                                                         [% END %]
1036
1037                                                         [% IF ( recall.patron.is_debarred ) %]
1038                                                             <li class="error">Patron is RESTRICTED</li>
1039                                                         [% END %]
1040
1041                                                         [% IF ( recall.patron.gonenoaddress ) %]
1042                                                             <li class="error">Patron's address is in doubt</li>
1043                                                         [% END %]
1044                                                     </ul>
1045                                                     [% IF ( transfertodo ) %]
1046                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
1047                                                     [% ELSE %]
1048                                                         <h4><strong>Wait for pickup at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
1049                                                     [% END %]
1050
1051                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
1052                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
1053                                                     <input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
1054                                                     <input type="hidden" name="recall_slip" value="0">
1055
1056                                                 </div>
1057
1058                                                 <div class="modal-footer">
1059                                                     <button type="submit" class="btn btn-default approve" accesskey="Y">
1060                                                         <i class="fa fa-check"></i> Confirm recall (Y)
1061                                                     </button>
1062                                                     <button type="button" class="btn btn-default print-recall" accesskey="P">
1063                                                         <i class="fa fa-print"></i> Print slip and confirm (P)
1064                                                     </button>
1065
1066                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny" accesskey="I">
1067                                                         <i class="fa fa-times"></i> Ignore (I)
1068                                                     </button>
1069                                                 </div> <!-- /.modal-footer -->
1070                                             </form> <!-- /.confirm -->
1071                                         </div> <!-- /.modal-content -->
1072                                     </div> <!-- /.modal-dialog -->
1073                                 </div> <!-- /#recalledwaiting-->
1074                             [% END #/IF recalledwaiting %]
1075                         [% END # /IF found %]
1076
1077                         <div class="static_checkin_messages">
1078                             [% INCLUDE all_checkin_messages %]
1079                         </div>
1080
1081                         <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
1082                             <fieldset id="circ_returns_checkin">
1083                                 <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>
1084                                 <h1>Check in</h1>
1085                                 <div class="row">
1086                                     <div class="col-sm-6">
1087                                             <div class="form-control-group">
1088                                                 [% IF ( exemptfine ) %]
1089                                                     <input name="barcode" id="barcode" size="14" placeholder="Enter item barcode" class="barcode focus input-warning" type="text" />
1090                                                 [% ELSIF ( dropboxmode ) %]
1091                                                     <input name="barcode" id="barcode" size="14" placeholder="Enter item barcode" class="barcode focus input-warning" />
1092                                                 [% ELSE %]
1093                                                     <input name="barcode" id="barcode" size="14" placeholder="Enter item barcode" class="barcode focus" />
1094                                                 [% END %]
1095
1096                                                 <div id="show-circ-settings">
1097                                                     <a href="#" title="Checkin settings"><i class="fa-solid fa-sliders"></i></a>
1098                                                 </div>
1099
1100                                                 <button type="submit" class="btn btn-primary">Check in</button>
1101                                                 [% FOREACH inputloo IN inputloop %]
1102                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
1103                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
1104                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
1105                                                 [% END %]
1106                                             </div>
1107                                     </div>
1108                                     <div class="col-sm-6">
1109                                         [% IF ( exemptfine ) %]
1110                                             <div id="exemptfines" class="checkin-active-setting">
1111                                         [% ELSE %]
1112                                             <div id="exemptfines" class="checkin-active-setting" style="display:none;">
1113                                         [% END %]
1114                                             <p><i class="fa fa-check"></i> Fines for returned items are forgiven.</p>
1115                                         </div>
1116
1117                                         [% IF ( forgivemanualholdsexpire ) %]
1118                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting">
1119                                         [% ELSE %]
1120                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting" style="display:none;">
1121                                         [% END %]
1122                                                 <p><i class="fa fa-check"></i> Fines are not charged for manually cancelled holds.</p>
1123                                             </div>
1124
1125                                         [% IF ( dropboxmode ) %]
1126                                             <div id="dropboxmode" class="checkin-active-setting">
1127                                         [% ELSE %]
1128                                             <div id="dropboxmode" class="checkin-active-setting" style="display:none;">
1129                                         [% END %]
1130                                             <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>
1131                                         </div>
1132                                         [% IF ( return_date_override_remember ) %]
1133                                             <div id="return_date_remember" class="checkin-active-setting">
1134                                         [% ELSE %]
1135                                             <div id="return_date_remember" class="checkin-active-setting" style="display:none;">
1136                                         [% END %]
1137                                             <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>
1138                                         </div>
1139                                     </div>
1140                                 </div>
1141
1142                                 <div class="circ-settings">
1143                                     [% IF Koha.Preference('SpecifyReturnDate') %]
1144                                         <div class="date-select" id="return_date_override_fields">
1145                                             <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
1146
1147                                             <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" />
1148
1149                                             <div class="circ-setting">
1150                                                 [% IF ( return_date_override_remember ) %]
1151                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" />
1152                                                 [% ELSE %]
1153                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" />
1154                                                 [% END %]
1155                                                 <label for="return_date_override_remember"> Remember return date for next check in</label>
1156                                             </div>
1157                                         </div> <!-- /.date-select -->
1158                                     [% END %]
1159
1160                                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
1161                                         <div id="forgive-overdue-fines" class="circ-setting">
1162                                             [% IF ( exemptfine ) %]
1163                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
1164                                             [% ELSE %]
1165                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
1166                                             [% END %]
1167                                             <label for="exemptcheck">Forgive overdue charges</label>
1168                                         </div>
1169                                     [% END %] <!-- overduecharges -->
1170
1171                                     <div id="book-drop-mode" class="circ-setting">
1172                                         [% IF ( dropboxmode ) %]
1173                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
1174                                         [% ELSE %]
1175                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
1176                                         [% END %]
1177                                         <label for="dropboxcheck">Book drop mode</label>
1178                                     </div>
1179
1180                                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
1181                                         <div class="forgive-manual-hold-fees circ-setting">
1182                                             [% IF ( forgivemanualholdsexpire ) %]
1183                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
1184                                             [% ELSE %]
1185                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
1186                                             [% END %]
1187                                             <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
1188                                         </div>
1189                                     [% END %] <!-- overduecharges -->
1190
1191                                 </div> <!-- /.circ-settings -->
1192                             </fieldset> <!-- /#circ_returns_checkin -->
1193                         </form> <!-- /#checkin-form -->
1194
1195                         [% IF ( riloop ) %]
1196                             <div class="page-section">
1197                                 <h2>Checked-in items</h2>
1198                                 <table id="checkedintable">
1199                                     <thead>
1200                                         <tr>
1201                                             <th class="ci-duedate">Due date</th>
1202                                             <th class="ci-title">Title</th>
1203                                             <th class="ci-author">Author</th>
1204                                             <th class="ci-barcode">Barcode</th>
1205                                             <th class="ci-homelibrary">Home library</th>
1206                                             <th class="ci-transferlibrary">Transfer to</th>
1207                                             <th class="ci-shelvinglocation">Shelving location</th>
1208                                             <th class="ci-callnumber">Call number</th>
1209                                             <th class="ci-dateaccessioned">Date acquired</th>
1210                                             <th class="ci-recordlevelitemtype">Record-level itemtype</th>
1211                                             <th class="ci-itemtype">Item type</th>
1212                                             <th class="ci-collection">Collection</th>
1213                                             <th class="ci-patron">Patron</th>
1214                                             <th class="ci-note">Note</th>
1215                                         </tr>
1216                                     </thead>
1217
1218                                     [% FOREACH riloo IN riloop %]
1219                                         <tr>
1220                                             <td class="ci-duedate">
1221                                                 [% IF ( riloo.duedate ) %]
1222                                                     [% IF ( riloo.return_overdue ) %]
1223                                                         <span class="overdue">[% riloo.duedate | $KohaDates as_due_date => 1 %] (overdue)</span>
1224                                                     [% ELSE %]
1225                                                         [% riloo.duedate | $KohaDates as_due_date => 1 %]
1226                                                     [% END %]
1227                                                 [% ELSE %]
1228                                                     <span>Not checked out</span>
1229                                                 [% END %]
1230                                                 [% IF ( riloo.damaged ) %]
1231                                                     <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => riloo.damaged ) | html %]</span>
1232                                                 [% END %]
1233                                             </td>
1234                                             <td class="ci-title">
1235                                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">
1236                                                     [% riloo.itemtitle | html %]
1237                                                     [% FOREACH subtitle IN riloo.subtitle.split(' \\| ') %] <span class="subtitle">[% subtitle | html %]</span>[% END %]
1238                                                     [% FOREACH part_number IN riloo.part_number.split(' \\| ') %] <span class="part_number">[% part_number | html %]</span>[% END %]
1239                                                     [% FOREACH part_name IN riloo.part_name.split(' \\| ') %] <span class="part_name">[% part_name | html %]<span>[% END %]
1240                                                 </a>
1241                                                 [% IF ( riloo.enumchron ) %]
1242                                                     <br/>
1243                                                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron | html %]</span>
1244                                                 [% END %]
1245                                             </td>
1246                                             <td class="ci-author">[% riloo.itemauthor | html %]</td>
1247                                             <td class="ci-barcode">
1248                                                 <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>
1249                                             </td>
1250                                             <td class="ci-homelibrary">
1251                                                 [% Branches.GetName( riloo.homebranch ) | html %]
1252                                             </td>
1253                                             <td class="ci-transferlibrary">
1254                                                 [% Branches.GetName( riloo.transferbranch ) | html %]
1255                                             </td>
1256                                             <td class="ci-shelvinglocation">
1257                                                 <span class="shelvingloc">[% riloo.location | html %]</span>
1258                                             </td>
1259                                             <td class="ci-callnumber">
1260                                                 [% riloo.itemcallnumber | html %]
1261                                             </td>
1262                                             <td class="ci-dateaccessioned">
1263                                                 [% riloo.dateaccessioned | $KohaDates %]
1264                                             </td>
1265                                             <td class="ci-recordlevelitemtype">
1266                                                 [% ItemTypes.GetDescription( riloo.recordtype ) | html %]
1267                                             </td>
1268                                             <td class="ci-itemtype">
1269                                                 [% ItemTypes.GetDescription( riloo.itemtype ) | html %]
1270                                             </td>
1271                                             <td class="ci-collection">
1272                                                 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => riloo.ccode) | html %]
1273                                             </td>
1274                                             <td class="ci-patron">
1275                                                 [% IF ( riloo.duedate ) %]
1276                                                     [% INCLUDE 'patron-title.inc' patron=riloo.patron hide_patron_infos_if_needed=1 invert_name=1 %]
1277                                                     [% IF riloo.borissuescount %]
1278                                                         <span class="results_summary nowrap">
1279                                                             <span class="label">Checkouts:</span>
1280                                                             <span class="number_box">
1281                                                                 <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">[% riloo.borissuescount | html %]</a>
1282                                                             </span>
1283                                                         </span>
1284                                                     [% END %]
1285                                                     <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>
1286                                                 [% ELSE %]
1287                                                     Not checked out
1288                                                 [% END %]
1289                                             </td>
1290                                             <td class="ci-note">
1291                                                 [% IF ( riloo.patron.borrowernotes ) %]
1292                                                     <p><span class="circ-hlt patron-note">[% riloo.patron.borrowernotes | $raw | html_line_break %]</span></p>
1293                                                 [% END %]
1294                                                 [% IF ( riloo.itemnote ) %]
1295                                                     <p><span class="circ-hlt item-note-public">[% riloo.itemnote | html %]</span></p>
1296                                                 [% END %]
1297                                                 [% IF ( riloo.itemnotes_nonpublic ) %]
1298                                                     <p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic | html %]</span></p>
1299                                                 [% END %]
1300                                             </td>
1301                                         </tr>
1302                                     [% END # /FOREACH riloo %]
1303                                 </table> <!-- /#checkedintable -->
1304                             </div><!-- /.page-section -->
1305                         [% END # /IF riloop %]
1306
1307                     [% IF Koha.Preference('CircSidebar') %]
1308                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
1309                             <div class="col-sm-2 col-sm-pull-10">
1310                                 <aside>
1311                                     [% INCLUDE 'circ-nav.inc' %]
1312                                 </aside>
1313                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1314                         </div> <!-- /.row -->
1315                     [% ELSE %]
1316                             </div> <!-- /.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 -->
1317                         </div> <!-- /.row -->
1318                     [% END %]
1319
1320                 </main>
1321             </div> <!-- /.col-sm-12 -->
1322         </div> <!-- /.row -->
1323
1324     [% IF ( ReturnClaims ) %]
1325         [% INCLUDE 'modals/resolve_return_claim.inc' %]
1326     [% END %]
1327
1328     [% INCLUDE 'modals/bundle_contents.inc' %]
1329
1330     [% IF ( missing_items ) %]
1331     <!-- Bundle missing modal -->
1332     <div class="modal printable" id="bundleMissingModal" tabindex="-1" role="dialog" aria-labelledby="bundleMissingLabel">
1333         <div class="modal-dialog" role="document">
1334             <div class="modal-content">
1335                 <div class="modal-header">
1336                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1337                     <h4 class="modal-title" id="bundleMissingLabel">Items missing from bundle at checkin for [% item.barcode | html %]</h4>
1338                 </div>
1339                 <div class="modal-body">
1340                     <table style="width:100%">
1341                         <thead>
1342                             <tr>
1343                                 <th>Barcode</th>
1344                                 <th>Title</th>
1345                             </tr>
1346                         </thead>
1347                         <tbody>
1348                         [% FOREACH bundle_item IN missing_items %]
1349                             <tr>
1350                                 <td>[% bundle_item.barcode | html %]</td>
1351                                 <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio %]</td>
1352                             </tr>
1353                         [% END %]
1354                         </tbody>
1355                         <tfoot>
1356                         </tfoot>
1357                     </table>
1358                 </div> <!-- /.modal-body -->
1359                 <div class="modal-footer">
1360                     <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1361                     <button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button>
1362                 </div> <!-- /.modal-footer -->
1363             </div> <!-- /.modal-content -->
1364         </div> <!-- /.modal-dialog -->
1365     </div> <!-- /#bundleMissingModal -->
1366     [% END %]
1367
1368 [% IF ( Koha.Preference('CatalogConcerns') ) %]
1369 [% INCLUDE 'modals/add_catalog_concern.inc' %]
1370 [% END %]
1371
1372 [% MACRO jsinclude BLOCK %]
1373     [% INCLUDE 'datatables.inc' %]
1374     [% INCLUDE 'columns_settings.inc' %]
1375     [% INCLUDE 'calendar.inc' %]
1376     [% Asset.js("js/pages/circulation.js") | $raw %]
1377     [% IF ( ReturnClaims ) %]
1378         <script>
1379             /* Set a variable needed by resolve_claim_modal.js */
1380             var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1381         </script>
1382         [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1383     [% END %]
1384     [% IF ( Koha.Preference('CatalogConcerns') ) %]
1385         <script>
1386             /* Set a variable needed by add_catalog_concern.js */
1387             var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1388         </script>
1389         [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1390     [% END %]
1391     <script>
1392         function Dopop(link) {
1393             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1394             $("#barcode").focus();
1395         }
1396         $(document).ready(function () {
1397             $("#checkin-form").preventDoubleFormSubmit();
1398             $(".modal.block").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
1399                 $("#barcode").prop("disabled", true);
1400                 $(".show_checkin_dialog").show();
1401             }).on('hidden.bs.modal', function() {
1402                 $("#barcode").prop("disabled", false).focus();
1403             });
1404             $(".modal.noblock").on('show.bs.modal', function() {
1405                 /* If the modal doesn't block further action, the backdrop should be hidden.
1406                    In order for this to happen smoothly we add a class to the body tag which
1407                    targeted in the CSS */
1408                 $("body").addClass("nobackdrop");
1409             }).modal()
1410             .on('shown.bs.modal', function() {
1411                 $("#barcode").prop("disabled", false).focus();
1412             }).on('hidden.bs.modal', function() {
1413                 $("#barcode").prop("disabled", false).focus();
1414             });
1415
1416             $("body").on("click", ".show_checkin_dialog button", function(e){
1417                 e.preventDefault();
1418                 $(".modal").modal("show");
1419             });
1420             [% IF reserve_id %]
1421                 $(".print-slip").on('click', function(e) {
1422                     e.preventDefault();
1423                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1424                 });
1425                 [% IF print_slip %]
1426                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1427                 [% END %]
1428             [% END %]
1429             var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]
1430
1431             [% IF recall_slip %]
1432                 Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% recall_id | uri %]');
1433             [% END %]
1434
1435             var returns_table = KohaTable("checkedintable", {
1436                     "bFilter":false,
1437                     "bPaginate":false,
1438                     "bInfo":false,
1439                     "bSort":false,
1440                     "dom": '<"table_controls"B>rt',
1441                     }, table_settings);
1442
1443             $("#exemptcheck").change(function () {
1444                 if (this.checked == true) {
1445                     $("#barcode").addClass("input-warning");
1446                     $("#exemptfines").show();
1447                 } else {
1448                     $("#barcode").removeClass("input-warning");
1449                     $("#exemptfines").hide();
1450                 }
1451                 $("#barcode").focus();
1452             });
1453
1454             $("#dropboxcheck").change(function () {
1455                 if (this.checked == true) {
1456                     $("#barcode").addClass("input-warning");
1457                     $("#dropboxmode").show();
1458
1459                     $("#return_date_override_fields :input").prop('disabled', true);
1460                 } else {
1461                     $("#barcode").removeClass("input-warning");
1462                     $("#dropboxmode").hide();
1463
1464                     $("#return_date_override_fields :input").prop('disabled', false);
1465                 }
1466                 $("#barcode").focus();
1467             });
1468
1469             $("#forgivemanualholdsexpire").change(function () {
1470                 if (this.checked == true) {
1471                     $("#barcode").addClass("input-warning");
1472                     $("#forgivemanualholdsexpire-alert").show();
1473                 } else {
1474                     $("#barcode").removeClass("input-warning");
1475                     $("#forgivemanualholdsexpire-alert").hide();
1476                 }
1477                 $("#barcode").focus();
1478             });
1479
1480             [% IF(overduecharges) %]
1481                 $("#barcode").focus(function () {
1482                     if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
1483                         $("#barcode").addClass("input-warning");
1484                     } else {
1485                         $("#barcode").removeClass("input-warning");
1486                     }
1487                 });
1488                 $("#barcode").blur(function () {
1489                     $("#barcode").removeClass("input-warning");
1490                 });
1491             [% END %]
1492
1493             $('.openWin').on("click",function(e){
1494                 Dopop( $(this).data("url") );
1495             });
1496
1497             $('.submit').on("click",function(e){
1498                 this.form.submit();
1499             });
1500
1501             $('.cancel').on("click",function(e){
1502                 var docancel = $("<input>").attr("type", "hidden").attr("name", "canceltransfer").val(1);
1503                 $('#wrongtransferform').append(docancel);
1504                 this.form.submit();
1505             });
1506
1507             $('.print').on("click",function(e){
1508                 this.form.print_slip.value = 1;
1509                 let barcode = document.getElementById('confirm-hold-barcode');
1510                 if ( barcode ) barcode.remove();
1511                 if ($(this).attr('name') == "dotransfer") {
1512                     var dotransfer = $("<input>").attr("type", "hidden").attr("name", "dotransfer").val("Yes");
1513                     $('#mainform').append(dotransfer);
1514                 }
1515                 this.form.submit();
1516             });
1517
1518             $('.print-recall').on("click",function(e){
1519                 this.form.recall_slip.value = 1;
1520                 this.form.submit();
1521             });
1522
1523             $('.approve').on("click",function(e){
1524                 let barcode = document.getElementById('confirm-hold-barcode');
1525                 if ( barcode ) barcode.remove();
1526                 this.form.submit();
1527             });
1528             $('.cancel-hold').on("click",function(e){
1529                 this.form.cancel_reserve.value = 1;
1530                 this.form.submit();
1531             });
1532
1533             $('.action').on("click",function(e){
1534                 this.checked = false;
1535                 this.form.return_date_override.value = '';
1536                 this.form.return_date_override_remember.checked = false;
1537                 this.form.barcode.focus();
1538                 $("#return_date_remember").hide();
1539                 return false;
1540             });
1541
1542             $("#return_date_override_remember").on("change", function(){
1543                 if( $(this).prop("checked" ) ){
1544                     if( $("#return_date_override").val() == "" ){
1545                         $("#saved_return_date").text( _("No date selected") );
1546                     } else {
1547                         $("#saved_return_date").text( $("#return_date_override").val() );
1548                     }
1549                     $("#return_date_remember").show();
1550                 } else {
1551                     $("#return_date_remember").hide();
1552                 }
1553             });
1554             $('[data-toggle="tooltip"]').tooltip();
1555
1556             $(".printcheckinslip").on("click", function(e){
1557                 e.preventDefault();
1558                 var borrowernumber = $(this).data('borrowernumber');
1559                 window.open("/cgi-bin/koha/members/printslip.pl?borrowernumber=" + borrowernumber + "&amp;print=checkinslip", "printwindow");
1560             });
1561
1562             // item bundles
1563             $('#verify-items-bundle-contents-barcodes').on('input', function (ev) {
1564                 let char = ev.target.value.slice(-1);
1565                 if ( char.match(/\n/) ) {
1566                     const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim().toUpperCase() });
1567                     const expected = [];
1568                     let found = 0;
1569                     $('#items-bundle-contents-table tbody > tr').each(function () {
1570                         const barcode = this.getAttribute('data-barcode').toUpperCase();
1571                         expected.push(barcode);
1572                         if (barcodes.includes(barcode)) {
1573                             this.classList.add('ok');
1574                             found++;
1575                         } else {
1576                             this.classList.remove('ok');
1577                         }
1578                     });
1579                     const last = barcodes[barcodes.length -2];
1580                     const feedback = $('#bundle-feedback');
1581                     let string;
1582                     if ( !expected.includes(last) ) {
1583                         feedback.fadeOut(100, function(){
1584                             string = _("Unexpected: ") +last;
1585                             feedback.addClass('alert-danger').removeClass('alert-success').html(string).fadeIn(100);
1586                         });
1587                     } else {
1588                         feedback.fadeOut(100, function(){
1589                             string = _("Verified: ")+last;
1590                             feedback.addClass('alert-success').removeClass('alert-danger').html(string).fadeIn(100);
1591                         });
1592                     }
1593                     $('#verify-progress').show();
1594                     $('#verified').text(found);
1595                     $('#expected').text(expected.length);
1596                 }
1597             });
1598
1599             $('.bundle_remove').on('click', function() {
1600                 var component_itemnumber = $(this).data('itemnumber');
1601                 var host_itemnumber = $(this).data('hostnumber');
1602                 var alert = $(this).closest('div');
1603                 var unlink_item_url = "/api/v1/items/" + host_itemnumber + "/bundled_items/item/" + component_itemnumber;
1604                 $.ajax({
1605                     type: "DELETE",
1606                     url: unlink_item_url,
1607                     success: function(){
1608                         alert.remove();
1609                     }
1610                 });
1611             });
1612
1613             $('#items-bundle-contents-table').dataTable($.extend(true, {}, dataTablesDefaults, {
1614                 "bFilter": false,
1615                 "bPaginate": false,
1616                 "bInfo": false,
1617                 "order": [[ 1, 'asc' ], [ 0, 'asc' ]]
1618             }));
1619
1620             // print modals
1621             $('.modal.printable').on('shown.bs.modal', function() {
1622                 $('.modal-dialog', this).addClass('focused');
1623                 $('body').addClass('modalprinter');
1624
1625                 if ($(this).hasClass('autoprint')) {
1626                     window.print();
1627                 }
1628             }).on('hidden.bs.modal', function() {
1629                 $('.modal-dialog', this).removeClass('focused');
1630                 $('body').removeClass('modalprinter');
1631             });
1632
1633             $('.printModal').click(function() {
1634                 window.print();
1635             });
1636             [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %]
1637                 $("#wrong-transfer-modal").on('hidden.bs.modal',function(){
1638                     $("#wrongtransferform").submit();
1639                 });
1640                 [% IF (transfer) %]
1641                     $("#item-transfer-modal").on('hidden.bs.modal',function(){
1642                         $("#mainform").submit();
1643                     });
1644                 [% END %]
1645             [% END %]
1646         });
1647     </script>
1648
1649 [% END %]
1650
1651 [% INCLUDE 'intranet-bottom.inc' %]