Bug 10904: Limit patron update request management by branch
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / lateorders.tt
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% USE ColumnsSettings %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'datatables.inc' %]
9 [% INCLUDE 'columns_settings.inc' %]
10 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
11 [% INCLUDE 'calendar.inc' %]
12 <script type="text/javascript">
13 //<![CDATA[
14
15 var late_orderst;
16 function check_uncheck() {
17     var all_nodes = $(late_orderst.fnGetNodes());
18     if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) {
19         var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid");
20         $(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").attr('disabled', 'disabled');
21     } else {
22         $("input:checkbox[name=ordernumber]").removeAttr('disabled');
23     }
24 }
25
26 $(document).ready(function() {
27
28     var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %];
29     late_orderst = KohaTable("#late_orders", {
30         "aoColumnDefs": [
31             { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
32             { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
33             { "sType": "title-string", "aTargets" : [ "title-string" ] }
34         ],
35         "sPaginationType": "four_button",
36         "bAutoWidth": false,
37         "fnDrawCallback": function() {
38             if ( typeof late_orderst != 'undefined' ) {
39                 check_uncheck();
40                 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
41             };
42         }
43     }, columns_settings );
44     $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
45     $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
46     $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});
47
48     // Generates a dynamic link for exporting the selection's data as CSV
49     $("#ExportSelected").click(function() {
50         var all_nodes = $(late_orderst.fnGetNodes());
51         var selected = $(all_nodes).find("input[name='ordernumber']:checked");
52
53         if (selected.length == 0) {
54             alert(_("Please select at least one item to export."));
55             return false;
56         }
57
58         // Building the url from currently checked boxes
59         var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
60         for (var i = 0; i < selected.length; i++) {
61             url += '&amp;ordernumber=' + selected[i].value;
62         }
63         // And redirecting to the CSV page
64         location.href = url;
65         return false;
66     });
67 });
68 //]]>
69 </script>
70 </head>
71 <body id="acq_lateorders" class="acq">
72 [% INCLUDE 'header.inc' %]
73 [% INCLUDE 'acquisitions-search.inc' %]
74
75 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="lateorders.pl">Late orders</a></div>
76
77 <div id="doc3" class="yui-t2">
78    
79    <div id="bd">
80         <div id="yui-main">
81         <div class="yui-b">
82         
83 <h1>[% IF ( Supplier ) %][% Supplier %] : [% END %]Late orders</h1>
84 <div id="acqui_lateorders">
85
86 [% IF error_claim %]
87     [% IF ( error_claim == "no_email" ) %]
88         <div class="error">This vendor has no email</div>
89     [% ELSIF ( error_claim == "no_order_seleted" ) %]
90         <div class="error">No order selected</div>
91     [% ELSE %]
92         <div class="error">[% error_claim %]</div>
93     [% END %]
94 [% END %]
95 [% IF info_claim %]
96     <div class="dialog message">Email has been sent.</div>
97 [% END %]
98 [% IF ( lateorders ) %]
99 <form action="lateorders.pl" name="claim" method="post">
100   <input type="hidden" name="op" value="send_alert" />
101   <input type="hidden" name="delay" value="[% delay | html%]" />
102   <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
103         [% IF ( letters ) %]
104         <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
105           [% FOREACH letter IN letters %]
106                 <option value="[% letter.code %]">[% letter.name %]</option>
107           [% END %]
108           </select>
109         </p>
110         [% END %]
111     <table id="late_orders">
112       <thead>
113         <tr>
114             [% IF Supplier %]
115                 <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th>
116             [% ELSE %]
117                 <th></th>
118             [% END %]
119             <th class="title-string">Order date</th>
120             <th class="title-string">Estimated delivery date</th>
121             <th>Vendor</th>
122             <th class="anti-the">Information</th>
123             <th>Total cost</th>
124             <th>Basket</th>
125             <th>Basket group</th>
126             <th>Library</th>
127             <th>Fund</th>
128             <th>Claims count</th>
129             <th class="title-string">Claimed date</th>
130         </tr>
131       </thead>
132       <tbody>
133       [% FOREACH lateorder IN lateorders %]
134         [% UNLESS ( loop.odd ) %]<tr class="highlight">
135         [% ELSE %]<tr>[% END %]
136             <td>
137                 <input type="checkbox" value="[% lateorder.ordernumber %]" data-booksellerid="[% lateorder.supplierid %]" name="ordernumber">
138             </td>
139             <td>
140                 <span title="[% lateorder.orderdate %]">[% lateorder.orderdate | $KohaDates %] ([% lateorder.latesince %] days)</span>
141             </td>
142             <td>
143                 [% IF ( lateorder.estimateddeliverydate ) %]
144                     <span title="[% lateorder.estimateddeliverydate %]">[% lateorder.estimateddeliverydate | $KohaDates  %]</span>
145                 [% ELSE %]
146                     <span title="0000-00-00"></span>
147                 [% END %]
148             </td>
149             <td>
150                 [% lateorder.supplier %]
151                 ([% lateorder.supplierid %])
152             </td>
153             <td>
154                 <b>[% lateorder.title |html %]</b>
155                    [% IF ( lateorder.author ) %]<br/><i>Author:</i> [% lateorder.author %][% END %]
156                    [% IF ( lateorder.publisher ) %]
157                         <br/><i>Published by:</i> [% lateorder.publisher %]
158                         [% IF ( lateorder.publicationyear ) %]
159                             <i> in </i>[% lateorder.publicationyear %]
160                         [% END %]
161                    [% END %]
162             </td>
163             <td>
164                    [% lateorder.unitpricesupplier %]x[% lateorder.quantity %] = 
165                    [% lateorder.subtotal %]
166             </td>
167             <td>
168                 [% IF ( CAN_user_acquisition_order_manage ) %]
169                     <a href="basket.pl?basketno=[% lateorder.basketno %]" title="basket">[% lateorder.basketname %] ([% lateorder.basketno %])</a>
170                 [% ELSE %]
171                     [% lateorder.basketname %] ([% lateorder.basketno %])
172                 [% END %]
173             </td>
174             <td>
175                 [% IF ( lateorder.basketgroupid ) %]
176                     [% IF ( CAN_user_acquisition_group_manage ) %]
177                         <a href="basketgroup.pl?op=add&booksellerid=[% lateorder.supplierid %]&basketgroupid=[% lateorder.basketgroupid %]" title="basketgroup">[% lateorder.basketgroupname %] ([% lateorder.basketgroupid %])</a>
178                     [% ELSE %]
179                         [% lateorder.basketgroupname %] ([% lateorder.basketgroupid %])</a>
180                     [% END %]
181                 [% END %]
182             </td>
183             <td>[% Branches.GetName( lateorder.branch ) %]
184             </td>
185             <td>[% lateorder.budget %]
186             </td>
187             <td>[% lateorder.claims_count %]</td>
188             <td>
189                 [% IF ( lateorder.claimed_date ) %]
190                     <span title="[% lateorder.claimed_date %]">[% lateorder.claimed_date | $KohaDates %]</span>
191                 [% ELSE %]
192                     <span title="0000-00-00"></span>
193                 [% END %]
194             </td>
195         </tr>
196       [% END %]
197       </tbody>
198       <tfoot>
199         <tr>
200             <th colspan="5">Total</th>
201             <th>[% total %]</th>
202             <th colspan="6">&nbsp;</th>
203         </tr>
204       </tfoot>
205     </table>
206     <div class="spacer"></div>
207
208     <p style="display:block;">
209         <input type="button" value="Export as CSV" id="ExportSelected" />
210         [% UNLESS lateorder.budget_lock %]
211             <input type="submit"  value="Claim order" />
212         [% END %]
213     </p>
214 </form>
215 [% ELSE %]<p>There are no late orders.</p>
216 [% END %]
217 </div>
218 </div>
219 </div>
220 <div class="yui-b">
221 <form action="lateorders.pl" method="get">
222 <fieldset class="brief">
223 <h4>Filter results:</h4>
224 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
225 [% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay | html %]) must be a number between 0 and 999.</p>[% END %]
226 [% END %]
227 <ol>
228     <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay | html%]" /> days ago</li>
229     <li><label for="from">Estimated delivery date from: </label>
230         <input type="text" size="10" id="from" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" class="datepickerfrom" />
231         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
232     </li>
233     <li><label for="to">To: </label>
234         <input type="text" size="10" id="to" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" class="datepickerto" />
235         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
236     </li>
237
238         <li><label for="booksellerid">Vendor:</label>
239                 <select id="booksellerid" size="1" tabindex="" name="booksellerid">
240             <option value=""></option>
241                         [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %]
242                 [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id %]" selected="selected">[% SUPPLIER_LOO.name %]</option>
243                 [% ELSE %]<option value="[% SUPPLIER_LOO.id %]">[% SUPPLIER_LOO.name %]</option>[% END %]
244                 [% END %]
245                 </select>
246 </ol>
247     <fieldset class="action"><input type="submit" value="Filter" /></fieldset>
248 </fieldset>
249     </form>
250 [% INCLUDE 'acquisitions-menu.inc' %]
251 </div>
252 </div>
253 [% INCLUDE 'intranet-bottom.inc' %]