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