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