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