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