Lines 17-37
Link Here
|
17 |
$(document).ready(function() { |
17 |
$(document).ready(function() { |
18 |
var late_orderst = $("#late_orders").dataTable($.extend(true, {}, dataTablesDefaults, { |
18 |
var late_orderst = $("#late_orders").dataTable($.extend(true, {}, dataTablesDefaults, { |
19 |
"aoColumnDefs": [ |
19 |
"aoColumnDefs": [ |
20 |
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, |
20 |
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, |
21 |
], |
21 |
], |
22 |
"sPaginationType": "four_button" |
22 |
"sPaginationType": "four_button", |
|
|
23 |
"bAutoWidth": false, |
23 |
} ) ); |
24 |
} ) ); |
24 |
|
25 |
|
25 |
$("input:checkbox[name=claim_for]").click(function(){ |
26 |
$("input:checkbox[name=ordernumber]").click(function(){ |
26 |
var booksellerid = $(this).attr('booksellerid'); |
27 |
var booksellerid = $(this).attr('booksellerid'); |
27 |
if ( $("input:checkbox[name=claim_for]:checked").length > 0) { |
28 |
if ( $("input:checkbox[name=ordernumber]:checked").length > 0) { |
28 |
$("input:checkbox[name=claim_for][booksellerid!="+booksellerid+"]").attr('disabled', true); |
29 |
$("input:checkbox[name=ordernumber][booksellerid!="+booksellerid+"]").attr('disabled', true); |
29 |
} else { |
30 |
} else { |
30 |
$("input:checkbox[name=claim_for]").attr('disabled', false); |
31 |
$("input:checkbox[name=ordernumber]").attr('disabled', false); |
31 |
} |
32 |
} |
32 |
}); |
33 |
}); |
|
|
34 |
|
33 |
$('#CheckAll').click(function(){ $("#late_orders td").checkCheckboxes();}); |
35 |
$('#CheckAll').click(function(){ $("#late_orders td").checkCheckboxes();}); |
34 |
$('#CheckNone').click(function(){ $("#late_orders td").unCheckCheckboxes();}); |
36 |
$('#CheckNone').click(function(){ $("#late_orders td").unCheckCheckboxes();}); |
|
|
37 |
|
38 |
// Generates a dynamic link for exporting the selection's data as CSV |
39 |
$("#ExportSelected").click(function() { |
40 |
var selected = $("input[name='ordernumber']:checked"); |
41 |
|
42 |
if (selected.length == 0) { |
43 |
alert(_('Please select at least one item to export.')); |
44 |
return false; |
45 |
} |
46 |
|
47 |
// Building the url from currently checked boxes |
48 |
var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export'; |
49 |
for (var i = 0; i < selected.length; i++) { |
50 |
url += '&ordernumber=' + selected[i].value; |
51 |
} |
52 |
// And redirecting to the CSV page |
53 |
location.href = url; |
54 |
return false; |
55 |
}); |
35 |
}); |
56 |
}); |
36 |
//]]> |
57 |
//]]> |
37 |
</script> |
58 |
</script> |
Lines 75-82
$(document).ready(function() {
Link Here
|
75 |
</p> |
96 |
</p> |
76 |
[% END %] |
97 |
[% END %] |
77 |
<table id="late_orders"> |
98 |
<table id="late_orders"> |
78 |
<thead> |
99 |
<thead> |
79 |
<tr> |
100 |
<tr> |
|
|
101 |
[% IF Supplier %] |
102 |
<th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th> |
103 |
[% ELSE %] |
104 |
<th></th> |
105 |
[% END %] |
80 |
<th>Order date</th> |
106 |
<th>Order date</th> |
81 |
<th>Estimated delivery date</th> |
107 |
<th>Estimated delivery date</th> |
82 |
<th>Vendor</th> |
108 |
<th>Vendor</th> |
Lines 85-102
$(document).ready(function() {
Link Here
|
85 |
<th>Basket</th> |
111 |
<th>Basket</th> |
86 |
<th>Claims count</th> |
112 |
<th>Claims count</th> |
87 |
<th>Claimed date</th> |
113 |
<th>Claimed date</th> |
88 |
[% IF Supplier %] |
|
|
89 |
<th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th> |
90 |
[% ELSE %] |
91 |
<th></th> |
92 |
[% END %] |
93 |
</tr> |
114 |
</tr> |
94 |
</thead> |
115 |
</thead> |
95 |
<tbody> |
116 |
<tbody> |
96 |
[% FOREACH lateorder IN lateorders %] |
117 |
[% FOREACH lateorder IN lateorders %] |
97 |
[% UNLESS ( loop.odd ) %]<tr class="highlight"> |
118 |
[% UNLESS ( loop.odd ) %]<tr class="highlight"> |
98 |
[% ELSE %]<tr>[% END %] |
119 |
[% ELSE %]<tr>[% END %] |
99 |
<td> |
120 |
<td> |
|
|
121 |
<input type="checkbox" value="[% lateorder.ordernumber %]" booksellerid="[% lateorder.supplierid %]" name="ordernumber"> |
122 |
</td> |
123 |
<td> |
100 |
([% lateorder.supplierid %]) |
124 |
([% lateorder.supplierid %]) |
101 |
[% lateorder.orderdate %] |
125 |
[% lateorder.orderdate %] |
102 |
([% lateorder.latesince %] days) |
126 |
([% lateorder.latesince %] days) |
Lines 133-149
$(document).ready(function() {
Link Here
|
133 |
</td> |
157 |
</td> |
134 |
<td>[% lateorder.claims_count %]</td> |
158 |
<td>[% lateorder.claims_count %]</td> |
135 |
<td>[% lateorder.claimed_date %]</td> |
159 |
<td>[% lateorder.claimed_date %]</td> |
136 |
<td> |
|
|
137 |
[% UNLESS lateorder.budget_lock %] |
138 |
<input type="checkbox" class="checkbox" name="claim_for" value="[% lateorder.ordernumber %]" booksellerid="[% lateorder.supplierid %]"/> |
139 |
[% END %] |
140 |
</td> |
141 |
</td> |
142 |
</tr> |
160 |
</tr> |
143 |
[% END %] |
161 |
[% END %] |
144 |
</tbody> |
162 |
</tbody> |
145 |
<tfoot> |
163 |
<tfoot> |
146 |
<tr> |
164 |
<tr> |
147 |
<th>Total</th> |
165 |
<th>Total</th> |
148 |
<th> </th> |
166 |
<th> </th> |
149 |
<th> </th> |
167 |
<th> </th> |
Lines 153-163
$(document).ready(function() {
Link Here
|
153 |
<th> </th> |
171 |
<th> </th> |
154 |
<th> </th> |
172 |
<th> </th> |
155 |
<td> |
173 |
<td> |
156 |
<input type="submit" value="Claim Order" /> |
174 |
<input type="submit" value="Claim Order" /> |
157 |
</td> |
175 |
</td> |
158 |
</tr> |
176 |
</tr> |
159 |
</tfoot> |
177 |
</tfoot> |
160 |
</table> |
178 |
</table> |
|
|
179 |
<div class="spacer"></div> |
180 |
|
181 |
<p style="display:block;"> |
182 |
<input type="button" value="Export as CSV" id="ExportSelected" /> |
183 |
[% UNLESS lateorder.budget_lock %] |
184 |
<input type="submit" value="Claim Order" /> |
185 |
[% END %] |
186 |
</p> |
161 |
</form> |
187 |
</form> |
162 |
[% ELSE %]<p>There are no late orders.</p> |
188 |
[% ELSE %]<p>There are no late orders.</p> |
163 |
[% END %] |
189 |
[% END %] |