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