Bug 22015: Move DataTables CSS to global include
[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 Borrowers %]
7 [% USE ItemTypes %]
8 [% USE AuthorisedValues %]
9 [% USE ColumnsSettings %]
10 [% SET footerjs = 1 %]
11 [% BLOCK display_bormessagepref %]
12     [% IF ( bormessagepref ) %]
13         <li>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>Patron is not notified.</li>
23     [% END %]
24 [% END %]
25
26 [% BLOCK display_holdpatron_address %]
27     [% IF Koha.Preference( 'AddressFormat' ) %]
28         [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
29     [% ELSE %]
30         [% INCLUDE 'member-display-address-style-us.inc' %]
31     [% END %]
32 [% END %]
33
34 [% INCLUDE 'doc-head-open.inc' %]
35 <title>Koha &rsaquo; Circulation &rsaquo; Check in [% title | html %]</title>
36 [% INCLUDE 'doc-head-close.inc' %]
37 </head>
38
39 <body id="circ_returns" class="circ">
40 <span class="audio-alert-success"></span>
41
42 [% INCLUDE 'header.inc' %]
43 [% INCLUDE 'checkin-search.inc' %]
44
45 <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>
46
47 <div class="main container-fluid">
48     <div class="row">
49         <div class="col-sm-12">
50             <main>
51                 <div class="row">
52
53                 [% IF Koha.Preference('CircSidebar') %]
54                     <div class="col-sm-10 col-sm-push-2">
55                 [% ELSE %]
56                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
57                 [% END %]
58
59     [% IF hold_auto_filled %]
60         <div class="dialog alert hold-auto-filled">
61             [% IF ( reservenotes ) %]
62                 <h4>Notes: [% reservenotes | html %]</h4>
63             [% END %]
64             <h3>Hold filled for:</h3>
65                 <li>
66                     [% INCLUDE 'patron-title.inc' patron=patron %]
67                     <span class="patron-category"> - [% patron.category.description | html %]</span>
68                 </li>
69
70                 [% INCLUDE display_holdpatron_address %]
71
72                 [% IF ( patron.phone ) %]
73                     <li>[% patron.phone | html %]</li>
74                 [% END %]
75
76                 [% IF ( patron.email ) %]
77                     <li>
78                         [% IF ( transfertodo ) %]
79                             [% patron.email | html %]
80                         [% ELSE %]
81                             <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
82                         [% END %]
83                     </li>
84                 [% END %]
85
86                 [% UNLESS ( transfertodo) %]
87                     [% INCLUDE display_bormessagepref %]
88                 [% END %]
89
90                 [% IF ( patron.debarred ) %]
91                     <li class="error">Patron is RESTRICTED</li>
92                 [% END %]
93
94                 [% IF ( patron.gonenoaddress ) %]
95                     <li class="error">Patron's address is in doubt</li>
96                 [% END %]
97
98             [% IF ( transfertodo ) %]
99                 <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
100             [% ELSE %]
101                 <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
102             [% END %]
103
104             <a href="#" class="btn btn-default print print-slip">
105                 <i class="fa fa-print"></i> Print
106             </a>
107         </div>
108     [% END %]
109
110 [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
111     <div class="dialog alert"><strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.</div>
112 [% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
113     <div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
114 [% END %]
115
116 [% IF additional_materials %]
117     <div class="dialog message" id="materials">Note about the accompanying materials: <br />
118     [% additional_materials | html %]
119     </div>
120 [% END %]
121
122 [% IF ( collectionItemNeedsTransferred ) %]
123  <div id="rotating-collection" class="dialog message">
124         <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) | html %]</h3>
125             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
126             <p>This item is part of a rotating collection.</p>
127             <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;branchcode=[% collectionBranch | html %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
128 </div>
129 [% END %]
130
131 <!-- Patron has added an issue note -->
132 [% IF ( issue.note) %]
133     <div class="dialog message">
134         <h1>Patron note</h1>
135         <p>[% issue.notedate | $KohaDates %]</p>
136         <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber | uri %]"> [% title | html %]</a> [% author | html %]</p>
137         <p>[% issue.note | html %]</p>
138     </div>
139 [% END %]
140
141 <!-- Patron has fines -->
142 [% IF ( fines ) %]
143     <div class="dialog alert">
144         <h3>Patron has outstanding fines of [% fines | html %].</h3>
145         <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber | uri %]">Make payment</a>.</p>
146     </div>
147 [% END %]
148
149 <!-- Patron has waiting holds -->
150 [% IF ( waiting_holds ) %]
151     <div id="awaiting-pickup" class="dialog message">
152         <h3>[% holdsfirstname | html %] [% holdssurname | html %] has [% waiting_holds | html %] hold(s) waiting for pickup.</h3>
153         <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber | uri %]">Check out to this patron</a>.</p>
154     </div>
155 [% END %]
156
157 <!-- Patron is restricted and checkin was backdated -->
158 [% IF return_date_was_overriden && Borrowers.IsDebarred( borrower ) %]
159     <div id="restricted_backdated" class="dialog message">
160         <h3>
161             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">
162                 [% patron.firstname | html %] [% patron.surname | html %]
163             </a>
164             is restricted. Please verify this patron should still be restricted.
165         </h3>
166     </div>
167 [% END %]
168
169 [% IF ( wrongbranch ) %]
170     <div class="dialog alert"><h3>Cannot check in</h3>
171         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
172         </p><strong>NOT CHECKED IN</strong></p>
173         <p>This item must be checked in at following library: <strong>[% Branches.GetName( rightbranch ) | html %]</strong></p>
174     </div>
175 [% END %]
176
177 <!-- case of a mistake in transfer loop -->
178 [% IF ( WrongTransfer ) %]
179     <div id="return2" class="dialog message">
180         <!-- WrongTransfer -->
181         <h3>Please return item to: [% Branches.GetName( TransferWaitingAt ) | html %]</h3>
182             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
183         <button type="submit" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;&amp;branchcode=[% TransferWaitingAt | html %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
184         <button class="deny" type="submit" onclick="window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber | html %]&amp;canceltransfer=1'"><i class="fa fa-times"></i> Cancel transfer</button>
185 [% IF ( patron.cardnumber ) %]<h5>Hold for:</h5>
186         <ul>
187             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">
188             [% patron.surname | html %], [% patron.firstname | html %]</a> ([% patron.cardnumber | html %]) <span class="patron-category"> - [% patron.category.description | html %]</span> </li>
189             [% INCLUDE display_holdpatron_address %]
190             [% IF ( patron.phone ) %]<li>[% patron.phone | html %]</li>[% END %]
191             [% IF ( patron.email ) %]<li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li>[% END %]
192         </ul>
193
194     <form method="post" action="returns.pl" class="confirm">
195             <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem | html %]" />
196             <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt | html %]" />
197             <input type="hidden" name="WT-From" value="[% wtransfertFrom | html %]" />
198             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
199             <input type="hidden" name="print_slip" value="0" />
200             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
201             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
202             <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and confirm</button>
203         <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
204         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
205     </form>
206     [% END %]</div>
207 [% END %]
208
209 [% IF ( found ) %]
210     [% IF ( waiting ) %]
211         <div id="hold-found1" class="modal fade audio-alert-action">
212             <div class="modal-dialog">
213             <div class="modal-content">
214             <form method="post" action="returns.pl" class="confirm">
215                 <div class="modal-header">
216                     <h3>
217                         Hold found (item is already waiting):
218                         <br/>
219                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
220                             [% itembarcode | html %]: [% title | html %]
221                         </a>
222                     </h3>
223                 </div>
224
225                 <div class="modal-body">
226                     [% IF ( reservenotes ) %]
227                         <h4>Notes: [% reservenotes | html %]</h4>
228                     [% END %]
229
230                     <h4>Hold for:</h4>
231                     <ul>
232                     <li>
233                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.surname | html %], [% patron.firstname | html %]</a> ([% patron.cardnumber | html %])
234                         <span class="patron-category"> - [% patron.category.description | html %]</span>
235                     </li>
236                     [% INCLUDE display_holdpatron_address %]
237                     [% IF ( patron.phone ) %]
238                         <li> [% patron.phone | html %]</li>
239                     [% END %]
240
241                     [% IF ( patron.email ) %]
242                         <li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li>
243                     [% END %]
244
245                     [% IF ( patron.debarred ) %]
246                         <li class="error">Patron is RESTRICTED</li>
247                     [% END %]
248
249                     [% IF ( patron.gonenoaddress ) %]
250                         <li class="error">Patron's address is in doubt</li>
251                     [% END %]
252                     </ul>
253
254                     [% IF ( transfertodo ) %]
255                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
256                     [% ELSE %]
257                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
258                     [% END %]
259
260                     [% FOREACH inputloo IN inputloop %]
261                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
262                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
263                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
264                     [% END %]
265
266                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
267                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
268                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
269                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
270                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
271                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
272                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
273                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
274
275                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
276                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
277                 </div>
278
279                 <div class="modal-footer">
280                     <input type="hidden" name="cancel_reserve" value="0" />
281
282                     <button type="submit" class="btn btn-default approve" data-dismiss="modal">
283                         <i class="fa fa-check"></i> Confirm hold
284                     </button>
285
286                     <input type="hidden" name="print_slip" value="0" />
287                     <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit();">
288                         <i class="fa fa-print"></i> Print slip and confirm
289                     </button>
290
291                     <button type="submit" class="btn btn-default deny" onclick="this.form.cancel_reserve.value = 1; this.form.submit();">
292                         <i class="fa fa-times"></i> Cancel hold
293                     </button>
294                 </div>
295             </form>
296            </div>
297            </div>
298         </div>
299     [% END %]
300
301     [% IF ( diffbranch ) %]
302                 <!-- diffbranch -->
303         <div id="transfer-needed" class="dialog message audio-alert-action">
304             <h3>Hold needing transfer found</h3>
305                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
306                 <h4>Hold for: </h4>
307                     <ul>
308                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.surname | html %], [% patron.firstname | html %]</a> ([% patron.cardnumber | html %]) <span class="patron-category"> - [% patron.category.description | html %]</span> </li>
309                         [% INCLUDE display_holdpatron_address %]
310                         [% IF ( patron.phone ) %]<li>[% patron.phone | html %]</li>[% END %]
311                         [% IF ( patron.email ) %]<li>[% IF ( transfertodo ) %][% patron.email | html %][% ELSE %]<a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>[% END %]</li>[% END %]
312 [% IF ( patron.debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
313 [% IF ( patron.gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
314                     </ul>
315         [% IF ( transfertodo ) %]
316             <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
317         [% ELSE %]
318             <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
319         [% END %]
320
321         <form method="post" action="returns.pl" class="confirm">
322             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
323             <input type="hidden" name="print_slip" value="0" />
324             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
325             <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
326             <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and continue</button>
327             [% FOREACH inputloo IN inputloop %]
328                 <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
329                 <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
330                 <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
331             [% END %]
332             <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
333             <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
334             <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
335             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
336             <input type="hidden" name="barcode" value="0" />
337
338             <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
339             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
340         </form>
341                 </div>
342     [% END %]
343
344     [% IF ( transfer ) %]
345     <!-- transfer: item with no reservation, must be returned according to home library circulation rules -->
346         <div id="return1" class="dialog message audio-alert-action">
347             <h3>Please return item to: [% Branches.GetName( returnbranch ) | html %]</h3>
348             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
349             <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;branchcode=[% returnbranch | html %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
350         </div>
351     [% END %]
352
353     [% IF ( needstransfer ) %]
354         <!-- needstransfer -->
355     <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) | html %]</h3>
356     Transfer now?<br />
357     <form method="post" action="returns.pl" name="mainform" id="mainform">
358     [% IF itemnumber %]
359         <button type="submit" name="dotransfer" value="Yes" class="print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;&amp;branchcode=[% returnbranch | html %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button>
360     [% END %]
361     <button type="submit" name="dotransfer" value="Yes" class="submit"><i class="fa fa-check"></i> Yes</button>
362     <button type="submit" name="notransfer" value="No" class="submit"><i class="fa fa-times"></i> No</button>
363     <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
364         <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
365         <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
366         <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
367         <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
368         [% FOREACH inputloo IN inputloop %]
369         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
370         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
371         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
372         [% END %]
373         <input type="hidden" name="barcode" value="0" />
374         <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
375         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
376         </form>   </div>
377     [% END %]
378
379     [% IF ( diffbranch ) %]
380         <!-- diffbranch -->
381         <h3 class="audio-alert-action">Item consigned:</h3>
382         <table>
383         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a></caption>
384         <tr>
385             <th>Hold for:</th>
386             <td>[% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]</td>
387         </tr>
388         </table>
389         <form method="post" action="returns.pl"><input type="submit" value="OK" />
390             [% FOREACH inputloo IN inputloop %]
391                 [% UNLESS ( inputloo.first ) %]
392                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
393                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
394                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
395                 [% END %]
396             [% END %]
397
398             <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
399             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
400
401             <input type="hidden" name="barcode" value="0" />
402         </form>
403     [% END %]
404
405
406     <!-- case of simple return no issue or transfer but with a reservation  -->
407     [% IF ( reserved ) %]
408         <!--  reserved  -->
409         <div id="hold-found2" class="modal fade audio-alert-action">
410             <div class="modal-dialog">
411             <div class="modal-content">
412             <form method="post" action="returns.pl" class="confirm">
413                 <div class="modal-header">
414                     <h3>
415                         Hold found:
416                         <br/>
417                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
418                             [% itembarcode | html %]: [% title | html %]
419                         </a>
420                 </div>
421
422                 <div class="modal-body">
423                     [% IF ( reservenotes ) %]
424                         <h4>Notes: [% reservenotes | html %]</h4>
425                     [% END %]
426                     <h5>Hold for:</h5>
427                         <li>
428                             <td>[% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]</td>
429                             <span class="patron-category"> - [% patron.category.description | html %]</span>
430                         </li>
431
432                         [% INCLUDE display_holdpatron_address %]
433
434                         [% IF ( patron.phone ) %]
435                             <li>[% patron.phone | html %]</li>
436                         [% END %]
437
438                         [% IF ( patron.email ) %]
439                             <li>
440                                 [% IF ( transfertodo ) %]
441                                     [% patron.email | html %]
442                                 [% ELSE %]
443                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
444                                 [% END %]
445                             </li>
446                         [% END %]
447
448                         [% UNLESS ( transfertodo) %]
449                             [% INCLUDE display_bormessagepref %]
450                         [% END %]
451
452                         [% IF ( patron.debarred ) %]
453                             <li class="error">Patron is RESTRICTED</li>
454                         [% END %]
455
456                         [% IF ( patron.gonenoaddress ) %]
457                             <li class="error">Patron's address is in doubt</li>
458                         [% END %]
459
460                     [% IF ( transfertodo ) %]
461                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
462                     [% ELSE %]
463                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
464                     [% END %]
465
466                     <input type="hidden" name="print_slip" value="0" />
467
468
469                     [% FOREACH inputloo IN inputloop %]
470                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
471                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
472                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
473                     [% END %]
474
475                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
476                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
477                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
478                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
479                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
480                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
481                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
482                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
483                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
484                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
485                 </div>
486
487                 <div class="modal-footer">
488                     [% IF ( transfertodo ) %]
489                         <button type="submit" class="btn btn-default approve">
490                             <i class="fa fa-check"></i> Confirm hold and transfer
491                         </button>
492                         <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit()">
493                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
494                         </button>
495                     [% ELSE %]
496                         <button type="submit" class="btn btn-default approve">
497                             <i class="fa fa-check"></i> Confirm hold
498                         </button>
499                         <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit();">
500                             <i class="fa fa-print"></i> Print slip and confirm
501                         </button>
502                     [% END %]
503
504                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny" onclick="$('#barcode').focus(); return false;">
505                         <i class="fa fa-times"></i> Ignore
506                     </button>
507                 </div>
508             </form>
509             </div>
510             </div>
511         </div>
512     [% END %]
513 [% END %]
514
515 [% IF ( errmsgloop ) %]
516     <div class="dialog alert audio-alert-warning">
517         <h3>Check in message</h3>
518         [% IF itembiblionumber %]
519             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
520         [% END %]
521         [% FOREACH errmsgloo IN errmsgloop %]
522             [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
523                 <p class="problem">
524                     Not for loan status updated.
525                     <br />Old value:
526                     [% IF errmsgloo.NotForLoanStatusUpdated.from %]
527                         [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) | html %].
528                     [% ELSE %]
529                         Available for loan.
530                     [% END %]
531                     <br />New value:
532                     [% IF errmsgloo.NotForLoanStatusUpdated.to %]
533                         [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) | html %].
534                     [% ELSE %]
535                         Available for loan.
536                     [% END %]
537                 </p>
538             [% END %]
539             [% IF ( errmsgloo.badbarcode ) %]
540                 <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
541             [% END %]
542             [% IF ( errmsgloo.ispermanent ) %]
543                 <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) | html %]</p>
544             [% END %]
545             [% IF ( errmsgloo.notissued ) %]
546                 <p class="problem">Not checked out.</p>
547             [% END %]
548             [% IF ( errmsgloo.localuse) %]
549                 <p class="problem">Local use recorded</p>
550             [% END %]
551             [% IF ( errmsgloo.waslost ) %]
552                 [% IF Koha.Preference('BlockReturnOfLostItems') %]
553                     <p class="problem">Item is lost, cannot be checked in.</p>
554                 [% ELSE %]
555                     <p class="problem">Item was lost, now found.</p>
556                 [% END %]
557
558                 [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
559                     <p class="problem">A refund has been applied to the borrowing patron's account.</p>
560                 [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
561                    <h5>Cannot check in</h5>
562                    <p><strong>NOT CHECKED IN</strong></p>
563                 [% ELSE %]
564                     <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
565                 [% END %]
566             [% END %]
567             [% IF ( errmsgloo.withdrawn ) %]
568                 [% IF Koha.Preference('BlockReturnOfWithdrawnItems') %]
569                    <h5>Cannot check in</h5>
570                    <p><strong>NOT CHECKED IN</strong></p>
571                 [% END %]
572                <p class="problem">Item is withdrawn.</p>
573             [% END %]
574             [% IF ( errmsgloo.debarred ) %]
575                 <p class="problem"><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>
576             [% END %]
577             [% IF ( errmsgloo.prevdebarred ) %]
578                 <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
579             [% END %]
580             [% IF ( errmsgloo.foreverdebarred ) %]
581                 <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction.</p>
582             [% END %]
583
584             [% IF errmsgloo.data_corrupted %]
585                 <p class="problem">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>
586             [% END %]
587         [% END %]
588     </div>
589 [% END %]
590
591 [% IF ( checkinmsg ) %]
592     [% IF ( checkinmsgtype == 'alert' ) %]
593         <div class="dialog alert">
594     [% ELSE %]
595         <div class="dialog message">
596     [% END %]
597             <p class="problem">[% checkinmsg | html_line_break %]</p>
598         </div>
599 [% END%]
600
601     <div id="exemptfines" class="dialog message" style="display:none;">
602         <p>Fines for returned items are forgiven.</p>
603     </div>
604     <div id="forgivemanualholdsexpire-alert" class="dialog message" style="display:none;">
605         <p>Fines are not charged for manually cancelled holds.</p>
606     </div>
607     <div id="dropboxmode" class="dialog message" style="display:none;">
608         <p>Book drop mode.  (Effective checkin date is [% dropboxdate | html %] ).</p>
609     </div>
610
611 <div class="row">
612     <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
613     <div class="col-sm-6">
614             <fieldset>
615             <legend>Check in</legend>
616             <label for="barcode">Enter item barcode: </label>
617             [% IF ( exemptfine ) %]
618             <input name="barcode" id="barcode" size="14" class="focus alert" type="text" />
619             [% ELSIF ( dropboxmode ) %]
620             <input name="barcode" id="barcode" size="14" class="focus alert" type="text" />
621             [% ELSE %]
622             <input name="barcode" id="barcode" size="14" class="focus" type="text" />
623             [% END %]
624             <input type="submit" class="submit" value="Submit" />
625
626             [% IF Koha.Preference('SpecifyReturnDate') %]
627                 <div class="date-select" id="return_date_override_fields">
628                     <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
629
630                     <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" />
631
632                     <label for="return_date_override_remember"> Remember for next check in:</label>
633                     [% IF ( return_date_override_remember ) %]
634                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" checked="checked" />
635                     [% ELSE %]
636                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" />
637                     [% END %]
638
639                     <input type="button" class="action" id="cleardate" value="Clear" name="cleardate" onclick="this.checked = false; this.form.return_date_override.value = ''; this.form.return_date_override_remember.checked = false; this.form.barcode.focus(); return false;" />
640             </div>
641         [% END %]
642             [% FOREACH inputloo IN inputloop %]
643                 <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
644                 <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
645                 <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
646             [% END %]
647
648
649             </fieldset>
650             </div>
651             <div class="col-sm-6">
652             <fieldset id="checkin_options">
653                 <legend>Options</legend>
654                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
655                     <p>
656                         [% IF ( exemptfine ) %]
657                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
658                         [% ELSE %]
659                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
660                         [% END %]
661                         <label for="exemptcheck">Forgive overdue charges</label>
662                     </p>
663                     [% END %] <!-- overduecharges -->
664                     <p>
665                         [% IF ( dropboxmode ) %]
666                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
667                         [% ELSE %]
668                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
669                         [% END %]
670                         <label for="dropboxcheck">Book drop mode</label>
671                     </p>
672                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
673                     <p>
674                         [% IF ( forgivemanualholdsexpire ) %]
675                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
676                         [% ELSE %]
677                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
678                         [% END %]
679                         <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
680                     </p>
681                     [% END %] <!-- overduecharges -->
682             </fieldset>
683         </div>
684     </form>
685 </div>
686
687 [% IF ( riloop ) %]
688     <h2>Checked-in items</h2>
689     <table id="checkedintable">
690     <thead><tr><th class="ci-duedate">Due date</th><th class="ci-title">Title</th><th class="ci-author">Author</th><th class="ci-barcode">Barcode</th><th class="ci-homelibrary">Home library</th><th class="ci-holdinglibrary">Holding library</th><th class="ci-shelvinglocation">Shelving location</th><th class="ci-callnumber">Call number</th><th class="ci-dateaccessioned">Date acquired</th><th class="ci-type">Type</th><th class="ci-patron">Patron</th><th class="ci-note">Note</th></tr></thead>
691
692         [% FOREACH riloo IN riloop %]
693             <tr>
694             <td class="ci-duedate">[% IF ( riloo.duedate ) %]
695                     [% IF ( riloo.return_overdue ) %]
696                         <span class="overdue">[% riloo.duedate | html %] (overdue)</span>
697                     [% ELSE %][% riloo.duedate | html %]
698                     [% END %]
699                 [% ELSE %]Not checked out
700                 [% END %]
701             </td>
702             <td class="ci-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">
703                     [% riloo.itemtitle | html %]
704                 </a>
705                 [% IF ( riloo.enumchron ) %]
706                     <br/>
707                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron | html %]</span>
708                 [% END %]
709             </td>
710             <td class="ci-author">[% riloo.itemauthor | html %]</td>
711             <td class="ci-barcode"><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></td>
712             <td class="ci-homelibrary">[% Branches.GetName( riloo.homebranch ) | html %]</td>
713             <td class="ci-holdinglibrary">[% Branches.GetName( riloo.holdingbranch ) | html %]</td>
714             <td class="ci-shelvinglocation">[% riloo.location | html %]</td>
715             <td class="ci-callnumber">[% riloo.itemcallnumber | html %]</td>
716             <td class="ci-dateaccessioned">[% riloo.dateaccessioned | $KohaDates %]</td>
717             <td class="ci-type">[% ItemTypes.GetDescription( riloo.itemtype ) | html %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) | html %]</td>
718             <td class="ci-patron">[% IF ( riloo.duedate ) %]
719                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">
720                     [% riloo.patron.surname | html %], [% riloo.patron.firstname | html %] ([% riloo.patron.category.description | html %])
721                 </a>
722                 [% IF riloo.borissuescount %]
723                     <span class="results_summary nowrap">
724                         <span class="label">Checkouts:</span>
725                         <span class="number_box">
726                             <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">[% riloo.borissuescount | html %]</a>
727                         </span>
728                     </span>
729                 [% END %]
730             [% ELSE %]Not checked out[% END %]</td>
731             <td class="ci-note">
732                 [% IF ( riloo.patron.borrowernotes ) %]<p><span class="circ-hlt patron-note">[% riloo.patron.borrowernotes | html %]</p></span>[% END %]
733                 [% IF ( riloo.itemnote ) %]<p><span class="circ-hlt item-note-public">[% riloo.itemnote | html %]</p></span>[% END %]
734                 [% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic | html %]</p></span>[% END %]
735             </td>
736            </tr>
737         [% END %]
738     </table>
739 [% END %]
740
741                     [% IF Koha.Preference('CircSidebar') %]
742                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
743                             <div class="col-sm-2 col-sm-pull-10">
744                                 <aside>
745                                     [% INCLUDE 'circ-nav.inc' %]
746                                 </aside>
747                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
748                         </div> <!-- /.row -->
749                     [% END %]
750
751             </main>
752         </div> <!-- /.col-sm-12 -->
753     </div> <!-- /.row -->
754
755 [% MACRO jsinclude BLOCK %]
756     [% INCLUDE 'datatables.inc' %]
757     [% INCLUDE 'columns_settings.inc' %]
758     [% INCLUDE 'calendar.inc' %]
759     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
760     [% INCLUDE 'timepicker.inc' %]
761
762     <script>
763         function Dopop(link) {
764             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
765             $("#barcode").focus();
766         }
767         $(document).ready(function () {
768             $(".modal").modal({ backdrop: 'static' }).on('shown.bs.modal', function() {
769                 $("#barcode").prop("disabled", true);
770             }).on('hidden.bs.modal', function() {
771                 $("#barcode").prop("disabled", false).focus();
772             });
773
774             $(".modal").on('hidden.bs.modal', function (e) { $("#barcode").focus(); });
775
776             $(".print-slip").on('click', function(e) {
777                 e.preventDefault();
778                 Dopop('hold-transfer-slip.pl?borrowernumber=[% patron.borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]');
779             });
780
781             [% IF print_slip %]
782                 Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]&amp;itemnumber=[% itemnumber | html %]');
783             [% END %]
784
785             var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]
786             var returns_table = KohaTable("checkedintable", {
787                     "bFilter":false,
788                     "bPaginate":false,
789                     "bInfo":false,
790                     "bSort":false,
791                     "dom": 'B<"clearfix">t',
792                     }, columns_settings);
793
794             $("#return_date_override").datetimepicker({
795                 onClose: function(dateText, inst) {
796                     if (validate_date(dateText, inst) ) {
797                         $("#barcode").focus();
798                     }
799                 },
800                 defaultDate: -1,
801                 hour: 23,
802                 minute: 59,
803                 maxDate: 0
804             }).on("change", function(e, value) {
805                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
806             });
807             $("#return_date_override").on("blur", function() {
808                 check_valid_return_date();
809             });
810             $("#checkin-form").submit(function( event ) {
811                 if ( !check_valid_return_date() ) {
812                     event.preventDefault();
813                 }
814             });
815
816             function check_valid_return_date() {
817                 if ( $("#return_date_override").val() ) {
818                     var datetime = DateTime_from_syspref( $("#return_date_override").val() );
819                     var now = new Date();
820                     if ( !datetime || datetime > now ) {
821                         alert("Invalid return date/time!");
822                         $("#return_date_override").val("")
823                         return false;
824                     }
825                 }
826                 return true;
827             }
828
829             $("#exemptcheck").change(function () {
830                 if (this.checked == true) {
831                     $("#barcode").addClass("alert");
832                     $("#exemptfines").show();
833                 } else {
834                     $("#barcode").removeClass("alert");
835                     $("#exemptfines").hide();
836                 }
837                 $("#barcode").focus();
838             });
839             $("#dropboxcheck").change(function () {
840                 if (this.checked == true) {
841                     $("#barcode").addClass("alert");
842                     $("#dropboxmode").show();
843
844                     $("#return_date_override_fields :input").prop('disabled', true);
845                     $("#return_date_override").datetimepicker("disable");
846                 } else {
847                     $("#barcode").removeClass("alert");
848                     $("#dropboxmode").hide();
849
850                     $("#return_date_override_fields :input").prop('disabled', false);
851                     $("#return_date_override").datetimepicker("enable");
852                 }
853                 $("#barcode").focus();
854             });
855             $("#forgivemanualholdsexpire").change(function () {
856                 if (this.checked == true) {
857                     $("#barcode").addClass("alert");
858                     $("#forgivemanualholdsexpire-alert").show();
859                 } else {
860                     $("#barcode").removeClass("alert");
861                     $("#forgivemanualholdsexpire-alert").hide();
862                 }
863                 $("#barcode").focus();
864             });
865
866             [% IF(overduecharges) %]
867                 $("#barcode").focus(function () {
868                     if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
869                         $("#barcode").addClass("alert");
870                     } else {
871                         $("#barcode").removeClass("alert");
872                     }
873                 });
874                 $("#barcode").blur(function () {
875                     $("#barcode").removeClass("alert");
876                 });
877             [% END %]
878
879             $('.openWin').on("click",function(e){
880                 Dopop( $(this).data("url") );
881             });
882         });
883     </script>
884 [% END %]
885
886 [% INCLUDE 'intranet-bottom.inc' %]