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