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