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