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