Bug 18789: (QA follow-up) Use patron object in batch checkout template
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation_batch_checkouts.tt
1 [% USE Branches %]
2 [% USE KohaDates %]
3 [% USE Price %]
4 [% USE AuthorisedValues %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 [% SET destination = "circ" %]
8 <title>Koha &rsaquo; Circulation
9 [% IF patron %]
10   &rsaquo; Batch check out &rsaquo; Issuing items to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %]
11 [% END %]
12 </title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
15 </head>
16
17 <body id="circ_circulation_batch_checkouts" class="circ">
18
19 [% INCLUDE 'header.inc' %]
20 [% INCLUDE 'circ-search.inc' %]
21
22 <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;
23     [% IF patron %]
24         <a href="/cgi-bin/koha/circ/circulation.pl">Batch check out</a> &rsaquo; [% INCLUDE 'patron-title.inc' %]
25     [% ELSE %]
26         Batch check out
27     [% END %]
28 </div>
29 <div id="doc3" class="yui-t2">
30
31    <div id="bd">
32 <div id="yui-main">
33 <div class="yui-b">
34
35 <div class="yui-g">
36
37 [% IF patron %]
38 [% INCLUDE 'members-toolbar.inc' %]
39 [% END %]
40
41 [% IF patron and not batch_allowed %]
42   <div class="dialog alert">You are not allowed to use batch checkout for this patron</div>
43 [% ELSIF patron and noissues and not checkout_infos %]
44   <div class="dialog alert">
45     Cannot check out!
46     [% IF charges_is_blocker %]
47       <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
48     [% END %]
49     [% IF charges_guarantees_is_blocker %]
50         <li>
51             <span class="circ-hlt">Fees &amp; Charges:</span> Patron's guarantees collectively owe [% chargesamount_guarantees | $Price %].
52         </li>
53         <li>
54             <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
55         </li>
56     [% END %]
57   </div>
58 [% ELSIF patron and not checkout_infos %]
59   <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
60     <fieldset id="circ_circulation_issue">
61       <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
62       <fieldset class="rows">
63         <legend>Use a file</legend>
64         <ol>
65           <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
66         </ol>
67       </fieldset>
68       <fieldset class="rows">
69         <legend>Or list barcodes one by one</legend>
70         <ol>
71           <li>
72             <label for="barcodelist">Barcode list (one barcode per line): </label>
73             <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
74           </li>
75         </ol>
76       </fieldset>
77       <input type="hidden" name="op" value="show" />
78       <fieldset class="action">
79         <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
80         <input type="hidden" name="branch" value="[% branch %]" />
81         <input type="hidden" name="batch" value="1" />
82         <input type="submit" value="Check out" class="button" />
83       </fieldset>
84     </fieldset>
85   </form>
86
87 [% ELSIF patron %]
88   [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
89     <h3>Batch checkout confirmation [% IF patron %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
90     <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
91   [% ELSE %]
92     <h3>Batch checkout information [% IF patron.borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] |[% batch %]|[% END %]</h3>
93   [% END %]
94     <table id="checkout_infos">
95       <thead>
96         <tr>
97           [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
98             <th class="NoSort"></th>
99           [% END %]
100           <th>Barcode</th>
101           <th class="anti-the">Title</th>
102           <th>Information</th>
103         </tr>
104       </thead>
105       <tbody>
106         [% FOR checkout_info IN checkout_infos %]
107           <tr>
108             [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
109               <td>
110                 [% IF checkout_info.NEEDSCONFIRMATION %]
111                   <input type="checkbox" name="barcodes" value="[% checkout_info.barcode %]" checked="checked" />
112                 [% END %]
113               </td>
114             [% END %]
115             <td>[% checkout_info.barcode %]</td>
116             <td>
117               <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.biblio.biblionumber %]&amp;type=intra"><strong>[% checkout_info.biblio.title |html %][% FOREACH subtitle IN checkout_info.biblio.subtitles %] [% subtitle.subfield %][% END %]</strong></a>[% IF checkout_info.biblio.author %], by [% checkout_info.biblio.author %][% END %][% IF ( checkout_info.item.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.biblio.biblionumber %]&amp;itemnumber=[% checkout_info.item.itemnumber %]#item[% checkout_info.item.itemnumber %]">[% checkout_info.item.barcode %]</a>
118             </td>
119             <td>
120               [% IF checkout_info.NEEDSCONFIRMATION %]
121                 <ul class="fa-ul warn">
122                   [% IF checkout_info.AGE_RESTRICTION %]
123                       <li><i class="fa fa-li fa-warning"></i>Age restriction [% checkout_info.AGE_RESTRICTION %].</li>
124                   [% END %]
125                   [% IF checkout_info.RENEW_ISSUE %]
126                       <li><i class="fa fa-li fa-warning"></i>This item is currently checked out to this patron. Renew?</li>
127                   [% END %]
128                   [% IF checkout_info.RESERVE_WAITING %]
129                       <li><i class="fa fa-li fa-warning"></i>This item is waiting for another patron.</li>
130                   [% END %]
131                   [% IF checkout_info.RESERVED %]
132                       <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron.</li>
133                   [% END %]
134                   [% IF checkout_info.ISSUED_TO_ANOTHER %]
135                       <li><i class="fa fa-li fa-warning"></i>This item is checked out to another patron.
136                     [% IF CAN_user_circulate_force_checkout %]
137                       Check in and check out?
138                       [% END %]</li>
139                   [% END %]
140                   [% IF checkout_info.TOO_MANY %]
141                       <li><i class="fa fa-li fa-warning"></i>Too many checked out.</li>
142                   [% END %]
143                   [% IF checkout_info.BORRNOTSAMEBRANCH %]
144                       <li><i class="fa fa-li fa-warning"></i>This patron is from a different library ([% Branches.GetName( checkout_info.BORRNOTSAMEBRANCH ) %]).</li>
145                   [% END %]
146                   [% IF checkout_ino.PATRON_CANT %]
147                       <li><i class="fa fa-li fa-warning"></i>This patron can't check out this item per library circulation policy.</li>
148                   [% END %]
149                   [% IF checkout_info.NOT_FOR_LOAN_FORCING %]
150                     [% IF checkout_info.itemtype_notforloan %]
151                         <li><i class="fa fa-li fa-warning"></i>Item type is normally not for loan.</li>
152                     [% ELSIF checkout_info.item_notforloan %]
153                       [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
154                         <li><i class="fa fa-li fa-warning"></i>Item is normally not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib %])[% END %].</li>
155                     [% END %]
156                   [% END %]
157                   [% IF checkout_info.USERBLOCKEDOVERDUE %]
158                       <li><i class="fa fa-li fa-warning"></i>Patron has [% checkout_info.USERBLOCKEDOVERDUE %] overdue item(s).</li>
159                   [% END %]
160                   [% IF checkout_info.ITEM_LOST %]
161                       <li><i class="fa fa-li fa-warning"></i>This item has been lost with a status of "[% checkout_info.ITEM_LOST %]."</li>
162                   [% END %]
163                   [% IF checkout_info.HIGHHOLDS %]
164                       <li><i class="fa fa-li fa-warning"></i>High demand item. Loan period shortened to [% checkout_info.HIGHHOLDS.duration %] days (due [% checkout_info.HIGHHOLDS.returndate %]).</li>
165                   [% END %]
166                   [% IF checkout_info.HIGHHOLDS %] <!-- FIXME -->
167                       <script type="text/javascript">
168                           $(document).ready(function() {
169                               $("input[name=duedatespec]:hidden").val('[% checkout_info.HIGHHOLDS.returndate %]');
170                           });
171                       </script>
172                   [% END %]
173
174                   [% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout or checkout_info.HIGHHOLDS ) %]
175                       [% IF checkout_info.RESERVED || checkout_info.RESERVE_WAITING %] <!-- arbitrary choice, revert the reserve is not possible-->
176                         <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron. The hold will be overridden, but not cancelled.</li>
177                       [% END %]
178                   [% END %]
179
180                   [% IF checkout_info.PREVISSUE %]
181                       <li>This item has previously been checked out to this patron.</li>
182                   [% END %]
183                 </ul>
184               [% END %]
185
186
187               [% IF checkout_info.alert.ITEM_LOST || checkout_info.alert.OTHER_CHARGES %]
188                 <ul class="info">
189                   [% IF checkout_info.alert.ITEM_LOST %]
190                       <li>This item has been lost with a status of "[% checkout_info.alert.ITEM_LOST %]."</li>
191                   [% END %]
192                   [% IF checkout_info.alert.OTHER_CHARGES %]
193                       <li>The patron has unpaid charges for holds, rentals etc of [% checkout_info.alert.OTHER_CHARGES %].</li>
194                   [% END %]
195                 </ul>
196               [% END %]
197
198
199               [% IF checkout_info.IMPOSSIBLE %]
200                 <ul class="fa-ul error">
201                   [% IF checkout_info.STATS  %]
202                       <li><i class="fa fa-li fa-exclamation"></i>Local use recorded.</li>
203                   [% END %]
204
205                   [% IF checkout_info.NOT_FOR_LOAN %]
206                     [% IF checkout_info.itemtype_notforloan %]
207                        <li><i class="fa fa-li fa-exclamation"></i>Item type not for loan.</li>
208                     [% ELSIF checkout_info.item_notforloan %]
209                       [% item_notforloan_lib = AuthorisedValues.GetByCode( checkout_info.authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
210                         <li><i class="fa fa-li fa-exclamation"></i>Item not for loan [% IF checkout_info.item_notforloan_lib %]([% checkout_info.item_notforloan_lib %])[% END %].</li>
211                     [% END %]
212                   [% END %]
213                   [% IF checkout_info.WTHDRAWN %]
214                       <li><i class="fa fa-li fa-exclamation"></i>Item has been withdrawn.</li>
215                   [% END %]
216                   [% IF checkout_info.RESTRICTED %]
217                       <li><i class="fa fa-li fa-exclamation"></i>Item is restricted.</li>
218                   [% END %]
219                   [% IF checkout_info.GNA %]
220                       <li><i class="fa fa-li fa-exclamation"></i>Patron's address is in doubt.</li>
221                   [% END %]
222                   [% IF checkout_info.CARD_LOST %]
223                       <li><i class="fa fa-li fa-exclamation"></i>Patron's card is lost.</li>
224                   [% END %]
225                   [% IF checkout_info.DEBARRED %]
226                       <li><i class="fa fa-li fa-exclamation"></i>Patron is restricted.</li>
227                   [% END %]
228                   [% IF checkout_info.NO_MORE_RENEWALS %]
229                       <li><i class="fa fa-li fa-exclamation"></i>No more renewals possible.</li>
230                   [% END %]
231                   [% IF checkout_info.EXPIRED %]
232                       <li><i class="fa fa-li fa-exclamation"></i>Patron's card is expired.</li>
233                   [% END %]
234                   [% IF checkout_info.ITEMNOTSAMEBRANCH %]
235                       <li><i class="fa fa-li fa-exclamation"></i>This item belongs to [% Branches.GetName( checkout_info.itemhomebranch ) %] and cannot be checked out from this location.</li>
236                   [% END %]
237                   [% IF checkout_info.USERBLOCKEDREMAINING %]
238                       <li><i class="fa fa-li fa-exclamation"></i>Patron has had overdue items and is blocked for [% checkout_info.USERBLOCKEDREMAINING %] day(s).</li>
239                   [% END %]
240                   [% IF checkout_info.USERBLOCKEDOVERDUE %]
241                       <li><i class="fa fa-li fa-exclamation"></i>Checkouts are BLOCKED because patron has overdue items.</li>
242                   [% END %]
243                   [% IF checkout_info.TOO_MANY %]
244                       <li><i class="fa fa-li fa-exclamation"></i>Too many checked out.</li>
245                   [% END %]
246                   [% IF checkout_info.UNKNOWN_BARCODE %]
247                       <li><i class="fa fa-li fa-exclamation"></i>The barcode was not found [% checkout_info.barcode |html %].</li>
248                   [% END %]
249                   [% IF checkout_info.DEBT %]
250                       <li><i class="fa fa-li fa-exclamation"></i>The patron has a debt of [% checkout_info.DEBT %].</li> <!-- Need debt_confirmed -->
251                   [% END %]
252                 </p>
253               [% END %]
254
255               [% IF checkout_info.issue.date_due %]
256                 <li>Due on [% checkout_info.issue.date_due | $KohaDates %]</li>
257               [% END %]
258             </td>
259           </tr>
260         [% END %]
261       </tbody>
262     </table>
263
264     [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
265         <fieldset>
266             <legend>Please confirm checkout</legend>
267       <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
268       <input type="hidden" name="issueconfirmed" value="1" />
269       <input type="hidden" name="debt_confirmed" value="1" />
270       <input type="hidden" name="branch" value="[% branch %]" />
271       <input type="hidden" name="batch" value="1" />
272       <input type="submit" id="checkoutrenew" class="approve" value="Checkout or renew" />
273         </fieldset>
274     </form>
275     [% END %]
276
277 [% ELSE %]
278     <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
279 [% END %]
280
281 </div>
282 </div>
283 </div>
284 [% IF patron %]
285     <div class="yui-b">
286         [% INCLUDE 'circ-menu.inc' %]
287     </div>
288 [% END %]
289 </div>
290
291 [% MACRO jsinclude BLOCK %]
292     [% INCLUDE 'calendar.inc' %]
293     [% INCLUDE 'datatables.inc' %]
294     <script type="text/javascript">
295         $(document).ready(function() {
296             if($('#barcodelist').length) {
297                 $('#barcodelist').focus();
298             } else if ($('#checkoutrenew').length) {
299                 $('#checkoutrenew').focus();
300             }
301             $("#checkout_infos").dataTable($.extend(true, {}, dataTablesDefaults, {
302                 "sDom": 't',
303                 "aaSorting": [],
304                 "aoColumnDefs": [
305                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
306                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
307                 ],
308                 "bPaginate": false
309             }));
310         });
311     </script>
312 [% END %]
313
314 [% INCLUDE 'intranet-bottom.inc' %]