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