Bug 21449: Update two-column templates with Bootstrap grid: Circulation part 2
[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 KohaDates %]
5 [% USE Price %]
6 [% USE AuthorisedValues %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 [% SET destination = "circ" %]
10 <title>Koha &rsaquo; Circulation
11 [% IF patron %]
12   &rsaquo; Batch check out &rsaquo; Issuing items to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %]
13 [% END %]
14 </title>
15 [% INCLUDE 'doc-head-close.inc' %]
16 [% Asset.css("css/datatables.css") | $raw %]
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">Fees &amp; 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       <input type="hidden" name="op" value="show" />
82       <fieldset class="action">
83         <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
84         <input type="hidden" name="branch" value="[% branch | html %]" />
85         <input type="hidden" name="batch" value="1" />
86         <input type="submit" value="Check out" class="button" />
87       </fieldset>
88     </fieldset>
89   </form>
90
91 [% ELSIF patron %]
92   [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
93     <h3>Batch checkout confirmation [% IF patron %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
94     <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
95   [% ELSE %]
96     <h3>Batch checkout information [% IF patron.borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] |[% batch | html %]|[% END %]</h3>
97   [% END %]
98     <table id="checkout_infos">
99       <thead>
100         <tr>
101           [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
102             <th class="NoSort"></th>
103           [% END %]
104           <th>Barcode</th>
105           <th class="anti-the">Title</th>
106           <th>Information</th>
107         </tr>
108       </thead>
109       <tbody>
110         [% FOR checkout_info IN checkout_infos %]
111           <tr>
112             [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
113               <td>
114                 [% IF checkout_info.NEEDSCONFIRMATION %]
115                   <input type="checkbox" name="barcodes" value="[% checkout_info.barcode | html %]" checked="checked" />
116                 [% END %]
117               </td>
118             [% END %]
119             <td>[% checkout_info.barcode | html %]</td>
120             <td>
121               <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.biblio.biblionumber | uri %]&amp;type=intra"><strong>[% checkout_info.biblio.title | html %][% FOREACH subtitle IN checkout_info.biblio.subtitles %] [% subtitle.subfield | html %][% END %]</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 | html %]</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>
122             </td>
123             <td>
124               [% IF checkout_info.NEEDSCONFIRMATION %]
125                 <ul class="fa-ul warn">
126                   [% IF checkout_info.AGE_RESTRICTION %]
127                       <li><i class="fa fa-li fa-warning"></i>Age restriction [% checkout_info.AGE_RESTRICTION | html %].</li>
128                   [% END %]
129                   [% IF checkout_info.RENEW_ISSUE %]
130                       <li><i class="fa fa-li fa-warning"></i>This item is currently checked out to this patron. Renew?</li>
131                   [% END %]
132                   [% IF checkout_info.RESERVE_WAITING %]
133                       <li><i class="fa fa-li fa-warning"></i>This item is waiting for another patron.</li>
134                   [% END %]
135                   [% IF checkout_info.RESERVED %]
136                       <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron.</li>
137                   [% END %]
138                   [% IF checkout_info.ISSUED_TO_ANOTHER %]
139                       <li><i class="fa fa-li fa-warning"></i>This item is checked out to another patron.
140                     [% IF CAN_user_circulate_force_checkout %]
141                       Check in and check out?
142                       [% END %]</li>
143                   [% END %]
144                   [% IF checkout_info.TOO_MANY %]
145                       <li><i class="fa fa-li fa-warning"></i>Too many checked out.</li>
146                   [% END %]
147                   [% IF checkout_info.BORRNOTSAMEBRANCH %]
148                       <li><i class="fa fa-li fa-warning"></i>This patron is from a different library ([% Branches.GetName( checkout_info.BORRNOTSAMEBRANCH ) | html %]).</li>
149                   [% END %]
150                   [% IF checkout_info.PATRON_CANT %]
151                       <li><i class="fa fa-li fa-warning"></i>This patron can't check out this item per library circulation policy.</li>
152                   [% END %]
153                   [% IF checkout_info.NOT_FOR_LOAN_FORCING %]
154                     [% IF checkout_info.itemtype_notforloan %]
155                         <li><i class="fa fa-li fa-warning"></i>Item type is normally not for loan.</li>
156                     [% ELSIF checkout_info.item_notforloan %]
157                       [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
158                         <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>
159                     [% END %]
160                   [% END %]
161                   [% IF checkout_info.USERBLOCKEDOVERDUE %]
162                       <li><i class="fa fa-li fa-warning"></i>Patron has [% checkout_info.USERBLOCKEDOVERDUE | html %] overdue item(s).</li>
163                   [% END %]
164                   [% IF checkout_info.ITEM_LOST %]
165                       <li><i class="fa fa-li fa-warning"></i>This item has been lost with a status of "[% checkout_info.ITEM_LOST | html %]."</li>
166                   [% END %]
167                   [% IF checkout_info.HIGHHOLDS %]
168                       <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>
169                   [% END %]
170                   [% IF checkout_info.HIGHHOLDS %] <!-- FIXME -->
171                       <script>
172                           $(document).ready(function() {
173                               $("input[name=duedatespec]:hidden").val('[% checkout_info.HIGHHOLDS.returndate | html %]');
174                           });
175                       </script>
176                   [% END %]
177
178                   [% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout or checkout_info.HIGHHOLDS ) %]
179                       [% IF checkout_info.RESERVED || checkout_info.RESERVE_WAITING %] <!-- arbitrary choice, revert the reserve is not possible-->
180                         <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>
181                       [% END %]
182                   [% END %]
183
184                   [% IF checkout_info.PREVISSUE %]
185                       <li>This item has previously been checked out to this patron.</li>
186                   [% END %]
187                 </ul>
188               [% END %]
189
190
191               [% IF checkout_info.alert.ITEM_LOST || checkout_info.alert.OTHER_CHARGES %]
192                 <ul class="info">
193                   [% IF checkout_info.alert.ITEM_LOST %]
194                       <li>This item has been lost with a status of "[% checkout_info.alert.ITEM_LOST | html %]."</li>
195                   [% END %]
196                   [% IF checkout_info.alert.OTHER_CHARGES %]
197                       <li>The patron has unpaid charges for holds, rentals etc of [% checkout_info.alert.OTHER_CHARGES | html %].</li>
198                   [% END %]
199                 </ul>
200               [% END %]
201
202
203               [% IF checkout_info.IMPOSSIBLE %]
204                 <ul class="fa-ul error">
205                   [% IF checkout_info.STATS  %]
206                       <li><i class="fa fa-li fa-exclamation"></i>Local use recorded.</li>
207                   [% END %]
208
209                   [% IF checkout_info.NOT_FOR_LOAN %]
210                     [% IF checkout_info.itemtype_notforloan %]
211                        <li><i class="fa fa-li fa-exclamation"></i>Item type not for loan.</li>
212                     [% ELSIF checkout_info.item_notforloan %]
213                       [% item_notforloan_lib = AuthorisedValues.GetByCode( checkout_info.authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
214                         <li><i class="fa fa-li fa-exclamation"></i>Item not for loan [% IF checkout_info.item_notforloan_lib %]([% checkout_info.item_notforloan_lib | html %])[% END %].</li>
215                     [% END %]
216                   [% END %]
217                   [% IF checkout_info.WTHDRAWN %]
218                       <li><i class="fa fa-li fa-exclamation"></i>Item has been withdrawn.</li>
219                   [% END %]
220                   [% IF checkout_info.RESTRICTED %]
221                       <li><i class="fa fa-li fa-exclamation"></i>Item is restricted.</li>
222                   [% END %]
223                   [% IF checkout_info.GNA %]
224                       <li><i class="fa fa-li fa-exclamation"></i>Patron's address is in doubt.</li>
225                   [% END %]
226                   [% IF checkout_info.CARD_LOST %]
227                       <li><i class="fa fa-li fa-exclamation"></i>Patron's card is lost.</li>
228                   [% END %]
229                   [% IF checkout_info.DEBARRED %]
230                       <li><i class="fa fa-li fa-exclamation"></i>Patron is restricted.</li>
231                   [% END %]
232                   [% IF checkout_info.NO_MORE_RENEWALS %]
233                       <li><i class="fa fa-li fa-exclamation"></i>No more renewals possible.</li>
234                   [% END %]
235                   [% IF checkout_info.EXPIRED %]
236                       <li><i class="fa fa-li fa-exclamation"></i>Patron's card is expired.</li>
237                   [% END %]
238                   [% IF checkout_info.ITEMNOTSAMEBRANCH %]
239                       <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>
240                   [% END %]
241                   [% IF checkout_info.USERBLOCKEDREMAINING %]
242                       <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>
243                   [% END %]
244                   [% IF checkout_info.USERBLOCKEDOVERDUE %]
245                       <li><i class="fa fa-li fa-exclamation"></i>Checkouts are BLOCKED because patron has overdue items.</li>
246                   [% END %]
247                   [% IF checkout_info.TOO_MANY %]
248                       <li><i class="fa fa-li fa-exclamation"></i>Too many checked out.</li>
249                   [% END %]
250                   [% IF checkout_info.UNKNOWN_BARCODE %]
251                       <li><i class="fa fa-li fa-exclamation"></i>The barcode was not found [% checkout_info.barcode | html %].</li>
252                   [% END %]
253                   [% IF checkout_info.DEBT %]
254                       <li><i class="fa fa-li fa-exclamation"></i>The patron has a debt of [% checkout_info.DEBT | $Price %].</li> <!-- Need debt_confirmed -->
255                   [% END %]
256                 </p>
257               [% END %]
258
259               [% IF checkout_info.issue.date_due %]
260                 <li>Due on [% checkout_info.issue.date_due | $KohaDates %]</li>
261               [% END %]
262             </td>
263           </tr>
264         [% END %]
265       </tbody>
266     </table>
267
268     [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
269         <fieldset>
270             <legend>Please confirm checkout</legend>
271       <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
272       <input type="hidden" name="issueconfirmed" value="1" />
273       <input type="hidden" name="debt_confirmed" value="1" />
274       <input type="hidden" name="branch" value="[% branch | html %]" />
275       <input type="hidden" name="batch" value="1" />
276       <input type="submit" id="checkoutrenew" class="approve" value="Checkout or renew" />
277         </fieldset>
278     </form>
279     [% END %]
280
281 [% ELSE %]
282     <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
283 [% END %]
284
285                   </main>
286                       </div> <!-- /.col-sm-10.col-sm-push-2 -->
287                       [% IF patron %]
288                           <div class="col-sm-2 col-sm-pull-10">
289                               <aside>
290                                   [% INCLUDE 'circ-menu.inc' %]
291                               </aside>
292                           </div> <!-- /.col-sm-2.col-sm-pull-10 -->
293                       [% END %]
294                   </div> <!-- /.row -->
295
296 [% MACRO jsinclude BLOCK %]
297     [% INCLUDE 'calendar.inc' %]
298     [% INCLUDE 'datatables.inc' %]
299     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
300     <script>
301         $(document).ready(function() {
302             if($('#barcodelist').length) {
303                 $('#barcodelist').focus();
304             } else if ($('#checkoutrenew').length) {
305                 $('#checkoutrenew').focus();
306             }
307             $("#checkout_infos").dataTable($.extend(true, {}, dataTablesDefaults, {
308                 "sDom": 't',
309                 "aaSorting": [],
310                 "aoColumnDefs": [
311                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
312                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
313                 ],
314                 "bPaginate": false
315             }));
316         });
317     </script>
318     [% INCLUDE 'str/members-menu.inc' %]
319     [% Asset.js("js/members-menu.js") | $raw %]
320 [% END %]
321
322 [% INCLUDE 'intranet-bottom.inc' %]