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