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