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