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