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