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