Bug 28148: Remove 'print' class from 'Print transfer slip' when transfer exists
[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 'member-display-address-style.inc' %]
10 [% SET footerjs = 1 %]
11 [% BLOCK display_bormessagepref %]
12     [% IF ( bormessagepref ) %]
13         <li class="notification_method">Patron notification:
14             [% FOREACH mtt IN bormessagepref.keys %]
15                 [%~ IF ( mtt == 'email' ) %] Email[% END ~%]
16                 [%~ IF ( mtt == 'phone' ) %] Phone[% END ~%]
17                 [%~ IF ( mtt == 'sms' ) %] SMS[% END ~%]
18                 [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
19             [% END %]
20         </li>
21            [% ELSE %]
22         <li class="notification_method none">Patron is not notified.</li>
23     [% END %]
24 [% END %]
25
26 [% BLOCK display_holdpatron_address %]
27     [% PROCESS 'display-address-style' %]
28 [% END %]
29
30 [% INCLUDE 'doc-head-open.inc' %]
31 <title>Check in [% title | html %] &rsaquo; Circulation &rsaquo; Koha</title>
32 [% INCLUDE 'doc-head-close.inc' %]
33 </head>
34
35 <body id="circ_returns" class="circ">
36     <span class="audio-alert-success"></span>
37
38     [% INCLUDE 'header.inc' %]
39     [% INCLUDE 'checkin-search.inc' %]
40
41     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
42         <ol>
43             <li>
44                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
45             </li>
46             <li>
47                 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
48             </li>
49             <li>
50                 <a href="#" aria-current="page">
51                     Check in
52                 </a>
53             </li>
54         </ol>
55     </nav>
56
57     <div class="main container-fluid">
58         <div class="row">
59             <div class="col-sm-12">
60                 <main>
61                     <div class="row">
62
63                         [% IF Koha.Preference('CircSidebar') %]
64                             <div class="col-sm-10 col-sm-push-2">
65                         [% ELSE %]
66                             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
67                         [% END %]
68
69                         [% BLOCK all_checkin_messages %]
70                             [% IF hold_auto_filled %]
71                                 <div class="dialog message hold-auto-filled">
72                                     [% IF ( reservenotes ) %]
73                                         <h4>Notes: [% reservenotes | html %]</h4>
74                                     [% END %]
75                                     <h3>Hold filled for:</h3>
76                                     <ul>
77                                         <li>
78                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 %]
79                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
80                                         </li>
81
82                                         [% INCLUDE display_holdpatron_address %]
83
84                                         [% IF ( patron.phone ) %]
85                                             <li>[% patron.phone | html %]</li>
86                                         [% END %]
87
88                                         [% IF ( patron.email ) %]
89                                             <li>
90                                                 [% IF ( transfertodo ) %]
91                                                     [% patron.email | html %]
92                                                 [% ELSE %]
93                                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
94                                                 [% END %]
95                                             </li>
96                                         [% END %]
97
98                                         [% UNLESS ( transfertodo) %]
99                                             [% INCLUDE display_bormessagepref %]
100                                         [% END %]
101
102                                         [% IF ( patron.is_debarred ) %]
103                                             <li class="error">Patron is RESTRICTED</li>
104                                         [% END %]
105
106                                         [% IF ( patron.gonenoaddress ) %]
107                                             <li class="error">Patron's address is in doubt</li>
108                                         [% END %]
109                                     </ul>
110
111                                     [% IF ( transfertodo ) %]
112                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
113                                     [% ELSE %]
114                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
115                                     [% END %]
116
117                                     <a href="#" class="btn btn-default print print-slip">
118                                         <i class="fa fa-print"></i> Print
119                                     </a>
120                                 </div> <!-- /.hold-auto-filled -->
121                             [% END # /IF hold_auto_filled %]
122
123                             [% IF ( trigger ) %]
124                                  <div id="transfer-trigger" class="dialog message">
125                                      <h3>Reason for transfer</h3>
126                                      <p>
127                                          [%- SWITCH trigger -%]
128                                              [%- CASE 'Manual' -%]Manual
129                                              [%- CASE 'StockrotationAdvance' -%]Stock rotation advance
130                                              [%- CASE 'StockrotationRepatriation' -%]Stock rotation repatriation
131                                              [%- CASE 'ReturnToHome' -%]Return to home library
132                                              [%- CASE 'ReturnToHolding' -%]Return to holding library
133                                              [%- CASE 'RotatingCollection' -%]Rotating collection
134                                              [%- CASE 'Reserve' -%]Reserve
135                                              [%- CASE 'LostReserve' -%]Lost reserve
136                                              [%- CASE 'CancelReserve' -%]Cancelled reserve
137                                              [%- CASE 'TransferCancellation' -%]Transfer was cancelled whilst in transit
138                                              [%- CASE -%][% trigger | html %]
139                                          [%- END -%]
140                                      </p>
141                                  </div>
142                             [% END %]
143
144                             [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
145                                 <div class="dialog alert">
146                                     <strong>Error:</strong>
147                                     This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
148                                 </div>
149                             [% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
150                                 <div class="dialog alert">
151                                     <strong>Error:</strong>
152                                     The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.
153                                 </div>
154                             [% END %]
155
156                             [% IF additional_materials && !needs_confirm && !multiple_confirmed %]
157                                 <div class="dialog message">
158                                     Note about the accompanying materials: [% additional_materials | html %]
159                                 </div>
160                             [% END %]
161
162                             [% IF ( collectionItemNeedsTransferred ) %]
163                                  <div id="rotating-collection" class="dialog message">
164                                     <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) | html %]</h3>
165                                     <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% item.barcode | html %]: [% title | html %]</a></p>
166                                     <p>This item is part of a rotating collection.</p>
167                                     <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;branchcode=[% collectionBranch | uri %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
168                                 </div>
169                             [% END %]
170
171                             <!-- Patron has added an issue note -->
172                             [% IF ( issue.note) %]
173                                 <div class="dialog message">
174                                     <h1>Patron note</h1>
175                                     <p>[% issue.notedate | $KohaDates %]</p>
176                                     <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber | uri %]"> [% title | html %]</a> [% author | html %]</p>
177                                     <p>[% issue.note | html %]</p>
178                                 </div>
179                             [% END %]
180
181                             <!-- Patron has fines -->
182                             [% IF ( fines ) %]
183                                 <div class="dialog alert">
184                                     <h3>Patron has outstanding fines of [% fines | html %].</h3>
185                                     <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber | uri %]">Make payment</a>.</p>
186                                 </div>
187                             [% END %]
188
189                             <!-- Item has return claim(s) -->
190                             [% IF ( ReturnClaims ) %]
191                                 <div class="dialog alert return-claim">
192                                     <h3>This item has been claimed as returned by:</h3>
193                                     <ul>
194                                         [% FOREACH rc IN ReturnClaims %]
195                                             <li>
196                                                 [% INCLUDE 'patron-title.inc' patron=rc.patron hide_patron_infos_if_needed=1 invert_name=1 %]
197                                             </li>
198                                         [% END %]
199                                     </ul>
200                                 </div>
201                             [% END %]
202
203                             <!-- Patron has waiting holds -->
204                             [% IF ( waiting_holds ) %]
205                                 <div id="awaiting-pickup" class="dialog message">
206                                     <h3>[% INCLUDE 'patron-title.inc' patron=issue.patron hide_patron_infos_if_needed=1 invert_name=1 %] has [% waiting_holds | html %] hold(s) waiting for pickup.</h3>
207                                     <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber | uri %]">Check out to this patron</a>.</p>
208                                 </div>
209                             [% END %]
210
211                             <!-- Patron is restricted and checkin was backdated -->
212                             [% IF return_date_was_overriden && issue.patron.is_debarred %]
213                                 <div id="restricted_backdated" class="dialog message">
214                                     <h3>
215                                         [% INCLUDE 'patron-title.inc' patron=issue.patron hide_patron_infos_if_needed=1 invert_name=1 %]
216                                         is restricted. Please verify this patron should still be restricted.
217                                     </h3>
218                                 </div>
219                             [% END %]
220
221
222                             [% IF ( errmsgloop ) %]
223                                 <div class="dialog alert audio-alert-warning">
224                                     <h3>Check in message</h3>
225                                     [% IF itembiblionumber %]
226                                         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% item.barcode | html %]: [% title | html %]</a></p>
227                                     [% END %]
228                                     [% FOREACH errmsgloo IN errmsgloop %]
229                                         [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
230                                             <p class="problem ret_nflupdate">
231                                                 Not for loan status updated.
232                                                 <br />Old value:
233                                                 [% IF errmsgloo.NotForLoanStatusUpdated.from %]
234                                                     <span class="ret_updatedfrom">
235                                                         [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => errmsgloo.NotForLoanStatusUpdated.from ) | html %].
236                                                     </span>
237                                                 [% ELSE %]
238                                                     Available for loan.
239                                                 [% END %]
240                                                 <br />New value:
241                                                 [% IF errmsgloo.NotForLoanStatusUpdated.to %]
242                                                     <span class="ret_updatedto">
243                                                         [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => errmsgloo.NotForLoanStatusUpdated.to ) | html %].
244                                                     </span>
245                                                 [% ELSE %]
246                                                     Available for loan.
247                                                 [% END %]
248                                             </p>
249                                         [% END %]
250                                         [% IF ( errmsgloo.ItemLocationUpdated ) %]
251                                              <p class="problem ret_location_update">
252                                                  Item shelving location updated.
253                                                 <br />Old value:
254                                                 [% IF errmsgloo.ItemLocationUpdated.from %]
255                                                     [% SET av_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => errmsgloo.ItemLocationUpdated.from ) %]
256                                                     [% IF errmsgloo.ItemLocationUpdated.from == '' %]
257                                                         empty
258                                                     [% ELSIF av_description == '' %]
259                                                         [% errmsgloo.ItemLocationUpdated.from | html %] (No description available)
260                                                     [% ELSE %]
261                                                         [% av_description | html %]
262                                                     [% END %]
263                                                 [% ELSE %]
264                                                     "Blank"
265                                                 [% END %]
266                                                 <br />New value:
267                                                 [% IF errmsgloo.ItemLocationUpdated.to %]
268                                                     [% SET av_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => errmsgloo.ItemLocationUpdated.to ) %]
269                                                     [% IF errmsgloo.ItemLocationUpdated.to == '' %]
270                                                         empty
271                                                     [% ELSIF av_description == '' %]
272                                                         [% errmsgloo.ItemLocationUpdated.to | html %] (Not an authorized value)
273                                                     [% ELSE %]
274                                                         [% av_description | html %]
275                                                     [% END %]
276                                                 [% ELSE %]
277                                                     "Blank"
278                                                 [% END %]
279                                              </p>
280                                         [% END %]
281                                         [% IF ( errmsgloo.badbarcode ) %]
282                                             <p class="problem ret_badbarcode">No item with barcode: [% errmsgloo.msg | html %]</p>
283                                         [% END %]
284                                         [% IF ( errmsgloo.ispermanent ) %]
285                                             <p class="problem ret_ispermenant">Please return item to: [% Branches.GetName( errmsgloo.msg ) | html %]</p>
286                                         [% END %]
287                                         [% IF ( errmsgloo.notissued ) %]
288                                             <p class="problem ret_notissued">Not checked out.</p>
289                                         [% END %]
290                                         [% IF ( errmsgloo.localuse) %]
291                                             <p class="problem ret_localuse">Local use recorded</p>
292                                         [% END %]
293                                         [% IF ( errmsgloo.transferred ) %]
294                                             <p class="problem ret_transferred">Item received from [% Branches.GetName( errmsgloo.transferred ) | html %]</p>
295                                         [% END %]
296                                         [% IF ( errmsgloo.waslost ) %]
297                                             [% IF Koha.Preference('BlockReturnOfLostItems') %]
298                                                 <p class="problem ret_blocked">Item is lost, cannot be checked in.</p>
299                                             [% ELSE %]
300                                                 <p class="problem ret_checkedin">Item was lost, now found.</p>
301                                             [% END %]
302                                             [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
303                                                 <p class="problem ret_refund">A refund has been applied to the borrowing patron's account.</p>
304                                             [% ELSIF LostItemFeeCharged and not Koha.Preference('BlockReturnOfLostItems') %]
305                                                 <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>
306                                             [% ELSIF LostItemFeeRestored and not Koha.Preference('BlockReturnOfLostItems') %]
307                                                 <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>
308                                             [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
309                                                <h5>Cannot check in</h5>
310                                                <p><strong>NOT CHECKED IN</strong></p>
311                                             [% ELSE %]
312                                                 <p class="problem ret_feeremains">Any lost item fees for this item will remain on the patron's account.</p>
313                                             [% END %]
314                                         [% END %]
315                                         [% IF ( errmsgloo.withdrawn ) %]
316                                             [% IF Koha.Preference('BlockReturnOfWithdrawnItems') %]
317                                                <h5>Cannot check in</h5>
318                                                <p><strong>NOT CHECKED IN</strong></p>
319                                             [% END %]
320                                            <p class="problem ret_withdrawn">
321                                                <span>Item has been withdrawn</span>
322                                                [% item_withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
323                                                [% IF (item_withdrawn_lib) %]<span class="ci-withdrawn">([% item_withdrawn_lib | html %])</span>[% END %]
324                                            </p>
325                                         [% END %]
326                                         [% IF ( errmsgloo.debarred ) %]
327                                             <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>
328                                         [% END %]
329                                         [% IF ( errmsgloo.prevdebarred ) %]
330                                             <p class="problem ret_prevdebarred"><strong>Reminder: </strong>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
331                                         [% END %]
332                                         [% IF ( errmsgloo.foreverdebarred ) %]
333                                             <p class="problem ret_foreverdebarred"><strong>Reminder: </strong>Patron has an indefinite restriction.</p>
334                                         [% END %]
335                                         [% IF errmsgloo.data_corrupted %]
336                                             <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>
337                                         [% END %]
338                                     [% END # /FOREACH errmsgloo %]
339                                 </div> <!-- /.dialog.dialog-alert -->
340                             [% END #/IF errmsgloop %]
341
342                             [% IF ( checkinmsg ) %]
343                                 [% IF ( checkinmsgtype == 'alert' ) %]
344                                     <div class="dialog alert">
345                                 [% ELSE %]
346                                     <div class="dialog message">
347                                 [% END %]
348                                         <p class="problem ret_checkinmsg">[% checkinmsg | html_line_break %]</p>
349                                     </div>
350                             [% END # /IF checkinmsg %]
351                         [% END # /BLOCK all_checkin_messages %]
352
353                         [% IF needs_confirm %]
354                             <div id="circ-needsconfirmation-modal" class="modal fade audio-alert-action block">
355                                 <div class="modal-dialog">
356                                     <div class="modal-content">
357                                         <div class="modal-header">
358                                             <h3>Please confirm checkin</h3>
359                                         </div>
360                                         <div class="modal-body">
361                                             <ul>
362                                                 <li>
363                                                     Please confirm that the accompanying materials are present: <strong>[% additional_materials | html %]</strong>
364                                                 </li>
365                                             </ul>
366                                         </div>
367                                         <div class="modal-footer">
368                                             <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
369                                                 <input type="hidden" name="barcode" value="[% item.barcode | html %]" />
370                                                 <input type="hidden" name="multiple_confirm" value="1" />
371                                                 [% FOREACH inputloo IN inputloop %]
372                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
373                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
374                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
375                                                 [% END %]
376                                                 <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, checkin (Y)</button>
377                                             </form>
378                                             <button type="button" data-dismiss="modal" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't checkin (N)</button>
379                                         </div>
380                                     </div>
381                                 </div>
382                             </div>
383                         [% END %]
384
385                         [% IF wrongbranch %]
386                             <div id="wrong-branch-modal" class="modal fade audio-alert-action block">
387                                 <div class="modal-dialog">
388                                     <div class="modal-content">
389                                         <form method="post" action="returns.pl" name="mainform" id="mainform">
390                                             <div class="modal-header">
391                                                 <h3>
392                                                     Cannot check in
393                                                 </h3>
394                                             </div>
395                                             <div class="modal-body">
396                                                 <p>
397                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
398                                                         [% item.barcode | html %]: [% title | html %]
399                                                     </a>
400                                                 </p>
401                                                 <p>
402                                                     <strong>
403                                                         NOT CHECKED IN
404                                                     </strong>
405                                                 </p>
406                                                 <p>
407                                                     This item must be checked in at following library:
408                                                     <strong>
409                                                         [% Branches.GetName( rightbranch ) | html %]
410                                                     </strong>
411                                                 </p>
412                                                 [% INCLUDE all_checkin_messages %]
413                                             </div> <!-- /.modal-body -->
414                                             <div class="modal-footer">
415                                                 <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
416                                             </div>
417                                         </form> <!-- /#mainform -->
418                                     </div> <!-- /.modal-content -->
419                                 </div> <!-- /.modal-dialog -->
420                             </div> <!-- /#wrong-branch-modal -->
421                         [% END # /IF wrongbranch %]
422
423                         <!-- case of a mistake in transfer loop -->
424                         [% UNLESS ( hold_auto_filled && diffbranch ) %]
425                             [% IF WrongTransfer && !transfertodo %]
426                                 [% IF Koha.Preference('TransfersBlockCirc') %]
427                                     <div id="wrong-transfer-modal" class="modal fade audio-alert-action block">
428                                 [% ELSE %]
429                                     <div id="wrong-transfer-modal" class="modal fade audio-alert-action noblock">
430                                 [% END %]
431                                     <div class="modal-dialog">
432                                         <div class="modal-content">
433                                             <div class="modal-header">
434                                                 <h3>
435                                                     Please return item to: [% Branches.GetName( TransferWaitingAt ) | html %]
436                                                 </h3>
437                                             </div>
438                                             <div class="modal-body">
439                                                 <p>
440                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
441                                                         [% item.barcode | html %]: [% title | html %]
442                                                     </a>
443                                                 </p>
444                                                 [% INCLUDE all_checkin_messages %]
445                                             </div>
446                                             <div class="modal-footer">
447                                                 <!-- CONFIRM -->
448                                                 <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
449                                                 <!-- PRINT SLIP -->
450                                                 <button type="button" data-dismiss="modal" class="btn btn-default openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;&amp;branchcode=[% TransferWaitingAt | uri %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
451                                                 <!-- CANCEL TRANSFER -->
452                                                 <form method="post" action="returns.pl" name="mainform">
453                                                     <button class="btn btn-default deny" type="submit"><i class="fa fa-times"></i> Cancel transfer</button>
454                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
455                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
456                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
457                                                     <input type="hidden" name="canceltransfer" value="1" />
458                                                     [% FOREACH inputloo IN inputloop %]
459                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
460                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
461                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
462                                                     [% END %]
463                                                 </form> <!-- /mainform -->
464                                             </div> <!-- /.modal-footer -->
465                                         </div> <!-- /.modal-content -->
466                                     </div> <!-- /.modal-dialog -->
467                                 </div> <!-- /#wrong-transfer-modal -->
468                             [% END # /IF WrongTransfer && !transfertodo %]
469                         [% END # /UNLESS hold_auto_filled && diffbranch %]
470
471                         [% IF ( found ) %]
472                             [% IF ( waiting ) %]
473                                 <div id="hold-found1" class="modal fade audio-alert-action block">
474                                     <div class="modal-dialog">
475                                         <div class="modal-content">
476                                             <form method="post" action="returns.pl" class="confirm">
477                                                 <div class="modal-header">
478                                                     <h3>
479                                                         Hold found (item is already waiting):
480                                                         <br/>
481                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
482                                                         <div class="hold-found-barcode">
483                                                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>
484                                                         </div>
485                                                     </h3>
486                                                 </div>
487
488                                                 <div class="modal-body">
489                                                     [% IF ( reservenotes ) %]
490                                                         <h4>Notes: [% reservenotes | html %]</h4>
491                                                     [% END %]
492
493                                                     <h4>Hold for:</h4>
494                                                     <ul>
495                                                         <li>
496                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
497                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
498                                                         </li>
499                                                         [% INCLUDE display_holdpatron_address %]
500                                                         [% IF ( patron.phone ) %]
501                                                             <li> [% patron.phone | html %]</li>
502                                                         [% END %]
503
504                                                         [% IF ( patron.email ) %]
505                                                             <li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li>
506                                                         [% END %]
507
508                                                         [% IF ( patron.is_debarred ) %]
509                                                             <li class="error">Patron is RESTRICTED</li>
510                                                         [% END %]
511
512                                                         [% IF ( patron.gonenoaddress ) %]
513                                                             <li class="error">Patron's address is in doubt</li>
514                                                         [% END %]
515                                                     </ul>
516
517                                                     [% IF ( transfertodo ) %]
518                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
519                                                     [% ELSE %]
520                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
521                                                     [% END %]
522
523                                                     [% FOREACH inputloo IN inputloop %]
524                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
525                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
526                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
527                                                     [% END %]
528
529                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
530                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
531                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
532                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
533                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
534                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
535                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
536                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
537
538                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
539                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
540                                                     [% INCLUDE all_checkin_messages %]
541                                                 </div> <!-- /.modal-body -->
542
543                                                 <div class="modal-footer">
544                                                     <input type="hidden" name="cancel_reserve" value="0" />
545                                                     <input id="confirm-hold-barcode" type="hidden" name="barcode" value="[% barcode | html %]" />
546
547                                                     <button type="submit" class="btn btn-default approve" data-dismiss="modal">
548                                                         <i class="fa fa-check"></i> Confirm hold
549                                                     </button>
550
551                                                     <input type="hidden" name="print_slip" value="0" />
552                                                     <button type="button" class="btn btn-default print">
553                                                         <i class="fa fa-print"></i> Print slip and confirm
554                                                     </button>
555
556                                                     <button type="button" class="btn btn-default deny cancel-hold">
557                                                         <i class="fa fa-times"></i> Cancel hold
558                                                     </button>
559                                                 </div> <!-- /.modal-footer -->
560                                             </form> <!-- /.confirm -->
561                                         </div> <!-- /.modal-content -->
562                                     </div> <!-- /.modal-dialog -->
563                                 </div> <!-- /#hold-found1 -->
564                             [% END # /IF waiting %]
565
566                             [% IF transfer || needstransfer %]
567                                 [% IF Koha.Preference('TransfersBlockCirc') %]
568                                     <div id="item-transfer-modal" class="modal fade audio-alert-action block">
569                                 [% ELSE %]
570                                     <div id="item-transfer-modal" class="modal fade audio-alert-action noblock">
571                                 [% END %]
572                                     <div class="modal-dialog">
573                                         <div class="modal-content">
574                                             <form method="post" action="returns.pl" name="mainform" id="mainform">
575
576                                                 <input type="hidden" name="print_slip" value="0" />
577
578                                                 <div class="modal-header">
579                                                     <h3>
580                                                         Please return this item to [% IF transfer %][% Branches.GetName( transfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
581                                                     </h3>
582                                                 </div>
583                                                 <div class="modal-body">
584                                                     <p>
585                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
586                                                             [% item.barcode | html %]: [% title | html %]
587                                                         </a>
588                                                     </p>
589                                                     [% IF !transfer %]
590                                                         <p>
591                                                             Transfer now?
592                                                         </p>
593                                                     [% END %]
594                                                     <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
595                                                     <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
596                                                     <input type="hidden" name="barcode" value="0" />
597                                                     <input type="hidden" name="trigger" value="[% trigger | html %]" />
598                                                     [% INCLUDE all_checkin_messages %]
599                                                 </div>
600                                                 <div class="modal-footer">
601                                                     [% IF !transfer %]
602                                                         <button type="submit" name="dotransfer" value="Yes" class="btn btn-default approve"><i class="fa fa-check"></i> Yes</button>
603                                                         <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>
604                                                         <button type="button" data-dismiss="modal" class="btn btn-default deny" name="notransfer" value="No"><i class="fa fa-times"></i> No</button>
605                                                     [% ELSE %]
606                                                         <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
607                                                         <button type="button" data-dismiss="modal" name="dotransfer" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;branchcode=[% transfer | uri %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button>
608                                                     [% END %]
609                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
610                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
611                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
612                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
613                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
614                                                     [% FOREACH inputloo IN inputloop %]
615                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
616                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
617                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
618                                                     [% END %]
619                                                 </div> <!-- /.modal-footer -->
620                                             </form> <!-- /#mainform -->
621                                         </div> <!-- /.modal-content -->
622                                     </div> <!-- /.modal-dialog -->
623                                 </div> <!-- /#item-transfer-modal -->
624                             [% END # /IF transfer || needstransfer %]
625
626                             <!-- case of simple return no issue or transfer but with a reservation  -->
627                             [% IF ( reserved ) %]
628                                 <!-- reserved -->
629                                 <div id="hold-found2" class="modal fade audio-alert-action block">
630                                     <div class="modal-dialog">
631                                         <div class="modal-content">
632                                             <form method="post" action="returns.pl" class="confirm">
633
634                                                 <input type="hidden" name="print_slip" value="0" />
635
636                                                 <div class="modal-header">
637                                                     <h3>
638                                                         Hold found:
639                                                         <br/>
640                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
641                                                         <div class="hold-found-barcode">
642                                                             (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>)
643                                                         </div>
644                                                     </h3>
645                                                 </div>
646
647                                                 <div class="modal-body">
648                                                     [% IF ( reservenotes ) %]
649                                                         <h4>Notes:</h4>
650                                                         <p>[% reservenotes | html %]</p>
651                                                         <hr />
652                                                     [% END %]
653                                                     <h5>Hold for:</h5>
654                                                     <ul>
655                                                         <li>
656                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
657                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
658                                                         </li>
659
660                                                         [% INCLUDE display_holdpatron_address %]
661
662                                                         [% IF ( patron.phone ) %]
663                                                             <li>[% patron.phone | html %]</li>
664                                                         [% END %]
665
666                                                         [% IF ( patron.email ) %]
667                                                             <li>
668                                                                 [% IF ( transfertodo ) %]
669                                                                     [% patron.email | html %]
670                                                                 [% ELSE %]
671                                                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
672                                                                 [% END %]
673                                                             </li>
674                                                         [% END %]
675
676                                                         [% UNLESS ( transfertodo) %]
677                                                             [% INCLUDE display_bormessagepref %]
678                                                         [% END %]
679
680                                                         [% IF ( patron.is_debarred ) %]
681                                                             <li class="error">Patron is RESTRICTED</li>
682                                                         [% END %]
683
684                                                         [% IF ( patron.gonenoaddress ) %]
685                                                             <li class="error">Patron's address is in doubt</li>
686                                                         [% END %]
687                                                     </ul>
688                                                     [% IF ( transfertodo ) %]
689                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
690                                                     [% ELSE %]
691                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
692                                                     [% END %]
693
694                                                     [% FOREACH inputloo IN inputloop %]
695                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
696                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
697                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
698                                                     [% END %]
699
700                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
701                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
702                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
703                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
704                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
705                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
706                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
707                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
708                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
709                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
710                                                     [% INCLUDE all_checkin_messages %]
711                                                 </div>
712
713                                                 <div class="modal-footer">
714                                                     [% IF ( transfertodo ) %]
715                                                         <button type="submit" class="btn btn-default approve">
716                                                             <i class="fa fa-check"></i> Confirm hold and transfer
717                                                         </button>
718                                                         <button type="button" class="btn btn-default print">
719                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
720                                                         </button>
721                                                     [% ELSE %]
722                                                         <button type="submit" class="btn btn-default approve">
723                                                             <i class="fa fa-check"></i> Confirm hold
724                                                         </button>
725                                                         <button type="button" class="btn btn-default print">
726                                                             <i class="fa fa-print"></i> Print slip and confirm
727                                                         </button>
728                                                     [% END %]
729
730                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny">
731                                                         <i class="fa fa-times"></i> Ignore
732                                                     </button>
733                                                 </div> <!-- /.modal-footer -->
734                                             </form> <!-- /.confirm -->
735                                         </div> <!-- /.modal-content -->
736                                     </div> <!-- /.modal-dialog -->
737                                 </div> <!-- /#hold-found2 -->
738                             [% END #/IF reserved %]
739                         [% END # /IF found %]
740
741                         <div class="static_checkin_messages">
742                             [% INCLUDE all_checkin_messages %]
743                         </div>
744
745                         <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
746                             <fieldset id="circ_returns_checkin">
747                                 <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>
748                                 <h3>Check in</h3>
749                                 <div class="row">
750                                     <div class="col-sm-6">
751                                         <div class="hint">Enter item barcode:</div>
752                                             <div class="form-control-group">
753                                                 [% IF ( exemptfine ) %]
754                                                     <input name="barcode" id="barcode" size="14" class="focus input-warning" type="text" />
755                                                 [% ELSIF ( dropboxmode ) %]
756                                                     <input name="barcode" id="barcode" size="14" class="barcode focus input-warning" />
757                                                 [% ELSE %]
758                                                     <input name="barcode" id="barcode" size="14" class="barcode focus" />
759                                                 [% END %]
760                                                 <button type="submit" class="btn btn-default">Check in</button>
761                                                 [% FOREACH inputloo IN inputloop %]
762                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
763                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
764                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
765                                                 [% END %]
766                                             </div>
767                                         <div id="show-circ-settings">
768                                             <a href="#"><i class="fa circ-settings-icon fa-caret-down"></i> Checkin settings</a>
769                                         </div>
770                                     </div>
771                                     <div class="col-sm-6">
772                                         [% IF ( exemptfine ) %]
773                                             <div id="exemptfines" class="checkin-active-setting">
774                                         [% ELSE %]
775                                             <div id="exemptfines" class="checkin-active-setting" style="display:none;">
776                                         [% END %]
777                                             <p><i class="fa fa-check"></i> Fines for returned items are forgiven.</p>
778                                         </div>
779
780                                         [% IF ( forgivemanualholdsexpire ) %]
781                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting">
782                                         [% ELSE %]
783                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting" style="display:none;">
784                                         [% END %]
785                                                 <p><i class="fa fa-check"></i> Fines are not charged for manually cancelled holds.</p>
786                                             </div>
787
788                                         [% IF ( dropboxmode ) %]
789                                             <div id="dropboxmode" class="checkin-active-setting">
790                                         [% ELSE %]
791                                             <div id="dropboxmode" class="checkin-active-setting" style="display:none;">
792                                         [% END %]
793                                             <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>
794                                         </div>
795                                         [% IF ( return_date_override_remember ) %]
796                                             <div id="return_date_remember" class="checkin-active-setting">
797                                         [% ELSE %]
798                                             <div id="return_date_remember" class="checkin-active-setting" style="display:none;">
799                                         [% END %]
800                                             <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>
801                                         </div>
802                                     </div>
803                                 </div>
804
805                                 <div class="circ-settings">
806                                     [% IF Koha.Preference('SpecifyReturnDate') %]
807                                         <div class="date-select" id="return_date_override_fields">
808                                             <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
809
810                                             <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" />
811
812
813
814                                             <button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button>
815                                             <div class="circ-setting">
816                                                 [% IF ( return_date_override_remember ) %]
817                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" />
818                                                 [% ELSE %]
819                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" />
820                                                 [% END %]
821                                                 <label for="return_date_override_remember"> Remember return date for next check in</label>
822                                             </div>
823                                         </div> <!-- /.date-select -->
824                                     [% END %]
825
826                                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
827                                         <div id="forgive-overdue-fines" class="circ-setting">
828                                             [% IF ( exemptfine ) %]
829                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
830                                             [% ELSE %]
831                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
832                                             [% END %]
833                                             <label for="exemptcheck">Forgive overdue charges</label>
834                                         </div>
835                                     [% END %] <!-- overduecharges -->
836
837                                     <div id="book-drop-mode" class="circ-setting">
838                                         [% IF ( dropboxmode ) %]
839                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
840                                         [% ELSE %]
841                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
842                                         [% END %]
843                                         <label for="dropboxcheck">Book drop mode</label>
844                                     </div>
845
846                                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
847                                         <div class="forgive-manual-hold-fees circ-setting">
848                                             [% IF ( forgivemanualholdsexpire ) %]
849                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
850                                             [% ELSE %]
851                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
852                                             [% END %]
853                                             <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
854                                         </div>
855                                     [% END %] <!-- overduecharges -->
856
857                                 </div> <!-- /.circ-settings -->
858                             </fieldset> <!-- /#circ_returns_checkin -->
859                         </form> <!-- /#checkin-form -->
860
861                         [% IF ( riloop ) %]
862                             <h2>Checked-in items</h2>
863                             <table id="checkedintable">
864                                 <thead>
865                                     <tr>
866                                         <th class="ci-duedate">Due date</th>
867                                         <th class="ci-title">Title</th>
868                                         <th class="ci-author">Author</th>
869                                         <th class="ci-barcode">Barcode</th>
870                                         <th class="ci-homelibrary">Home library</th>
871                                         <th class="ci-holdinglibrary">Holding library</th>
872                                         <th class="ci-shelvinglocation">Shelving location</th>
873                                         <th class="ci-callnumber">Call number</th>
874                                         <th class="ci-dateaccessioned">Date acquired</th>
875                                         <th class="ci-recordlevelitemtype">Record-level itemtype</th>
876                                         <th class="ci-itemtype">Item type</th>
877                                         <th class="ci-collection">Collection</th>
878                                         <th class="ci-patron">Patron</th>
879                                         <th class="ci-note">Note</th>
880                                     </tr>
881                                 </thead>
882
883                                 [% FOREACH riloo IN riloop %]
884                                     <tr>
885                                         <td class="ci-duedate">
886                                             [% IF ( riloo.duedate ) %]
887                                                 [% IF ( riloo.return_overdue ) %]
888                                                     <span class="overdue">[% riloo.duedate | html %] (overdue)</span>
889                                                 [% ELSE %]
890                                                     [% riloo.duedate | html %]
891                                                 [% END %]
892                                             [% ELSE %]
893                                                 Not checked out
894                                             [% END %]
895                                             [% IF ( riloo.damaged ) %]
896                                                 <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => riloo.damaged ) | html %]</span>
897                                             [% END %]
898                                         </td>
899                                         <td class="ci-title">
900                                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">
901                                                 [% riloo.itemtitle | html %]
902                                                 [% FOREACH subtitle IN riloo.subtitle.split(' \\| ') %] <span class="subtitle">[% subtitle | html %]</span>[% END %]
903                                                 [% FOREACH part_number IN riloo.part_number.split(' \\| ') %] <span class="part_number">[% part_number | html %]</span>[% END %]
904                                                 [% FOREACH part_name IN riloo.part_name.split(' \\| ') %] <span class="part_name">[% part_name | html %]<span>[% END %]
905                                             </a>
906                                             [% IF ( riloo.enumchron ) %]
907                                                 <br/>
908                                                 <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron | html %]</span>
909                                             [% END %]
910                                         </td>
911                                         <td class="ci-author">[% riloo.itemauthor | html %]</td>
912                                         <td class="ci-barcode">
913                                             <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>
914                                         </td>
915                                         <td class="ci-homelibrary">
916                                             [% Branches.GetName( riloo.homebranch ) | html %]
917                                         </td>
918                                         <td class="ci-holdinglibrary">
919                                             [% Branches.GetName( riloo.holdingbranch ) | html %]
920                                         </td>
921                                         <td class="ci-shelvinglocation">
922                                             <span class="shelvingloc">[% riloo.location | html %]</span>
923                                         </td>
924                                         <td class="ci-callnumber">
925                                             [% riloo.itemcallnumber | html %]
926                                         </td>
927                                         <td class="ci-dateaccessioned">
928                                             [% riloo.dateaccessioned | $KohaDates %]
929                                         </td>
930                                         <td class="ci-recordlevelitemtype">
931                                             [% ItemTypes.GetDescription( riloo.recordtype ) | html %]
932                                         </td>
933                                         <td class="ci-itemtype">
934                                             [% ItemTypes.GetDescription( riloo.itemtype ) | html %]
935                                         </td>
936                                         <td class="ci-collection">
937                                             [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => riloo.ccode) | html %]
938                                         </td>
939                                         <td class="ci-patron">
940                                             [% IF ( riloo.duedate ) %]
941                                                 [% INCLUDE 'patron-title.inc' patron=riloo.patron hide_patron_infos_if_needed=1 invert_name=1 %]
942                                                 [% IF riloo.borissuescount %]
943                                                     <span class="results_summary nowrap">
944                                                         <span class="label">Checkouts:</span>
945                                                         <span class="number_box">
946                                                             <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">[% riloo.borissuescount | html %]</a>
947                                                         </span>
948                                                     </span>
949                                                 [% END %]
950                                                 <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>
951                                             [% ELSE %]
952                                                 Not checked out
953                                             [% END %]
954                                         </td>
955                                         <td class="ci-note">
956                                             [% IF ( riloo.patron.borrowernotes ) %]
957                                                 <p><span class="circ-hlt patron-note">[% riloo.patron.borrowernotes | html %]</span></p>
958                                             [% END %]
959                                             [% IF ( riloo.itemnote ) %]
960                                                 <p><span class="circ-hlt item-note-public">[% riloo.itemnote | html %]</span></p>
961                                             [% END %]
962                                             [% IF ( riloo.itemnotes_nonpublic ) %]
963                                                 <p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic | html %]</span></p>
964                                             [% END %]
965                                         </td>
966                                     </tr>
967                                 [% END # /FOREACH riloo %]
968                             </table> <!-- /#checkedintable -->
969                         [% END # /IF riloop %]
970
971                     [% IF Koha.Preference('CircSidebar') %]
972                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
973                             <div class="col-sm-2 col-sm-pull-10">
974                                 <aside>
975                                     [% INCLUDE 'circ-nav.inc' %]
976                                 </aside>
977                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
978                         </div> <!-- /.row -->
979                     [% ELSE %]
980                             </div> <!-- /.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 -->
981                         </div> <!-- /.row -->
982                     [% END %]
983
984                 </main>
985             </div> <!-- /.col-sm-12 -->
986         </div> <!-- /.row -->
987
988 [% MACRO jsinclude BLOCK %]
989     [% INCLUDE 'datatables.inc' %]
990     [% INCLUDE 'columns_settings.inc' %]
991     [% INCLUDE 'calendar.inc' %]
992     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
993     [% Asset.js("js/pages/circulation.js") | $raw %]
994     [% INCLUDE 'timepicker.inc' %]
995
996     <script>
997         function Dopop(link) {
998             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
999             $("#barcode").focus();
1000         }
1001         $(document).ready(function () {
1002             $("#checkin-form").preventDoubleFormSubmit();
1003             $(".modal.block").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
1004                 $("#barcode").prop("disabled", true);
1005                 $(".show_checkin_dialog").show();
1006             }).on('hidden.bs.modal', function() {
1007                 $("#barcode").prop("disabled", false).focus();
1008             });
1009             $(".modal.noblock").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
1010                 $("#barcode").prop("disabled", false).focus();
1011             }).on('hidden.bs.modal', function() {
1012                 $("#barcode").prop("disabled", false).focus();
1013             });
1014
1015             $("body").on("click", ".show_checkin_dialog button", function(e){
1016                 e.preventDefault();
1017                 $(".modal").modal("show");
1018             });
1019             [% IF reserve_id %]
1020                 $(".print-slip").on('click', function(e) {
1021                     e.preventDefault();
1022                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1023                 });
1024                 [% IF print_slip %]
1025                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
1026                 [% END %]
1027             [% END %]
1028             var columns_settings = [% TablesSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]
1029             var returns_table = KohaTable("checkedintable", {
1030                     "bFilter":false,
1031                     "bPaginate":false,
1032                     "bInfo":false,
1033                     "bSort":false,
1034                     "dom": 'B<"clearfix">t',
1035                     }, columns_settings);
1036
1037             $("#return_date_override").datetimepicker({
1038                 onClose: function(dateText, inst) {
1039                     if (validate_date(dateText, inst) ) {
1040                         $("#barcode").focus();
1041                     }
1042                 },
1043                 defaultDate: -1,
1044                 hour: 23,
1045                 minute: 59,
1046                 maxDate: 0
1047             }).on("change", function(e, value) {
1048                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
1049             });
1050             $("#return_date_override").on("blur", function() {
1051                 check_valid_return_date();
1052             });
1053             $("#checkin-form").submit(function( event ) {
1054                 if ( !check_valid_return_date() ) {
1055                     event.preventDefault();
1056                 }
1057             });
1058
1059             function check_valid_return_date() {
1060                 if ( $("#return_date_override").val() ) {
1061                     var datetime = DateTime_from_syspref( $("#return_date_override").val() );
1062                     var now = new Date();
1063                     if ( !datetime || datetime > now ) {
1064                         alert("Invalid return date/time!");
1065                         $("#return_date_override").val("")
1066                         return false;
1067                     }
1068                 }
1069                 // Add saved date information to onscreen message, which
1070                 // may or may not be hidden
1071                 $("#saved_return_date").text( $("#return_date_override").val() );
1072                 return true;
1073             }
1074
1075             $("#exemptcheck").change(function () {
1076                 if (this.checked == true) {
1077                     $("#barcode").addClass("input-warning");
1078                     $("#exemptfines").show();
1079                 } else {
1080                     $("#barcode").removeClass("input-warning");
1081                     $("#exemptfines").hide();
1082                 }
1083                 $("#barcode").focus();
1084             });
1085             $("#dropboxcheck").change(function () {
1086                 if (this.checked == true) {
1087                     $("#barcode").addClass("input-warning");
1088                     $("#dropboxmode").show();
1089
1090                     $("#return_date_override_fields :input").prop('disabled', true);
1091                     $("#return_date_override").datetimepicker("disable");
1092                 } else {
1093                     $("#barcode").removeClass("input-warning");
1094                     $("#dropboxmode").hide();
1095
1096                     $("#return_date_override_fields :input").prop('disabled', false);
1097                     $("#return_date_override").datetimepicker("enable");
1098                 }
1099                 $("#barcode").focus();
1100             });
1101             $("#forgivemanualholdsexpire").change(function () {
1102                 if (this.checked == true) {
1103                     $("#barcode").addClass("input-warning");
1104                     $("#forgivemanualholdsexpire-alert").show();
1105                 } else {
1106                     $("#barcode").removeClass("input-warning");
1107                     $("#forgivemanualholdsexpire-alert").hide();
1108                 }
1109                 $("#barcode").focus();
1110             });
1111
1112             [% IF(overduecharges) %]
1113                 $("#barcode").focus(function () {
1114                     if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
1115                         $("#barcode").addClass("input-warning");
1116                     } else {
1117                         $("#barcode").removeClass("input-warning");
1118                     }
1119                 });
1120                 $("#barcode").blur(function () {
1121                     $("#barcode").removeClass("input-warning");
1122                 });
1123             [% END %]
1124
1125             $('.openWin').on("click",function(e){
1126                 Dopop( $(this).data("url") );
1127             });
1128
1129             $('.print').on("click",function(e){
1130                 this.form.print_slip.value = 1;
1131                 let barcode = document.getElementById('confirm-hold-barcode');
1132                 if ( barcode ) barcode.remove();
1133                 if ($(this).attr('name') == "dotransfer") {
1134                     var dotransfer = $("<input>").attr("type", "hidden").attr("name", "dotransfer").val("Yes");
1135                     $('#mainform').append(dotransfer);
1136                 }
1137                 this.form.submit();
1138             });
1139
1140             $('.cancel-hold').on("click",function(e){
1141                 this.form.cancel_reserve.value = 1;
1142                 this.form.submit();
1143             });
1144
1145             $('.action').on("click",function(e){
1146                 this.checked = false;
1147                 this.form.return_date_override.value = '';
1148                 this.form.return_date_override_remember.checked = false;
1149                 this.form.barcode.focus();
1150                 $("#return_date_remember").hide();
1151                 return false;
1152             });
1153
1154             $("#return_date_override_remember").on("change", function(){
1155                 if( $(this).prop("checked" ) ){
1156                     if( $("#return_date_override").val() == "" ){
1157                         $("#saved_return_date").text( _("No date selected") );
1158                     } else {
1159                         $("#saved_return_date").text( $("#return_date_override").val() );
1160                     }
1161                     $("#return_date_remember").show();
1162                 } else {
1163                     $("#return_date_remember").hide();
1164                 }
1165             });
1166             $('[data-toggle="tooltip"]').tooltip();
1167
1168             $(".printcheckinslip").on("click", function(e){
1169                 e.preventDefault();
1170                 var borrowernumber = $(this).data('borrowernumber');
1171                 window.open("/cgi-bin/koha/members/printslip.pl?borrowernumber=" + borrowernumber + "&amp;print=checkinslip", "printwindow");
1172             });
1173
1174         });
1175     </script>
1176 [% END %]
1177
1178 [% INCLUDE 'intranet-bottom.inc' %]