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