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