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