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