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