Bug 28854: Add option to print content list after verification
[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</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</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>
485                                         <div class="modal-footer">
486                                             <input type="hidden" name="barcode" value="[% item.barcode | html %]">
487                                             <input type="hidden" name="confirm_items_bundle_return" value="1">
488                                             [% FOREACH inputloo IN inputloop %]
489                                             <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
490                                             <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
491                                             <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
492                                             [% END %]
493                                             [% IF item.onloan %]
494                                             <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> [% t('Confirm checkin and mark missing items as lost') | html %]</button>
495                                             [% ELSE %]
496                                             <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> [% t('Confirm inventory check and mark items as lost') | html %]</button>
497                                             [% END %]
498                                             <button type="button" data-dismiss="modal" class="btn btn-default"><i class="fa fa-close"></i> [% t('Cancel') | html %]</button>
499                                         </div>
500                                     </form>
501                                 </div>
502                             </div>
503                         </div>
504                         [% END %]
505
506                         [% IF wrongbranch %]
507                             <div id="wrong-branch-modal" class="modal fade audio-alert-action block">
508                                 <div class="modal-dialog">
509                                     <div class="modal-content">
510                                         <form method="post" action="returns.pl" name="mainform" id="mainform">
511                                             <div class="modal-header">
512                                                 <h3>
513                                                     Cannot check in
514                                                 </h3>
515                                             </div>
516                                             <div class="modal-body">
517                                                 <p>
518                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
519                                                         [% item.barcode | html %]: [% title | html %]
520                                                     </a>
521                                                 </p>
522                                                 <p>
523                                                     <strong>
524                                                         NOT CHECKED IN
525                                                     </strong>
526                                                 </p>
527                                                 <p>
528                                                     This item must be checked in at following library:
529                                                     <strong>
530                                                         [% Branches.GetName( rightbranch ) | html %]
531                                                     </strong>
532                                                 </p>
533                                                 [% INCLUDE all_checkin_messages %]
534                                             </div> <!-- /.modal-body -->
535                                             <div class="modal-footer">
536                                                 <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
537                                             </div>
538                                         </form> <!-- /#mainform -->
539                                     </div> <!-- /.modal-content -->
540                                 </div> <!-- /.modal-dialog -->
541                             </div> <!-- /#wrong-branch-modal -->
542                         [% END # /IF wrongbranch %]
543
544                         <!-- case of a mistake in transfer loop -->
545                         [% UNLESS ( hold_auto_filled && diffbranch ) %]
546                             [% IF WrongTransfer && !transfertodo %]
547                                 [% IF Koha.Preference('TransfersBlockCirc') %]
548                                     <div id="wrong-transfer-modal" class="modal fade audio-alert-action block">
549                                 [% ELSE %]
550                                     <div id="wrong-transfer-modal" class="modal fade audio-alert-action noblock">
551                                 [% END %]
552                                     <div class="modal-dialog">
553                                         <div class="modal-content">
554                                             <form method="post" action="returns.pl" name="wrongtransferform" id="wrongtransferform">
555                                                 <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
556                                                 <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
557                                                 <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
558                                                 <input type="hidden" name="transit" value="[% NewTransfer | html %]" />
559                                                 [% FOREACH inputloo IN inputloop %]
560                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
561                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
562                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
563                                                 [% END %]
564
565                                                 <div class="modal-header">
566                                                     <h3>
567                                                         Wrong transfer detected, please return item to: [% Branches.GetName( TransferWaitingAt ) | html %]
568                                                     </h3>
569                                                 </div>
570
571                                                 <div class="modal-body">
572                                                     <p>
573                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% item.barcode | html %]: [% title | html %]</a>
574                                                     </p>
575
576                                                     [% INCLUDE all_checkin_messages %]
577                                                 </div>
578
579                                                 <div class="modal-footer">
580                                                     <!-- CONFIRM -->
581                                                     <button class="btn btn-default approve" type="submit" accesskey="y"><i class="fa fa-check"></i> OK (Y)</button>
582                                                     <!-- PRINT SLIP -->
583                                                     <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>
584                                                     <!-- CANCEL TRANSFER -->
585                                                     <button type="button" data-dismiss="modal" class="btn btn-default deny cancel" accesskey="x"><i class="fa fa-times"></i> Cancel transfer (X)</button>
586                                                 </div> <!-- /.modal-footer -->
587                                             </form> <!-- /wrongtransferform -->
588                                         </div> <!-- /.modal-content -->
589                                     </div> <!-- /.modal-dialog -->
590                                 </div> <!-- /#wrong-transfer-modal -->
591                             [% END # /IF WrongTransfer && !transfertodo %]
592                         [% END # /UNLESS hold_auto_filled && diffbranch %]
593
594                         [% IF ( found ) %]
595                             [% IF ( waiting ) %]
596                                 <div id="hold-found1" class="modal fade audio-alert-action block">
597                                     <div class="modal-dialog">
598                                         <div class="modal-content">
599                                             <form method="post" action="returns.pl" class="confirm">
600                                                 <div class="modal-header">
601                                                     <h3>
602                                                         Hold found (item is already waiting):
603                                                         <br/>
604                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
605                                                         <div class="hold-found-barcode">
606                                                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>
607                                                         </div>
608                                                     </h3>
609                                                 </div>
610
611                                                 <div class="modal-body">
612                                                     [% IF ( reservenotes ) %]
613                                                         <h4>Notes: [% reservenotes | html %]</h4>
614                                                     [% END %]
615
616                                                     <h4>Hold for:</h4>
617                                                     <ul>
618                                                         <li>
619                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
620                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
621                                                         </li>
622                                                         [% INCLUDE display_holdpatron_address %]
623                                                         [% IF ( patron.phone ) %]
624                                                             <li> [% patron.phone | html %]</li>
625                                                         [% END %]
626
627                                                         [% IF ( patron.email ) %]
628                                                             <li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li>
629                                                         [% END %]
630
631                                                         [% IF ( patron.is_debarred ) %]
632                                                             <li class="error">Patron is RESTRICTED</li>
633                                                         [% END %]
634
635                                                         [% IF ( patron.gonenoaddress ) %]
636                                                             <li class="error">Patron's address is in doubt</li>
637                                                         [% END %]
638                                                     </ul>
639
640                                                     [% IF ( transfertodo ) %]
641                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
642                                                     [% ELSE %]
643                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
644                                                     [% END %]
645
646                                                     [% FOREACH inputloo IN inputloop %]
647                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
648                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
649                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
650                                                     [% END %]
651
652                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
653                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
654                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
655                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
656                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
657                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
658                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
659                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
660
661                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
662                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
663                                                     [% INCLUDE all_checkin_messages %]
664                                                 </div> <!-- /.modal-body -->
665
666                                                 <div class="modal-footer">
667                                                     <input type="hidden" name="cancel_reserve" value="0" />
668                                                     <input id="confirm-hold-barcode" type="hidden" name="barcode" value="[% barcode | html %]" />
669
670                                                     <button type="submit" class="btn btn-default approve" data-dismiss="modal" accesskey="y">
671                                                         <i class="fa fa-check"></i> Confirm hold (Y)
672                                                     </button>
673
674                                                     <input type="hidden" name="print_slip" value="0" />
675                                                     <button type="button" class="btn btn-default print" accesskey="P">
676                                                         <i class="fa fa-print"></i> Print slip and confirm (P)
677                                                     </button>
678
679                                                     <button type="button" class="btn btn-default deny cancel-hold" accesskey="X">
680                                                         <i class="fa fa-times"></i> Cancel hold (X)
681                                                     </button>
682                                                 </div> <!-- /.modal-footer -->
683                                             </form> <!-- /.confirm -->
684                                         </div> <!-- /.modal-content -->
685                                     </div> <!-- /.modal-dialog -->
686                                 </div> <!-- /#hold-found1 -->
687                             [% END # /IF waiting %]
688
689                             [% IF transfer || needstransfer %]
690                                 [% IF Koha.Preference('TransfersBlockCirc') %]
691                                     <div id="item-transfer-modal" class="modal fade audio-alert-action block">
692                                 [% ELSE %]
693                                     <div id="item-transfer-modal" class="modal fade audio-alert-action noblock">
694                                 [% END %]
695                                     <div class="modal-dialog">
696                                         <div class="modal-content">
697                                             <form method="post" action="returns.pl" name="mainform" id="mainform">
698
699                                                 <input type="hidden" name="print_slip" value="0" />
700
701                                                 <div class="modal-header">
702                                                     <h3>
703                                                         Please return this item to [% IF transfer %][% Branches.GetName( transfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
704                                                     </h3>
705                                                 </div>
706                                                 <div class="modal-body">
707                                                     <p>
708                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
709                                                             [% item.barcode | html %]: [% title | html %]
710                                                         </a>
711                                                     </p>
712                                                     [% IF !transfer %]
713                                                         <p>
714                                                             Transfer now?
715                                                         </p>
716                                                     [% END %]
717                                                     <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
718                                                     <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
719                                                     <input type="hidden" name="barcode" value="0" />
720                                                     <input type="hidden" name="trigger" value="[% trigger | html %]" />
721                                                     [% INCLUDE all_checkin_messages %]
722                                                 </div>
723                                                 <div class="modal-footer">
724                                                     [% IF !transfer %]
725                                                         <button type="submit" name="dotransfer" value="Yes" class="btn btn-default approve" accesskey="y"><i class="fa fa-check"></i> Yes (Y)</button>
726                                                         <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>
727                                                         <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>
728                                                     [% ELSE %]
729                                                         <button type="button" data-dismiss="modal" class="btn btn-default approve" accesskey="y"><i class="fa fa-check"></i> OK (Y)</button>
730                                                         <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>
731                                                     [% END %]
732                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
733                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
734                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
735                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
736                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
737                                                     [% FOREACH inputloo IN inputloop %]
738                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
739                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
740                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
741                                                     [% END %]
742                                                 </div> <!-- /.modal-footer -->
743                                             </form> <!-- /#mainform -->
744                                         </div> <!-- /.modal-content -->
745                                     </div> <!-- /.modal-dialog -->
746                                 </div> <!-- /#item-transfer-modal -->
747                             [% END # /IF transfer || needstransfer %]
748
749                             <!-- case of simple return no issue or transfer but with a hold  -->
750                             [% IF ( reserved and !recalled and !waitingrecall ) %]
751                                 <!-- reserved -->
752                                 <div id="hold-found2" class="modal fade audio-alert-action block">
753                                     <div class="modal-dialog">
754                                         <div class="modal-content">
755                                             <form method="post" action="returns.pl" class="confirm">
756
757                                                 <input type="hidden" name="print_slip" value="0" />
758
759                                                 <div class="modal-header">
760                                                     <h3>
761                                                         Hold found:
762                                                         <br/>
763                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
764                                                         <div class="hold-found-barcode">
765                                                             (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>)
766                                                         </div>
767                                                     </h3>
768                                                 </div>
769
770                                                 <div class="modal-body">
771                                                     [% IF ( reservenotes ) %]
772                                                         <h4>Notes:</h4>
773                                                         <p>[% reservenotes | html %]</p>
774                                                         <hr />
775                                                     [% END %]
776                                                     <h5>Hold for:</h5>
777                                                     <ul>
778                                                         <li>
779                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
780                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
781                                                         </li>
782
783                                                         [% INCLUDE display_holdpatron_address %]
784
785                                                         [% IF ( patron.phone ) %]
786                                                             <li>[% patron.phone | html %]</li>
787                                                         [% END %]
788
789                                                         [% IF ( patron.email ) %]
790                                                             <li>
791                                                                 [% IF ( transfertodo ) %]
792                                                                     [% patron.email | html %]
793                                                                 [% ELSE %]
794                                                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
795                                                                 [% END %]
796                                                             </li>
797                                                         [% END %]
798
799                                                         [% UNLESS ( transfertodo) %]
800                                                             [% INCLUDE display_bormessagepref %]
801                                                         [% END %]
802
803                                                         [% IF ( patron.is_debarred ) %]
804                                                             <li class="error">Patron is RESTRICTED</li>
805                                                         [% END %]
806
807                                                         [% IF ( patron.gonenoaddress ) %]
808                                                             <li class="error">Patron's address is in doubt</li>
809                                                         [% END %]
810                                                     </ul>
811                                                     [% IF ( transfertodo ) %]
812                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
813                                                     [% ELSE %]
814                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
815                                                     [% END %]
816
817                                                     [% FOREACH inputloo IN inputloop %]
818                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
819                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
820                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
821                                                     [% END %]
822
823                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
824                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
825                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
826                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
827                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
828                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
829                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
830                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
831                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
832                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
833                                                     [% INCLUDE all_checkin_messages %]
834                                                 </div>
835
836                                                 <div class="modal-footer">
837                                                     [% IF ( transfertodo ) %]
838                                                         <button type="submit" class="btn btn-default approve" accesskey="y">
839                                                             <i class="fa fa-check"></i> Confirm hold and transfer (Y)
840                                                         </button>
841                                                         <button type="button" class="btn btn-default print" accesskey="p">
842                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm (P)
843                                                         </button>
844                                                     [% ELSE %]
845                                                         <button type="submit" class="btn btn-default approve" accesskey="y">
846                                                             <i class="fa fa-check"></i> Confirm hold (Y)
847                                                         </button>
848                                                         <button type="button" class="btn btn-default print" accesskey="p">
849                                                             <i class="fa fa-print"></i> Print slip and confirm (P)
850                                                         </button>
851                                                     [% END %]
852
853                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny" accesskey="i">
854                                                         <i class="fa fa-times"></i> Ignore (I)
855                                                     </button>
856                                                 </div> <!-- /.modal-footer -->
857                                             </form> <!-- /.confirm -->
858                                         </div> <!-- /.modal-content -->
859                                     </div> <!-- /.modal-dialog -->
860                                 </div> <!-- /#hold-found2 -->
861                             [% END #/IF reserved %]
862
863                             [% IF ( recalled ) %]
864                                 <!-- recalled -->
865                                 <div id="recalled" class="modal fade audio-alert-action block">
866                                     <div class="modal-dialog">
867                                         <div class="modal-content">
868                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
869
870                                                 <div class="modal-header">
871                                                     <h3>
872                                                         Recall found:
873                                                         <br/>
874                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
875                                                         [% IF recall.item %]
876                                                             <div class="recall-found-barcode">
877                                                                 (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
878                                                             </div>
879                                                         [% END %]
880                                                     </h3>
881                                                 </div>
882
883                                                 <div class="modal-body">
884                                                     [% IF ( recall.notes ) %]
885                                                         <h4>Notes:</h4>
886                                                         <p>[% recall.notes | html %]</p>
887                                                         <hr />
888                                                     [% END %]
889                                                     <h5>Recall placed by:</h5>
890                                                     <ul>
891                                                         <li>
892                                                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_recalls" %]
893                                                             <span class="patron-category"> - [% recall.patron.category.description | html %]</span>
894                                                         </li>
895
896                                                         [% INCLUDE display_holdpatron_address patron=recall.patron %]
897
898                                                         [% IF ( recall.patron.phone ) %]
899                                                             <li>[% recall.patron.phone | html %]</li>
900                                                         [% END %]
901
902                                                         [% IF ( recall.patron.email ) %]
903                                                             <li>
904                                                                 [% IF ( transfertodo ) %]
905                                                                     [% recall.patron.email | html %]
906                                                                 [% ELSE %]
907                                                                     <a id="boremail" href="mailto:[% recall.patron.email | html %]">[% recall.patron.email | html %]</a>
908                                                                 [% END %]
909                                                             </li>
910                                                         [% END %]
911
912                                                         [% UNLESS ( transfertodo) %]
913                                                             [% INCLUDE display_bormessagepref %]
914                                                         [% END %]
915
916                                                         [% IF ( recall.patron.is_debarred ) %]
917                                                             <li class="error">Patron is RESTRICTED</li>
918                                                         [% END %]
919
920                                                         [% IF ( recall.patron.gonenoaddress ) %]
921                                                             <li class="error">Patron's address is in doubt</li>
922                                                         [% END %]
923                                                     </ul>
924                                                     [% IF ( transfertodo ) %]
925                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
926                                                     [% ELSE %]
927                                                         <h4><strong>Recall at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
928                                                     [% END %]
929
930                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
931                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
932                                                     <input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
933                                                     <input type="hidden" name="recall_slip" value="0">
934
935                                                 </div>
936
937                                                 <div class="modal-footer">
938                                                     [% IF ( transfertodo ) %]
939                                                         <button type="submit" class="btn btn-default approve">
940                                                             <i class="fa fa-check"></i> Confirm recall and transfer
941                                                         </button>
942                                                         <button type="button" class="btn btn-default print-recall">
943                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
944                                                         </button>
945                                                     [% ELSE %]
946                                                         <button type="submit" class="btn btn-default approve">
947                                                             <i class="fa fa-check"></i> Confirm recall
948                                                         </button>
949                                                         <button type="button" class="btn btn-default print-recall">
950                                                             <i class="fa fa-print"></i> Print slip and confirm
951                                                         </button>
952                                                     [% END %]
953
954                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny">
955                                                         <i class="fa fa-times"></i> Ignore
956                                                     </button>
957                                                 </div> <!-- /.modal-footer -->
958                                             </form> <!-- /.confirm -->
959                                         </div> <!-- /.modal-content -->
960                                     </div> <!-- /.modal-dialog -->
961                                 </div> <!-- /#recalled -->
962                             [% END #/IF recalled %]
963
964                             [% IF ( waitingrecall ) %]
965                                 <!-- recalled -->
966                                 <div id="recalledwaiting" class="modal fade audio-alert-action block">
967                                     <div class="modal-dialog">
968                                         <div class="modal-content">
969                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
970
971                                                 <div class="modal-header">
972                                                     <h3>
973                                                         Recall found (item is already waiting):
974                                                         <br/>
975                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
976                                                         [% IF recall.item %]
977                                                             <div class="recall-found-barcode">
978                                                                 (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
979                                                             </div>
980                                                         [% END %]
981                                                     </h3>
982                                                 </div>
983
984                                                 <div class="modal-body">
985                                                     [% IF ( recall.notes ) %]
986                                                         <h4>Notes:</h4>
987                                                         <p>[% recall.notes | html %]</p>
988                                                         <hr />
989                                                     [% END %]
990                                                     <h5>Recall placed by:</h5>
991                                                     <ul>
992                                                         <li>
993                                                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_recalls" %]
994                                                             <span class="patron-category"> - [% recall.patron.category.description | html %]</span>
995                                                         </li>
996
997                                                         [% INCLUDE display_holdpatron_address patron=recall.patron %]
998
999                                                         [% IF ( recall.patron.phone ) %]
1000                                                             <li>[% recall.patron.phone | html %]</li>
1001                                                         [% END %]
1002
1003                                                         [% IF ( recall.patron.email ) %]
1004                                                             <li>
1005                                                                 [% IF ( transfertodo ) %]
1006                                                                     [% recall.patron.email | html %]
1007                                                                 [% ELSE %]
1008                                                                     <a id="boremail" href="mailto:[% recall.patron.email | html %]">[% recall.patron.email | html %]</a>
1009                                                                 [% END %]
1010                                                             </li>
1011                                                         [% END %]
1012
1013                                                         [% UNLESS ( transfertodo) %]
1014                                                             [% INCLUDE display_bormessagepref %]
1015                                                         [% END %]
1016
1017                                                         [% IF ( recall.patron.is_debarred ) %]
1018                                                             <li class="error">Patron is RESTRICTED</li>
1019                                                         [% END %]
1020
1021                                                         [% IF ( recall.patron.gonenoaddress ) %]
1022                                                             <li class="error">Patron's address is in doubt</li>
1023                                                         [% END %]
1024                                                     </ul>
1025                                                     [% IF ( transfertodo ) %]
1026                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
1027                                                     [% ELSE %]
1028                                                         <h4><strong>Wait for pickup at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
1029                                                     [% END %]
1030
1031                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
1032                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
1033                                                     <input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
1034                                                     <input type="hidden" name="recall_slip" value="0">
1035
1036                                                 </div>
1037
1038                                                 <div class="modal-footer">
1039                                                     <button type="submit" class="btn btn-default approve">
1040                                                         <i class="fa fa-check"></i> Confirm recall
1041                                                     </button>
1042                                                     <button type="button" class="btn btn-default print-recall">
1043                                                         <i class="fa fa-print"></i> Print slip and confirm
1044                                                     </button>
1045
1046                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny">
1047                                                         <i class="fa fa-times"></i> Ignore
1048                                                     </button>
1049                                                 </div> <!-- /.modal-footer -->
1050                                             </form> <!-- /.confirm -->
1051                                         </div> <!-- /.modal-content -->
1052                                     </div> <!-- /.modal-dialog -->
1053                                 </div> <!-- /#recalledwaiting-->
1054                             [% END #/IF recalledwaiting %]
1055                         [% END # /IF found %]
1056
1057                         <div class="static_checkin_messages">
1058                             [% INCLUDE all_checkin_messages %]
1059                         </div>
1060
1061                         <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
1062                             <fieldset id="circ_returns_checkin">
1063                                 <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>
1064                                 <h1>Check in</h1>
1065                                 <div class="row">
1066                                     <div class="col-sm-6">
1067                                         <div class="hint">Enter item barcode:</div>
1068                                             <div class="form-control-group">
1069                                                 [% IF ( exemptfine ) %]
1070                                                     <input name="barcode" id="barcode" size="14" class="focus input-warning" type="text" />
1071                                                 [% ELSIF ( dropboxmode ) %]
1072                                                     <input name="barcode" id="barcode" size="14" class="barcode focus input-warning" />
1073                                                 [% ELSE %]
1074                                                     <input name="barcode" id="barcode" size="14" class="barcode focus" />
1075                                                 [% END %]
1076                                                 <button type="submit" class="btn btn-default">Check in</button>
1077                                                 [% FOREACH inputloo IN inputloop %]
1078                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
1079                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
1080                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
1081                                                 [% END %]
1082                                             </div>
1083                                         <div id="show-circ-settings">
1084                                             <a href="#"><i class="fa circ-settings-icon fa-caret-down"></i> Checkin settings</a>
1085                                         </div>
1086                                     </div>
1087                                     <div class="col-sm-6">
1088                                         [% IF ( exemptfine ) %]
1089                                             <div id="exemptfines" class="checkin-active-setting">
1090                                         [% ELSE %]
1091                                             <div id="exemptfines" class="checkin-active-setting" style="display:none;">
1092                                         [% END %]
1093                                             <p><i class="fa fa-check"></i> Fines for returned items are forgiven.</p>
1094                                         </div>
1095
1096                                         [% IF ( forgivemanualholdsexpire ) %]
1097                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting">
1098                                         [% ELSE %]
1099                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting" style="display:none;">
1100                                         [% END %]
1101                                                 <p><i class="fa fa-check"></i> Fines are not charged for manually cancelled holds.</p>
1102                                             </div>
1103
1104                                         [% IF ( dropboxmode ) %]
1105                                             <div id="dropboxmode" class="checkin-active-setting">
1106                                         [% ELSE %]
1107                                             <div id="dropboxmode" class="checkin-active-setting" style="display:none;">
1108                                         [% END %]
1109                                             <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>
1110                                         </div>
1111                                         [% IF ( return_date_override_remember ) %]
1112                                             <div id="return_date_remember" class="checkin-active-setting">
1113                                         [% ELSE %]
1114                                             <div id="return_date_remember" class="checkin-active-setting" style="display:none;">
1115                                         [% END %]
1116                                             <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>
1117                                         </div>
1118                                     </div>
1119                                 </div>
1120
1121                                 <div class="circ-settings">
1122                                     [% IF Koha.Preference('SpecifyReturnDate') %]
1123                                         <div class="date-select" id="return_date_override_fields">
1124                                             <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
1125
1126                                             <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" />
1127
1128                                             <div class="circ-setting">
1129                                                 [% IF ( return_date_override_remember ) %]
1130                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" />
1131                                                 [% ELSE %]
1132                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" />
1133                                                 [% END %]
1134                                                 <label for="return_date_override_remember"> Remember return date for next check in</label>
1135                                             </div>
1136                                         </div> <!-- /.date-select -->
1137                                     [% END %]
1138
1139                                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
1140                                         <div id="forgive-overdue-fines" class="circ-setting">
1141                                             [% IF ( exemptfine ) %]
1142                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
1143                                             [% ELSE %]
1144                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
1145                                             [% END %]
1146                                             <label for="exemptcheck">Forgive overdue charges</label>
1147                                         </div>
1148                                     [% END %] <!-- overduecharges -->
1149
1150                                     <div id="book-drop-mode" class="circ-setting">
1151                                         [% IF ( dropboxmode ) %]
1152                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
1153                                         [% ELSE %]
1154                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
1155                                         [% END %]
1156                                         <label for="dropboxcheck">Book drop mode</label>
1157                                     </div>
1158
1159                                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
1160                                         <div class="forgive-manual-hold-fees circ-setting">
1161                                             [% IF ( forgivemanualholdsexpire ) %]
1162                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
1163                                             [% ELSE %]
1164                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
1165                                             [% END %]
1166                                             <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
1167                                         </div>
1168                                     [% END %] <!-- overduecharges -->
1169
1170                                 </div> <!-- /.circ-settings -->
1171                             </fieldset> <!-- /#circ_returns_checkin -->
1172                         </form> <!-- /#checkin-form -->
1173
1174                         [% IF ( riloop ) %]
1175                             <h2>Checked-in items</h2>
1176                             <table id="checkedintable">
1177                                 <thead>
1178                                     <tr>
1179                                         <th class="ci-duedate">Due date</th>
1180                                         <th class="ci-title">Title</th>
1181                                         <th class="ci-author">Author</th>
1182                                         <th class="ci-barcode">Barcode</th>
1183                                         <th class="ci-homelibrary">Home library</th>
1184                                         <th class="ci-transferlibrary">Transfer to</th>
1185                                         <th class="ci-shelvinglocation">Shelving location</th>
1186                                         <th class="ci-callnumber">Call number</th>
1187                                         <th class="ci-dateaccessioned">Date acquired</th>
1188                                         <th class="ci-recordlevelitemtype">Record-level itemtype</th>
1189                                         <th class="ci-itemtype">Item type</th>
1190                                         <th class="ci-collection">Collection</th>
1191                                         <th class="ci-patron">Patron</th>
1192                                         <th class="ci-note">Note</th>
1193                                     </tr>
1194                                 </thead>
1195
1196                                 [% FOREACH riloo IN riloop %]
1197                                     <tr>
1198                                         <td class="ci-duedate">
1199                                             [% IF ( riloo.duedate ) %]
1200                                                 [% IF ( riloo.return_overdue ) %]
1201                                                     <span class="overdue">[% riloo.duedate | html %] (overdue)</span>
1202                                                 [% ELSE %]
1203                                                     [% riloo.duedate | html %]
1204                                                 [% END %]
1205                                             [% ELSE %]
1206                                                 <span>Not checked out</span>
1207                                             [% END %]
1208                                             [% IF ( riloo.damaged ) %]
1209                                                 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => riloo.damaged ) | html %]</span>
1210                                             [% END %]
1211                                         </td>
1212                                         <td class="ci-title">
1213                                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">
1214                                                 [% riloo.itemtitle | html %]
1215                                                 [% FOREACH subtitle IN riloo.subtitle.split(' \\| ') %] <span class="subtitle">[% subtitle | html %]</span>[% END %]
1216                                                 [% FOREACH part_number IN riloo.part_number.split(' \\| ') %] <span class="part_number">[% part_number | html %]</span>[% END %]
1217                                                 [% FOREACH part_name IN riloo.part_name.split(' \\| ') %] <span class="part_name">[% part_name | html %]<span>[% END %]
1218                                             </a>
1219                                             [% IF ( riloo.enumchron ) %]
1220                                                 <br/>
1221                                                 <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron | html %]</span>
1222                                             [% END %]
1223                                         </td>
1224                                         <td class="ci-author">[% riloo.itemauthor | html %]</td>
1225                                         <td class="ci-barcode">
1226                                             <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>
1227                                         </td>
1228                                         <td class="ci-homelibrary">
1229                                             [% Branches.GetName( riloo.homebranch ) | html %]
1230                                         </td>
1231                                         <td class="ci-transferlibrary">
1232                                             [% Branches.GetName( riloo.transferbranch ) | html %]
1233                                         </td>
1234                                         <td class="ci-shelvinglocation">
1235                                             <span class="shelvingloc">[% riloo.location | html %]</span>
1236                                         </td>
1237                                         <td class="ci-callnumber">
1238                                             [% riloo.itemcallnumber | html %]
1239                                         </td>
1240                                         <td class="ci-dateaccessioned">
1241                                             [% riloo.dateaccessioned | $KohaDates %]
1242                                         </td>
1243                                         <td class="ci-recordlevelitemtype">
1244                                             [% ItemTypes.GetDescription( riloo.recordtype ) | html %]
1245                                         </td>
1246                                         <td class="ci-itemtype">
1247                                             [% ItemTypes.GetDescription( riloo.itemtype ) | html %]
1248                                         </td>
1249                                         <td class="ci-collection">
1250                                             [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => riloo.ccode) | html %]
1251                                         </td>
1252                                         <td class="ci-patron">
1253                                             [% IF ( riloo.duedate ) %]
1254                                                 [% INCLUDE 'patron-title.inc' patron=riloo.patron hide_patron_infos_if_needed=1 invert_name=1 %]
1255                                                 [% IF riloo.borissuescount %]
1256                                                     <span class="results_summary nowrap">
1257                                                         <span class="label">Checkouts:</span>
1258                                                         <span class="number_box">
1259                                                             <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">[% riloo.borissuescount | html %]</a>
1260                                                         </span>
1261                                                     </span>
1262                                                 [% END %]
1263                                                 <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>
1264                                             [% ELSE %]
1265                                                 Not checked out
1266                                             [% END %]
1267                                         </td>
1268                                         <td class="ci-note">
1269                                             [% IF ( riloo.patron.borrowernotes ) %]
1270                                                 <p><span class="circ-hlt patron-note">[% riloo.patron.borrowernotes | html %]</span></p>
1271                                             [% END %]
1272                                             [% IF ( riloo.itemnote ) %]
1273                                                 <p><span class="circ-hlt item-note-public">[% riloo.itemnote | html %]</span></p>
1274                                             [% END %]
1275                                             [% IF ( riloo.itemnotes_nonpublic ) %]
1276                                                 <p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic | html %]</span></p>
1277                                             [% END %]
1278                                         </td>
1279                                     </tr>
1280                                 [% END # /FOREACH riloo %]
1281                             </table> <!-- /#checkedintable -->
1282                         [% END # /IF riloop %]
1283
1284                     [% IF Koha.Preference('CircSidebar') %]
1285                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
1286                             <div class="col-sm-2 col-sm-pull-10">
1287                                 <aside>
1288                                     [% INCLUDE 'circ-nav.inc' %]
1289                                 </aside>
1290                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1291                         </div> <!-- /.row -->
1292                     [% ELSE %]
1293                             </div> <!-- /.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 -->
1294                         </div> <!-- /.row -->
1295                     [% END %]
1296
1297                 </main>
1298             </div> <!-- /.col-sm-12 -->
1299         </div> <!-- /.row -->
1300
1301     [% IF ( ReturnClaims ) %]
1302         [% INCLUDE 'modals/resolve_return_claim.inc' %]
1303     [% END %]
1304
1305     [% INCLUDE 'modals/bundle_contents.inc' %]
1306
1307 [% MACRO jsinclude BLOCK %]
1308     [% INCLUDE 'datatables.inc' %]
1309     [% INCLUDE 'columns_settings.inc' %]
1310     [% INCLUDE 'calendar.inc' %]
1311     [% Asset.js("js/pages/circulation.js") | $raw %]
1312     [% IF ( ReturnClaims ) %]
1313         <script>
1314             /* Set a variable needed by resolve_claim_modal.js */
1315             var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1316         </script>
1317         [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1318     [% END %]
1319
1320     <script>
1321         function Dopop(link) {
1322             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1323             $("#barcode").focus();
1324         }
1325         $(document).ready(function () {
1326             $("#checkin-form").preventDoubleFormSubmit();
1327             $(".modal.block").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
1328                 $("#barcode").prop("disabled", true);
1329                 $(".show_checkin_dialog").show();
1330             }).on('hidden.bs.modal', function() {
1331                 $("#barcode").prop("disabled", false).focus();
1332             });
1333             $(".modal.noblock").on('show.bs.modal', function() {
1334                 /* If the modal doesn't block further action, the backdrop should be hidden.
1335                    In order for this to happen smoothly we add a class to the body tag which
1336                    targeted in the CSS */
1337                 $("body").addClass("nobackdrop");
1338             }).modal()
1339             .on('shown.bs.modal', function() {
1340                 $("#barcode").prop("disabled", false).focus();
1341             }).on('hidden.bs.modal', function() {
1342                 $("#barcode").prop("disabled", false).focus();
1343             });
1344
1345             $("body").on("click", ".show_checkin_dialog button", function(e){
1346                 e.preventDefault();
1347                 $(".modal").modal("show");
1348             });
1349             [% IF reserve_id %]
1350                 $(".print-slip").on('click', function(e) {
1351                     e.preventDefault();
1352                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1353                 });
1354                 [% IF print_slip %]
1355                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1356                 [% END %]
1357             [% END %]
1358             var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]
1359
1360             [% IF recall_slip %]
1361                 Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% recall_id | uri %]');
1362             [% END %]
1363
1364             var returns_table = KohaTable("checkedintable", {
1365                     "bFilter":false,
1366                     "bPaginate":false,
1367                     "bInfo":false,
1368                     "bSort":false,
1369                     "dom": 'B<"clearfix">t',
1370                     }, table_settings);
1371
1372             $("#exemptcheck").change(function () {
1373                 if (this.checked == true) {
1374                     $("#barcode").addClass("input-warning");
1375                     $("#exemptfines").show();
1376                 } else {
1377                     $("#barcode").removeClass("input-warning");
1378                     $("#exemptfines").hide();
1379                 }
1380                 $("#barcode").focus();
1381             });
1382
1383             $("#dropboxcheck").change(function () {
1384                 if (this.checked == true) {
1385                     $("#barcode").addClass("input-warning");
1386                     $("#dropboxmode").show();
1387
1388                     $("#return_date_override_fields :input").prop('disabled', true);
1389                 } else {
1390                     $("#barcode").removeClass("input-warning");
1391                     $("#dropboxmode").hide();
1392
1393                     $("#return_date_override_fields :input").prop('disabled', false);
1394                 }
1395                 $("#barcode").focus();
1396             });
1397
1398             $("#forgivemanualholdsexpire").change(function () {
1399                 if (this.checked == true) {
1400                     $("#barcode").addClass("input-warning");
1401                     $("#forgivemanualholdsexpire-alert").show();
1402                 } else {
1403                     $("#barcode").removeClass("input-warning");
1404                     $("#forgivemanualholdsexpire-alert").hide();
1405                 }
1406                 $("#barcode").focus();
1407             });
1408
1409             [% IF(overduecharges) %]
1410                 $("#barcode").focus(function () {
1411                     if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
1412                         $("#barcode").addClass("input-warning");
1413                     } else {
1414                         $("#barcode").removeClass("input-warning");
1415                     }
1416                 });
1417                 $("#barcode").blur(function () {
1418                     $("#barcode").removeClass("input-warning");
1419                 });
1420             [% END %]
1421
1422             $('.openWin').on("click",function(e){
1423                 Dopop( $(this).data("url") );
1424             });
1425
1426             $('.submit').on("click",function(e){
1427                 this.form.submit();
1428             });
1429
1430             $('.cancel').on("click",function(e){
1431                 var docancel = $("<input>").attr("type", "hidden").attr("name", "canceltransfer").val(1);
1432                 $('#wrongtransferform').append(docancel);
1433                 this.form.submit();
1434             });
1435
1436             $('.print').on("click",function(e){
1437                 this.form.print_slip.value = 1;
1438                 let barcode = document.getElementById('confirm-hold-barcode');
1439                 if ( barcode ) barcode.remove();
1440                 if ($(this).attr('name') == "dotransfer") {
1441                     var dotransfer = $("<input>").attr("type", "hidden").attr("name", "dotransfer").val("Yes");
1442                     $('#mainform').append(dotransfer);
1443                 }
1444                 this.form.submit();
1445             });
1446
1447             $('.print-recall').on("click",function(e){
1448                 this.form.recall_slip.value = 1;
1449                 this.form.submit();
1450             });
1451
1452             $('.approve').on("click",function(e){
1453                 let barcode = document.getElementById('confirm-hold-barcode');
1454                 if ( barcode ) barcode.remove();
1455                 this.form.submit();
1456             });
1457             $('.cancel-hold').on("click",function(e){
1458                 this.form.cancel_reserve.value = 1;
1459                 this.form.submit();
1460             });
1461
1462             $('.action').on("click",function(e){
1463                 this.checked = false;
1464                 this.form.return_date_override.value = '';
1465                 this.form.return_date_override_remember.checked = false;
1466                 this.form.barcode.focus();
1467                 $("#return_date_remember").hide();
1468                 return false;
1469             });
1470
1471             $("#return_date_override_remember").on("change", function(){
1472                 if( $(this).prop("checked" ) ){
1473                     if( $("#return_date_override").val() == "" ){
1474                         $("#saved_return_date").text( _("No date selected") );
1475                     } else {
1476                         $("#saved_return_date").text( $("#return_date_override").val() );
1477                     }
1478                     $("#return_date_remember").show();
1479                 } else {
1480                     $("#return_date_remember").hide();
1481                 }
1482             });
1483             $('[data-toggle="tooltip"]').tooltip();
1484
1485             $(".printcheckinslip").on("click", function(e){
1486                 e.preventDefault();
1487                 var borrowernumber = $(this).data('borrowernumber');
1488                 window.open("/cgi-bin/koha/members/printslip.pl?borrowernumber=" + borrowernumber + "&amp;print=checkinslip", "printwindow");
1489             });
1490
1491             // item bundles
1492             $('#verify-items-bundle-contents-barcodes').on('input', function (ev) {
1493                 const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim() });
1494                 $('#items-bundle-contents-table tr').each(function () {
1495                     const barcode = this.getAttribute('data-barcode');
1496                     if (barcodes.includes(barcode)) {
1497                         this.classList.add('ok');
1498                     } else {
1499                         this.classList.remove('ok');
1500                     }
1501                 })
1502             });
1503
1504             $('.bundle_remove').on('click', function() {
1505                 var component_itemnumber = $(this).data('itemnumber');
1506                 var host_itemnumber = $(this).data('hostnumber');
1507                 var alert = $(this).closest('div');
1508                 var unlink_item_url = "/api/v1/items/" + host_itemnumber + "/bundled_items/item/" + component_itemnumber;
1509                 $.ajax({
1510                     type: "DELETE",
1511                     url: unlink_item_url,
1512                     success: function(){
1513                         alert.remove();
1514                     }
1515                 });
1516             });
1517
1518             // print modals
1519             $('.modal.printable').on('shown.bs.modal', function() {
1520                 $('.modal-dialog', this).addClass('focused');
1521                 $('body').addClass('modalprinter');
1522
1523                 if ($(this).hasClass('autoprint')) {
1524                     window.print();
1525                 }
1526             }).on('hidden.bs.modal', function() {
1527                 $('.modal-dialog', this).removeClass('focused');
1528                 $('body').removeClass('modalprinter');
1529             });
1530
1531             $('.printModal').click(function() {
1532                 window.print();
1533             });
1534         });
1535     </script>
1536
1537 [% END %]
1538
1539 [% INCLUDE 'intranet-bottom.inc' %]