Bug 28854: (follow-up) Only count rows in the body
[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 varified</h3>
388                                     <p>The bundle content was varified</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>[% t('Title') | html %]</th>
440                                                         <th>[% t('Author') | html %]</th>
441                                                         <th>[% t('Item type') | html %]</th>
442                                                         <th>[% t('Barcode') | html %]</th>
443                                                         [% IF !item.onloan %]
444                                                         <th>[% t('Status') | html %]</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">[% t('Scan all barcodes of items found in the items bundle. If any items are missing, they will be marked as lost') | html %]</div>
482                                                 [% ELSE %]
483                                                 <div class="help-block">[% t('Optionally scan all barcodes of items found in the items bundle to perform an inventory check. If any items are missing, they will be marked as lost') | html %]</div>
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> [% t('Confirm checkin and mark missing items as lost') | html %]</button>
500                                             [% ELSE %]
501                                             <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> [% t('Confirm inventory check and mark items as lost') | html %]</button>
502                                             [% END %]
503                                             <button type="button" data-dismiss="modal" class="btn btn-default"><i class="fa fa-close"></i> [% t('Cancel') | html %]</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
684                                                     <button type="button" class="btn btn-default deny cancel-hold" accesskey="X">
685                                                         <i class="fa fa-times"></i> Cancel hold (X)
686                                                     </button>
687                                                 </div> <!-- /.modal-footer -->
688                                             </form> <!-- /.confirm -->
689                                         </div> <!-- /.modal-content -->
690                                     </div> <!-- /.modal-dialog -->
691                                 </div> <!-- /#hold-found1 -->
692                             [% END # /IF waiting %]
693
694                             [% IF transfer || needstransfer %]
695                                 [% IF Koha.Preference('TransfersBlockCirc') %]
696                                     <div id="item-transfer-modal" class="modal fade audio-alert-action block">
697                                 [% ELSE %]
698                                     <div id="item-transfer-modal" class="modal fade audio-alert-action noblock">
699                                 [% END %]
700                                     <div class="modal-dialog">
701                                         <div class="modal-content">
702                                             <form method="post" action="returns.pl" name="mainform" id="mainform">
703
704                                                 <input type="hidden" name="print_slip" value="0" />
705
706                                                 <div class="modal-header">
707                                                     <h3>
708                                                         Please return this item to [% IF transfer %][% Branches.GetName( transfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
709                                                     </h3>
710                                                 </div>
711                                                 <div class="modal-body">
712                                                     <p>
713                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
714                                                             [% item.barcode | html %]: [% title | html %]
715                                                         </a>
716                                                     </p>
717                                                     [% IF !transfer %]
718                                                         <p>
719                                                             Transfer now?
720                                                         </p>
721                                                     [% END %]
722                                                     <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
723                                                     <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
724                                                     <input type="hidden" name="barcode" value="0" />
725                                                     <input type="hidden" name="trigger" value="[% trigger | html %]" />
726                                                     [% INCLUDE all_checkin_messages %]
727                                                 </div>
728                                                 <div class="modal-footer">
729                                                     [% IF !transfer %]
730                                                         <button type="submit" name="dotransfer" value="Yes" class="btn btn-default approve" accesskey="y"><i class="fa fa-check"></i> Yes (Y)</button>
731                                                         <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>
732                                                         <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>
733                                                     [% ELSE %]
734                                                         <button type="button" data-dismiss="modal" class="btn btn-default approve" accesskey="y"><i class="fa fa-check"></i> OK (Y)</button>
735                                                         <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>
736                                                     [% END %]
737                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
738                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
739                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
740                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
741                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
742                                                     [% FOREACH inputloo IN inputloop %]
743                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
744                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
745                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
746                                                     [% END %]
747                                                 </div> <!-- /.modal-footer -->
748                                             </form> <!-- /#mainform -->
749                                         </div> <!-- /.modal-content -->
750                                     </div> <!-- /.modal-dialog -->
751                                 </div> <!-- /#item-transfer-modal -->
752                             [% END # /IF transfer || needstransfer %]
753
754                             <!-- case of simple return no issue or transfer but with a hold  -->
755                             [% IF ( reserved and !recalled and !waitingrecall ) %]
756                                 <!-- reserved -->
757                                 <div id="hold-found2" class="modal fade audio-alert-action block">
758                                     <div class="modal-dialog">
759                                         <div class="modal-content">
760                                             <form method="post" action="returns.pl" class="confirm">
761
762                                                 <input type="hidden" name="print_slip" value="0" />
763
764                                                 <div class="modal-header">
765                                                     <h3>
766                                                         Hold found:
767                                                         <br/>
768                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
769                                                         <div class="hold-found-barcode">
770                                                             (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>)
771                                                         </div>
772                                                     </h3>
773                                                 </div>
774
775                                                 <div class="modal-body">
776                                                     [% IF ( reservenotes ) %]
777                                                         <h4>Notes:</h4>
778                                                         <p>[% reservenotes | html %]</p>
779                                                         <hr />
780                                                     [% END %]
781                                                     <h5>Hold for:</h5>
782                                                     <ul>
783                                                         <li>
784                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
785                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
786                                                         </li>
787
788                                                         [% INCLUDE display_holdpatron_address %]
789
790                                                         [% IF ( patron.phone ) %]
791                                                             <li>[% patron.phone | html %]</li>
792                                                         [% END %]
793
794                                                         [% IF ( patron.email ) %]
795                                                             <li>
796                                                                 [% IF ( transfertodo ) %]
797                                                                     [% patron.email | html %]
798                                                                 [% ELSE %]
799                                                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
800                                                                 [% END %]
801                                                             </li>
802                                                         [% END %]
803
804                                                         [% UNLESS ( transfertodo) %]
805                                                             [% INCLUDE display_bormessagepref %]
806                                                         [% END %]
807
808                                                         [% IF ( patron.is_debarred ) %]
809                                                             <li class="error">Patron is RESTRICTED</li>
810                                                         [% END %]
811
812                                                         [% IF ( patron.gonenoaddress ) %]
813                                                             <li class="error">Patron's address is in doubt</li>
814                                                         [% END %]
815                                                     </ul>
816                                                     [% IF ( transfertodo ) %]
817                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
818                                                     [% ELSE %]
819                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
820                                                     [% END %]
821
822                                                     [% FOREACH inputloo IN inputloop %]
823                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
824                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
825                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
826                                                     [% END %]
827
828                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
829                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
830                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
831                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
832                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
833                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
834                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
835                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
836                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
837                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
838                                                     [% INCLUDE all_checkin_messages %]
839                                                 </div>
840
841                                                 <div class="modal-footer">
842                                                     [% IF ( transfertodo ) %]
843                                                         <button type="submit" class="btn btn-default approve" accesskey="y">
844                                                             <i class="fa fa-check"></i> Confirm hold and transfer (Y)
845                                                         </button>
846                                                         <button type="button" class="btn btn-default print" accesskey="p">
847                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm (P)
848                                                         </button>
849                                                     [% ELSE %]
850                                                         <button type="submit" class="btn btn-default approve" accesskey="y">
851                                                             <i class="fa fa-check"></i> Confirm hold (Y)
852                                                         </button>
853                                                         <button type="button" class="btn btn-default print" accesskey="p">
854                                                             <i class="fa fa-print"></i> Print slip and confirm (P)
855                                                         </button>
856                                                     [% END %]
857
858                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny" accesskey="i">
859                                                         <i class="fa fa-times"></i> Ignore (I)
860                                                     </button>
861                                                 </div> <!-- /.modal-footer -->
862                                             </form> <!-- /.confirm -->
863                                         </div> <!-- /.modal-content -->
864                                     </div> <!-- /.modal-dialog -->
865                                 </div> <!-- /#hold-found2 -->
866                             [% END #/IF reserved %]
867
868                             [% IF ( recalled ) %]
869                                 <!-- recalled -->
870                                 <div id="recalled" class="modal fade audio-alert-action block">
871                                     <div class="modal-dialog">
872                                         <div class="modal-content">
873                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
874
875                                                 <div class="modal-header">
876                                                     <h3>
877                                                         Recall found:
878                                                         <br/>
879                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
880                                                         [% IF recall.item %]
881                                                             <div class="recall-found-barcode">
882                                                                 (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
883                                                             </div>
884                                                         [% END %]
885                                                     </h3>
886                                                 </div>
887
888                                                 <div class="modal-body">
889                                                     [% IF ( recall.notes ) %]
890                                                         <h4>Notes:</h4>
891                                                         <p>[% recall.notes | html %]</p>
892                                                         <hr />
893                                                     [% END %]
894                                                     <h5>Recall placed by:</h5>
895                                                     <ul>
896                                                         <li>
897                                                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_recalls" %]
898                                                             <span class="patron-category"> - [% recall.patron.category.description | html %]</span>
899                                                         </li>
900
901                                                         [% INCLUDE display_holdpatron_address patron=recall.patron %]
902
903                                                         [% IF ( recall.patron.phone ) %]
904                                                             <li>[% recall.patron.phone | html %]</li>
905                                                         [% END %]
906
907                                                         [% IF ( recall.patron.email ) %]
908                                                             <li>
909                                                                 [% IF ( transfertodo ) %]
910                                                                     [% recall.patron.email | html %]
911                                                                 [% ELSE %]
912                                                                     <a id="boremail" href="mailto:[% recall.patron.email | html %]">[% recall.patron.email | html %]</a>
913                                                                 [% END %]
914                                                             </li>
915                                                         [% END %]
916
917                                                         [% UNLESS ( transfertodo) %]
918                                                             [% INCLUDE display_bormessagepref %]
919                                                         [% END %]
920
921                                                         [% IF ( recall.patron.is_debarred ) %]
922                                                             <li class="error">Patron is RESTRICTED</li>
923                                                         [% END %]
924
925                                                         [% IF ( recall.patron.gonenoaddress ) %]
926                                                             <li class="error">Patron's address is in doubt</li>
927                                                         [% END %]
928                                                     </ul>
929                                                     [% IF ( transfertodo ) %]
930                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
931                                                     [% ELSE %]
932                                                         <h4><strong>Recall at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
933                                                     [% END %]
934
935                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
936                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
937                                                     <input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
938                                                     <input type="hidden" name="recall_slip" value="0">
939
940                                                 </div>
941
942                                                 <div class="modal-footer">
943                                                     [% IF ( transfertodo ) %]
944                                                         <button type="submit" class="btn btn-default approve">
945                                                             <i class="fa fa-check"></i> Confirm recall and transfer
946                                                         </button>
947                                                         <button type="button" class="btn btn-default print-recall">
948                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
949                                                         </button>
950                                                     [% ELSE %]
951                                                         <button type="submit" class="btn btn-default approve">
952                                                             <i class="fa fa-check"></i> Confirm recall
953                                                         </button>
954                                                         <button type="button" class="btn btn-default print-recall">
955                                                             <i class="fa fa-print"></i> Print slip and confirm
956                                                         </button>
957                                                     [% END %]
958
959                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny">
960                                                         <i class="fa fa-times"></i> Ignore
961                                                     </button>
962                                                 </div> <!-- /.modal-footer -->
963                                             </form> <!-- /.confirm -->
964                                         </div> <!-- /.modal-content -->
965                                     </div> <!-- /.modal-dialog -->
966                                 </div> <!-- /#recalled -->
967                             [% END #/IF recalled %]
968
969                             [% IF ( waitingrecall ) %]
970                                 <!-- recalled -->
971                                 <div id="recalledwaiting" class="modal fade audio-alert-action block">
972                                     <div class="modal-dialog">
973                                         <div class="modal-content">
974                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
975
976                                                 <div class="modal-header">
977                                                     <h3>
978                                                         Recall found (item is already waiting):
979                                                         <br/>
980                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% recall.biblio_id | uri %]">[% recall.biblio.title | html %]</a>
981                                                         [% IF recall.item %]
982                                                             <div class="recall-found-barcode">
983                                                                 (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% recall.biblio_id | uri %]&amp;itemnumber=[% recall.item_id | uri %]">[% recall.item.barcode | html %]</a>)
984                                                             </div>
985                                                         [% END %]
986                                                     </h3>
987                                                 </div>
988
989                                                 <div class="modal-body">
990                                                     [% IF ( recall.notes ) %]
991                                                         <h4>Notes:</h4>
992                                                         <p>[% recall.notes | html %]</p>
993                                                         <hr />
994                                                     [% END %]
995                                                     <h5>Recall placed by:</h5>
996                                                     <ul>
997                                                         <li>
998                                                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_recalls" %]
999                                                             <span class="patron-category"> - [% recall.patron.category.description | html %]</span>
1000                                                         </li>
1001
1002                                                         [% INCLUDE display_holdpatron_address patron=recall.patron %]
1003
1004                                                         [% IF ( recall.patron.phone ) %]
1005                                                             <li>[% recall.patron.phone | html %]</li>
1006                                                         [% END %]
1007
1008                                                         [% IF ( recall.patron.email ) %]
1009                                                             <li>
1010                                                                 [% IF ( transfertodo ) %]
1011                                                                     [% recall.patron.email | html %]
1012                                                                 [% ELSE %]
1013                                                                     <a id="boremail" href="mailto:[% recall.patron.email | html %]">[% recall.patron.email | html %]</a>
1014                                                                 [% END %]
1015                                                             </li>
1016                                                         [% END %]
1017
1018                                                         [% UNLESS ( transfertodo) %]
1019                                                             [% INCLUDE display_bormessagepref %]
1020                                                         [% END %]
1021
1022                                                         [% IF ( recall.patron.is_debarred ) %]
1023                                                             <li class="error">Patron is RESTRICTED</li>
1024                                                         [% END %]
1025
1026                                                         [% IF ( recall.patron.gonenoaddress ) %]
1027                                                             <li class="error">Patron's address is in doubt</li>
1028                                                         [% END %]
1029                                                     </ul>
1030                                                     [% IF ( transfertodo ) %]
1031                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
1032                                                     [% ELSE %]
1033                                                         <h4><strong>Wait for pickup at</strong> [% Branches.GetName( recall.pickup_library_id ) | html %]</h4>
1034                                                     [% END %]
1035
1036                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
1037                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]">
1038                                                     <input type="hidden" name="returnbranch" value="[% Branches.GetLoggedInBranchcode | html %]">
1039                                                     <input type="hidden" name="recall_slip" value="0">
1040
1041                                                 </div>
1042
1043                                                 <div class="modal-footer">
1044                                                     <button type="submit" class="btn btn-default approve">
1045                                                         <i class="fa fa-check"></i> Confirm recall
1046                                                     </button>
1047                                                     <button type="button" class="btn btn-default print-recall">
1048                                                         <i class="fa fa-print"></i> Print slip and confirm
1049                                                     </button>
1050
1051                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny">
1052                                                         <i class="fa fa-times"></i> Ignore
1053                                                     </button>
1054                                                 </div> <!-- /.modal-footer -->
1055                                             </form> <!-- /.confirm -->
1056                                         </div> <!-- /.modal-content -->
1057                                     </div> <!-- /.modal-dialog -->
1058                                 </div> <!-- /#recalledwaiting-->
1059                             [% END #/IF recalledwaiting %]
1060                         [% END # /IF found %]
1061
1062                         <div class="static_checkin_messages">
1063                             [% INCLUDE all_checkin_messages %]
1064                         </div>
1065
1066                         <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
1067                             <fieldset id="circ_returns_checkin">
1068                                 <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>
1069                                 <h1>Check in</h1>
1070                                 <div class="row">
1071                                     <div class="col-sm-6">
1072                                         <div class="hint">Enter item barcode:</div>
1073                                             <div class="form-control-group">
1074                                                 [% IF ( exemptfine ) %]
1075                                                     <input name="barcode" id="barcode" size="14" class="focus input-warning" type="text" />
1076                                                 [% ELSIF ( dropboxmode ) %]
1077                                                     <input name="barcode" id="barcode" size="14" class="barcode focus input-warning" />
1078                                                 [% ELSE %]
1079                                                     <input name="barcode" id="barcode" size="14" class="barcode focus" />
1080                                                 [% END %]
1081                                                 <button type="submit" class="btn btn-default">Check in</button>
1082                                                 [% FOREACH inputloo IN inputloop %]
1083                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
1084                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
1085                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
1086                                                 [% END %]
1087                                             </div>
1088                                         <div id="show-circ-settings">
1089                                             <a href="#"><i class="fa circ-settings-icon fa-caret-down"></i> Checkin settings</a>
1090                                         </div>
1091                                     </div>
1092                                     <div class="col-sm-6">
1093                                         [% IF ( exemptfine ) %]
1094                                             <div id="exemptfines" class="checkin-active-setting">
1095                                         [% ELSE %]
1096                                             <div id="exemptfines" class="checkin-active-setting" style="display:none;">
1097                                         [% END %]
1098                                             <p><i class="fa fa-check"></i> Fines for returned items are forgiven.</p>
1099                                         </div>
1100
1101                                         [% IF ( forgivemanualholdsexpire ) %]
1102                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting">
1103                                         [% ELSE %]
1104                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting" style="display:none;">
1105                                         [% END %]
1106                                                 <p><i class="fa fa-check"></i> Fines are not charged for manually cancelled holds.</p>
1107                                             </div>
1108
1109                                         [% IF ( dropboxmode ) %]
1110                                             <div id="dropboxmode" class="checkin-active-setting">
1111                                         [% ELSE %]
1112                                             <div id="dropboxmode" class="checkin-active-setting" style="display:none;">
1113                                         [% END %]
1114                                             <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>
1115                                         </div>
1116                                         [% IF ( return_date_override_remember ) %]
1117                                             <div id="return_date_remember" class="checkin-active-setting">
1118                                         [% ELSE %]
1119                                             <div id="return_date_remember" class="checkin-active-setting" style="display:none;">
1120                                         [% END %]
1121                                             <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>
1122                                         </div>
1123                                     </div>
1124                                 </div>
1125
1126                                 <div class="circ-settings">
1127                                     [% IF Koha.Preference('SpecifyReturnDate') %]
1128                                         <div class="date-select" id="return_date_override_fields">
1129                                             <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
1130
1131                                             <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" />
1132
1133                                             <div class="circ-setting">
1134                                                 [% IF ( return_date_override_remember ) %]
1135                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" />
1136                                                 [% ELSE %]
1137                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" />
1138                                                 [% END %]
1139                                                 <label for="return_date_override_remember"> Remember return date for next check in</label>
1140                                             </div>
1141                                         </div> <!-- /.date-select -->
1142                                     [% END %]
1143
1144                                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
1145                                         <div id="forgive-overdue-fines" class="circ-setting">
1146                                             [% IF ( exemptfine ) %]
1147                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
1148                                             [% ELSE %]
1149                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
1150                                             [% END %]
1151                                             <label for="exemptcheck">Forgive overdue charges</label>
1152                                         </div>
1153                                     [% END %] <!-- overduecharges -->
1154
1155                                     <div id="book-drop-mode" class="circ-setting">
1156                                         [% IF ( dropboxmode ) %]
1157                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
1158                                         [% ELSE %]
1159                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
1160                                         [% END %]
1161                                         <label for="dropboxcheck">Book drop mode</label>
1162                                     </div>
1163
1164                                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
1165                                         <div class="forgive-manual-hold-fees circ-setting">
1166                                             [% IF ( forgivemanualholdsexpire ) %]
1167                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
1168                                             [% ELSE %]
1169                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
1170                                             [% END %]
1171                                             <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
1172                                         </div>
1173                                     [% END %] <!-- overduecharges -->
1174
1175                                 </div> <!-- /.circ-settings -->
1176                             </fieldset> <!-- /#circ_returns_checkin -->
1177                         </form> <!-- /#checkin-form -->
1178
1179                         [% IF ( riloop ) %]
1180                             <h2>Checked-in items</h2>
1181                             <table id="checkedintable">
1182                                 <thead>
1183                                     <tr>
1184                                         <th class="ci-duedate">Due date</th>
1185                                         <th class="ci-title">Title</th>
1186                                         <th class="ci-author">Author</th>
1187                                         <th class="ci-barcode">Barcode</th>
1188                                         <th class="ci-homelibrary">Home library</th>
1189                                         <th class="ci-transferlibrary">Transfer to</th>
1190                                         <th class="ci-shelvinglocation">Shelving location</th>
1191                                         <th class="ci-callnumber">Call number</th>
1192                                         <th class="ci-dateaccessioned">Date acquired</th>
1193                                         <th class="ci-recordlevelitemtype">Record-level itemtype</th>
1194                                         <th class="ci-itemtype">Item type</th>
1195                                         <th class="ci-collection">Collection</th>
1196                                         <th class="ci-patron">Patron</th>
1197                                         <th class="ci-note">Note</th>
1198                                     </tr>
1199                                 </thead>
1200
1201                                 [% FOREACH riloo IN riloop %]
1202                                     <tr>
1203                                         <td class="ci-duedate">
1204                                             [% IF ( riloo.duedate ) %]
1205                                                 [% IF ( riloo.return_overdue ) %]
1206                                                     <span class="overdue">[% riloo.duedate | html %] (overdue)</span>
1207                                                 [% ELSE %]
1208                                                     [% riloo.duedate | html %]
1209                                                 [% END %]
1210                                             [% ELSE %]
1211                                                 <span>Not checked out</span>
1212                                             [% END %]
1213                                             [% IF ( riloo.damaged ) %]
1214                                                 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => riloo.damaged ) | html %]</span>
1215                                             [% END %]
1216                                         </td>
1217                                         <td class="ci-title">
1218                                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">
1219                                                 [% riloo.itemtitle | html %]
1220                                                 [% FOREACH subtitle IN riloo.subtitle.split(' \\| ') %] <span class="subtitle">[% subtitle | html %]</span>[% END %]
1221                                                 [% FOREACH part_number IN riloo.part_number.split(' \\| ') %] <span class="part_number">[% part_number | html %]</span>[% END %]
1222                                                 [% FOREACH part_name IN riloo.part_name.split(' \\| ') %] <span class="part_name">[% part_name | html %]<span>[% END %]
1223                                             </a>
1224                                             [% IF ( riloo.enumchron ) %]
1225                                                 <br/>
1226                                                 <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron | html %]</span>
1227                                             [% END %]
1228                                         </td>
1229                                         <td class="ci-author">[% riloo.itemauthor | html %]</td>
1230                                         <td class="ci-barcode">
1231                                             <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>
1232                                         </td>
1233                                         <td class="ci-homelibrary">
1234                                             [% Branches.GetName( riloo.homebranch ) | html %]
1235                                         </td>
1236                                         <td class="ci-transferlibrary">
1237                                             [% Branches.GetName( riloo.transferbranch ) | html %]
1238                                         </td>
1239                                         <td class="ci-shelvinglocation">
1240                                             <span class="shelvingloc">[% riloo.location | html %]</span>
1241                                         </td>
1242                                         <td class="ci-callnumber">
1243                                             [% riloo.itemcallnumber | html %]
1244                                         </td>
1245                                         <td class="ci-dateaccessioned">
1246                                             [% riloo.dateaccessioned | $KohaDates %]
1247                                         </td>
1248                                         <td class="ci-recordlevelitemtype">
1249                                             [% ItemTypes.GetDescription( riloo.recordtype ) | html %]
1250                                         </td>
1251                                         <td class="ci-itemtype">
1252                                             [% ItemTypes.GetDescription( riloo.itemtype ) | html %]
1253                                         </td>
1254                                         <td class="ci-collection">
1255                                             [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => riloo.ccode) | html %]
1256                                         </td>
1257                                         <td class="ci-patron">
1258                                             [% IF ( riloo.duedate ) %]
1259                                                 [% INCLUDE 'patron-title.inc' patron=riloo.patron hide_patron_infos_if_needed=1 invert_name=1 %]
1260                                                 [% IF riloo.borissuescount %]
1261                                                     <span class="results_summary nowrap">
1262                                                         <span class="label">Checkouts:</span>
1263                                                         <span class="number_box">
1264                                                             <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">[% riloo.borissuescount | html %]</a>
1265                                                         </span>
1266                                                     </span>
1267                                                 [% END %]
1268                                                 <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>
1269                                             [% ELSE %]
1270                                                 Not checked out
1271                                             [% END %]
1272                                         </td>
1273                                         <td class="ci-note">
1274                                             [% IF ( riloo.patron.borrowernotes ) %]
1275                                                 <p><span class="circ-hlt patron-note">[% riloo.patron.borrowernotes | html %]</span></p>
1276                                             [% END %]
1277                                             [% IF ( riloo.itemnote ) %]
1278                                                 <p><span class="circ-hlt item-note-public">[% riloo.itemnote | html %]</span></p>
1279                                             [% END %]
1280                                             [% IF ( riloo.itemnotes_nonpublic ) %]
1281                                                 <p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic | html %]</span></p>
1282                                             [% END %]
1283                                         </td>
1284                                     </tr>
1285                                 [% END # /FOREACH riloo %]
1286                             </table> <!-- /#checkedintable -->
1287                         [% END # /IF riloop %]
1288
1289                     [% IF Koha.Preference('CircSidebar') %]
1290                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
1291                             <div class="col-sm-2 col-sm-pull-10">
1292                                 <aside>
1293                                     [% INCLUDE 'circ-nav.inc' %]
1294                                 </aside>
1295                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1296                         </div> <!-- /.row -->
1297                     [% ELSE %]
1298                             </div> <!-- /.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 -->
1299                         </div> <!-- /.row -->
1300                     [% END %]
1301
1302                 </main>
1303             </div> <!-- /.col-sm-12 -->
1304         </div> <!-- /.row -->
1305
1306     [% IF ( ReturnClaims ) %]
1307         [% INCLUDE 'modals/resolve_return_claim.inc' %]
1308     [% END %]
1309
1310     [% INCLUDE 'modals/bundle_contents.inc' %]
1311
1312     [% IF ( missing_items ) %]
1313     <!-- Bundle missing modal -->
1314     <div class="modal printable" id="bundleMissingModal" tabindex="-1" role="dialog" aria-labelledby="bundleMissingLabel">
1315         <div class="modal-dialog" role="document">
1316             <div class="modal-content">
1317                 <div class="modal-header">
1318                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1319                     <h4 class="modal-title" id="bundleMissingLabel">Items missing from bundle at checking for [% item.barcode | html %]</h4>
1320                 </div>
1321                 <div class="modal-body">
1322                     <table style="width:100%">
1323                         <thead>
1324                             <tr>
1325                                 <th>Barcode</th>
1326                                 <th>Title</th>
1327                             </tr>
1328                         </thead>
1329                         <tbody>
1330                         [% FOREACH bundle_item IN missing_items %]
1331                             <tr>
1332                                 <td>[% bundle_item.barcode | html %]</td>
1333                                 <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio %]</td>
1334                             </tr>
1335                         [% END %]
1336                         </tbody>
1337                         <tfoot>
1338                         </tfoot>
1339                     </table>
1340                 </div> <!-- /.modal-body -->
1341                 <div class="modal-footer">
1342                     <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1343                     <button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button>
1344                 </div> <!-- /.modal-footer -->
1345             </div> <!-- /.modal-content -->
1346         </div> <!-- /.modal-dialog -->
1347     </div> <!-- /#bundleMissingModal -->
1348     [% END %]
1349
1350 [% MACRO jsinclude BLOCK %]
1351     [% INCLUDE 'datatables.inc' %]
1352     [% INCLUDE 'columns_settings.inc' %]
1353     [% INCLUDE 'calendar.inc' %]
1354     [% Asset.js("js/pages/circulation.js") | $raw %]
1355     [% IF ( ReturnClaims ) %]
1356         <script>
1357             /* Set a variable needed by resolve_claim_modal.js */
1358             var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1359         </script>
1360         [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1361     [% END %]
1362
1363     <script>
1364         function Dopop(link) {
1365             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1366             $("#barcode").focus();
1367         }
1368         $(document).ready(function () {
1369             $("#checkin-form").preventDoubleFormSubmit();
1370             $(".modal.block").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
1371                 $("#barcode").prop("disabled", true);
1372                 $(".show_checkin_dialog").show();
1373             }).on('hidden.bs.modal', function() {
1374                 $("#barcode").prop("disabled", false).focus();
1375             });
1376             $(".modal.noblock").on('show.bs.modal', function() {
1377                 /* If the modal doesn't block further action, the backdrop should be hidden.
1378                    In order for this to happen smoothly we add a class to the body tag which
1379                    targeted in the CSS */
1380                 $("body").addClass("nobackdrop");
1381             }).modal()
1382             .on('shown.bs.modal', function() {
1383                 $("#barcode").prop("disabled", false).focus();
1384             }).on('hidden.bs.modal', function() {
1385                 $("#barcode").prop("disabled", false).focus();
1386             });
1387
1388             $("body").on("click", ".show_checkin_dialog button", function(e){
1389                 e.preventDefault();
1390                 $(".modal").modal("show");
1391             });
1392             [% IF reserve_id %]
1393                 $(".print-slip").on('click', function(e) {
1394                     e.preventDefault();
1395                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1396                 });
1397                 [% IF print_slip %]
1398                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1399                 [% END %]
1400             [% END %]
1401             var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]
1402
1403             [% IF recall_slip %]
1404                 Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% recall_id | uri %]');
1405             [% END %]
1406
1407             var returns_table = KohaTable("checkedintable", {
1408                     "bFilter":false,
1409                     "bPaginate":false,
1410                     "bInfo":false,
1411                     "bSort":false,
1412                     "dom": 'B<"clearfix">t',
1413                     }, table_settings);
1414
1415             $("#exemptcheck").change(function () {
1416                 if (this.checked == true) {
1417                     $("#barcode").addClass("input-warning");
1418                     $("#exemptfines").show();
1419                 } else {
1420                     $("#barcode").removeClass("input-warning");
1421                     $("#exemptfines").hide();
1422                 }
1423                 $("#barcode").focus();
1424             });
1425
1426             $("#dropboxcheck").change(function () {
1427                 if (this.checked == true) {
1428                     $("#barcode").addClass("input-warning");
1429                     $("#dropboxmode").show();
1430
1431                     $("#return_date_override_fields :input").prop('disabled', true);
1432                 } else {
1433                     $("#barcode").removeClass("input-warning");
1434                     $("#dropboxmode").hide();
1435
1436                     $("#return_date_override_fields :input").prop('disabled', false);
1437                 }
1438                 $("#barcode").focus();
1439             });
1440
1441             $("#forgivemanualholdsexpire").change(function () {
1442                 if (this.checked == true) {
1443                     $("#barcode").addClass("input-warning");
1444                     $("#forgivemanualholdsexpire-alert").show();
1445                 } else {
1446                     $("#barcode").removeClass("input-warning");
1447                     $("#forgivemanualholdsexpire-alert").hide();
1448                 }
1449                 $("#barcode").focus();
1450             });
1451
1452             [% IF(overduecharges) %]
1453                 $("#barcode").focus(function () {
1454                     if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
1455                         $("#barcode").addClass("input-warning");
1456                     } else {
1457                         $("#barcode").removeClass("input-warning");
1458                     }
1459                 });
1460                 $("#barcode").blur(function () {
1461                     $("#barcode").removeClass("input-warning");
1462                 });
1463             [% END %]
1464
1465             $('.openWin').on("click",function(e){
1466                 Dopop( $(this).data("url") );
1467             });
1468
1469             $('.submit').on("click",function(e){
1470                 this.form.submit();
1471             });
1472
1473             $('.cancel').on("click",function(e){
1474                 var docancel = $("<input>").attr("type", "hidden").attr("name", "canceltransfer").val(1);
1475                 $('#wrongtransferform').append(docancel);
1476                 this.form.submit();
1477             });
1478
1479             $('.print').on("click",function(e){
1480                 this.form.print_slip.value = 1;
1481                 let barcode = document.getElementById('confirm-hold-barcode');
1482                 if ( barcode ) barcode.remove();
1483                 if ($(this).attr('name') == "dotransfer") {
1484                     var dotransfer = $("<input>").attr("type", "hidden").attr("name", "dotransfer").val("Yes");
1485                     $('#mainform').append(dotransfer);
1486                 }
1487                 this.form.submit();
1488             });
1489
1490             $('.print-recall').on("click",function(e){
1491                 this.form.recall_slip.value = 1;
1492                 this.form.submit();
1493             });
1494
1495             $('.approve').on("click",function(e){
1496                 let barcode = document.getElementById('confirm-hold-barcode');
1497                 if ( barcode ) barcode.remove();
1498                 this.form.submit();
1499             });
1500             $('.cancel-hold').on("click",function(e){
1501                 this.form.cancel_reserve.value = 1;
1502                 this.form.submit();
1503             });
1504
1505             $('.action').on("click",function(e){
1506                 this.checked = false;
1507                 this.form.return_date_override.value = '';
1508                 this.form.return_date_override_remember.checked = false;
1509                 this.form.barcode.focus();
1510                 $("#return_date_remember").hide();
1511                 return false;
1512             });
1513
1514             $("#return_date_override_remember").on("change", function(){
1515                 if( $(this).prop("checked" ) ){
1516                     if( $("#return_date_override").val() == "" ){
1517                         $("#saved_return_date").text( _("No date selected") );
1518                     } else {
1519                         $("#saved_return_date").text( $("#return_date_override").val() );
1520                     }
1521                     $("#return_date_remember").show();
1522                 } else {
1523                     $("#return_date_remember").hide();
1524                 }
1525             });
1526             $('[data-toggle="tooltip"]').tooltip();
1527
1528             $(".printcheckinslip").on("click", function(e){
1529                 e.preventDefault();
1530                 var borrowernumber = $(this).data('borrowernumber');
1531                 window.open("/cgi-bin/koha/members/printslip.pl?borrowernumber=" + borrowernumber + "&amp;print=checkinslip", "printwindow");
1532             });
1533
1534             // item bundles
1535             $('#verify-items-bundle-contents-barcodes').on('input', function (ev) {
1536                 let char = ev.target.value.slice(-1);
1537                 if ( char.match(/\n/) ) {
1538                     const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim() });
1539                     const expected = [];
1540                     let found = 0;
1541                     $('#items-bundle-contents-table tbody > tr').each(function () {
1542                         const barcode = this.getAttribute('data-barcode');
1543                         expected.push(barcode);
1544                         if (barcodes.includes(barcode)) {
1545                             this.classList.add('ok');
1546                             found++;
1547                         } else {
1548                             this.classList.remove('ok');
1549                         }
1550                     });
1551                     const last = barcodes[barcodes.length -2];
1552                     const feedback = $('#bundle-feedback');
1553                     let string;
1554                     if ( !expected.includes(last) ) {
1555                         feedback.fadeOut(100, function(){
1556                             string = _("Unexpected: ") +last;
1557                             feedback.addClass('alert-danger').removeClass('alert-success').html(string).fadeIn(100);
1558                         });
1559                     } else {
1560                         feedback.fadeOut(100, function(){
1561                             string = _("Varified: ")+last;
1562                             feedback.addClass('alert-success').removeClass('alert-danger').html(string).fadeIn(100);
1563                         });
1564                     }
1565                     $('#verify-progress').show();
1566                     $('#verified').text(found);
1567                     $('#expected').text(expected.length);
1568                 }
1569             });
1570
1571             $('.bundle_remove').on('click', function() {
1572                 var component_itemnumber = $(this).data('itemnumber');
1573                 var host_itemnumber = $(this).data('hostnumber');
1574                 var alert = $(this).closest('div');
1575                 var unlink_item_url = "/api/v1/items/" + host_itemnumber + "/bundled_items/item/" + component_itemnumber;
1576                 $.ajax({
1577                     type: "DELETE",
1578                     url: unlink_item_url,
1579                     success: function(){
1580                         alert.remove();
1581                     }
1582                 });
1583             });
1584
1585             $('#items-bundle-contents-table').dataTable($.extend(true, {}, dataTablesDefaults, {
1586                 "bFilter": false,
1587                 "bPaginate": false,
1588                 "bInfo": false,
1589                 "order": [[ 1, 'asc' ], [ 0, 'asc' ]]
1590             }));
1591
1592             // print modals
1593             $('.modal.printable').on('shown.bs.modal', function() {
1594                 $('.modal-dialog', this).addClass('focused');
1595                 $('body').addClass('modalprinter');
1596
1597                 if ($(this).hasClass('autoprint')) {
1598                     window.print();
1599                 }
1600             }).on('hidden.bs.modal', function() {
1601                 $('.modal-dialog', this).removeClass('focused');
1602                 $('body').removeClass('modalprinter');
1603             });
1604
1605             $('.printModal').click(function() {
1606                 window.print();
1607             });
1608         });
1609     </script>
1610
1611 [% END %]
1612
1613 [% INCLUDE 'intranet-bottom.inc' %]