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