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