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