|
Lines 5-20
Link Here
|
| 5 |
<script type="text/javascript"> |
5 |
<script type="text/javascript"> |
| 6 |
//<![CDATA[ |
6 |
//<![CDATA[ |
| 7 |
$(document).ready(function() { |
7 |
$(document).ready(function() { |
| 8 |
$("input:checkbox[name=claim_for]").click(function(){ |
8 |
$("input:checkbox[name=ordernumber]").click(function(){ |
| 9 |
var booksellerid = $(this).attr('booksellerid'); |
9 |
var booksellerid = $(this).attr('booksellerid'); |
| 10 |
if ( $("input:checkbox[name=claim_for]:checked").length > 0) { |
10 |
if ( $("input:checkbox[name=ordernumber]:checked").length > 0) { |
| 11 |
$("input:checkbox[name=claim_for][booksellerid!="+booksellerid+"]").attr('disabled', true); |
11 |
$("input:checkbox[name=ordernumber][booksellerid!="+booksellerid+"]").attr('disabled', true); |
| 12 |
} else { |
12 |
} else { |
| 13 |
$("input:checkbox[name=claim_for]").attr('disabled', false); |
13 |
$("input:checkbox[name=ordernumber]").attr('disabled', false); |
| 14 |
} |
14 |
} |
| 15 |
}); |
15 |
}); |
|
|
16 |
|
| 17 |
$("span.exportSelected").html("<a id=\"ExportSelected\" href=\"/cgi-bin/koha/acqui/lateorders.pl\"> "+_("Export selected items data") +"<\/a>"); |
| 18 |
|
| 16 |
$('#CheckAll').click(function(){ $("#late_orders td").checkCheckboxes();}); |
19 |
$('#CheckAll').click(function(){ $("#late_orders td").checkCheckboxes();}); |
| 17 |
$('#CheckNone').click(function(){ $("#late_orders td").unCheckCheckboxes();}); |
20 |
$('#CheckNone').click(function(){ $("#late_orders td").unCheckCheckboxes();}); |
|
|
21 |
|
| 22 |
// Generates a dynamic link for exporting the selection's data as CSV |
| 23 |
$("#ExportSelected").click(function() { |
| 24 |
var selected = $("input[name='ordernumber']:checked"); |
| 25 |
|
| 26 |
if (selected.length == 0) { |
| 27 |
alert(_('Please select at least one item to export.')); |
| 28 |
return false; |
| 29 |
} |
| 30 |
|
| 31 |
// Building the url from currently checked boxes |
| 32 |
var url = '/cgi-bin/koha/acqui/lateorders-excel.pl?op=export'; |
| 33 |
for (var i = 0; i < selected.length; i++) { |
| 34 |
url += '&ordernumber=' + selected[i].value; |
| 35 |
} |
| 36 |
// And redirecting to the CSV page |
| 37 |
location.href = url; |
| 38 |
return false; |
| 39 |
}); |
| 18 |
}); |
40 |
}); |
| 19 |
//]]> |
41 |
//]]> |
| 20 |
</script> |
42 |
</script> |
|
Lines 59-64
$(document).ready(function() {
Link Here
|
| 59 |
[% END %] |
81 |
[% END %] |
| 60 |
<table id="late_orders"> |
82 |
<table id="late_orders"> |
| 61 |
<tr> |
83 |
<tr> |
|
|
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 %] |
| 62 |
<th>Order Date</th> |
89 |
<th>Order Date</th> |
| 63 |
<th>Vendor</th> |
90 |
<th>Vendor</th> |
| 64 |
<th>Information</th> |
91 |
<th>Information</th> |
|
Lines 66-81
$(document).ready(function() {
Link Here
|
| 66 |
<th>Basket</th> |
93 |
<th>Basket</th> |
| 67 |
<th>Claims count</th> |
94 |
<th>Claims count</th> |
| 68 |
<th>Claimed date</th> |
95 |
<th>Claimed date</th> |
| 69 |
[% IF Supplier %] |
|
|
| 70 |
<th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th> |
| 71 |
[% ELSE %] |
| 72 |
<th></th> |
| 73 |
[% END %] |
| 74 |
</tr> |
96 |
</tr> |
| 75 |
[% FOREACH lateorder IN lateorders %] |
97 |
[% FOREACH lateorder IN lateorders %] |
| 76 |
[% UNLESS ( loop.odd ) %]<tr class="highlight"> |
98 |
[% UNLESS ( loop.odd ) %]<tr class="highlight"> |
| 77 |
[% ELSE %]<tr>[% END %] |
99 |
[% ELSE %]<tr>[% END %] |
| 78 |
<td> |
100 |
<td> |
|
|
101 |
<input type="checkbox" value="[% lateorder.ordernumber %]" booksellerid="[% lateorder.supplierid %]" name="ordernumber"> |
| 102 |
</td> |
| 103 |
<td> |
| 79 |
([% lateorder.supplierid %]) |
104 |
([% lateorder.supplierid %]) |
| 80 |
[% lateorder.orderdate %] |
105 |
[% lateorder.orderdate %] |
| 81 |
([% lateorder.latesince %] days) |
106 |
([% lateorder.latesince %] days) |
|
Lines 107-133
$(document).ready(function() {
Link Here
|
| 107 |
</td> |
132 |
</td> |
| 108 |
<td>[% lateorder.claims_count %]</td> |
133 |
<td>[% lateorder.claims_count %]</td> |
| 109 |
<td>[% lateorder.claimed_date %]</td> |
134 |
<td>[% lateorder.claimed_date %]</td> |
| 110 |
<td> |
|
|
| 111 |
[% UNLESS lateorder.budget_lock %] |
| 112 |
<input type="checkbox" class="checkbox" name="claim_for" value="[% lateorder.ordernumber %]" booksellerid="[% lateorder.supplierid %]"/> |
| 113 |
[% END %] |
| 114 |
</td> |
| 115 |
</td> |
| 116 |
</tr> |
135 |
</tr> |
| 117 |
[% END %] |
136 |
[% END %] |
| 118 |
<tr> |
137 |
<tfoot> |
| 119 |
<th>Total</th> |
138 |
<tr> |
| 120 |
<th colspan="2"> </th> |
139 |
<th>Total</th> |
| 121 |
<th>[% total %]</th> |
140 |
<th colspan="3"> </th> |
| 122 |
<th> </th> |
141 |
<th>[% total %]</th> |
| 123 |
<th> </th> |
142 |
<th> </th> |
| 124 |
<th> </th> |
143 |
<th> </th> |
| 125 |
<td> |
144 |
<th> </th> |
| 126 |
<input type="submit" value="Claim Order" /> |
145 |
</tr> |
| 127 |
</td> |
146 |
</tfoot> |
| 128 |
</tr> |
|
|
| 129 |
</table> |
147 |
</table> |
| 130 |
</form> |
148 |
<div class="spacer"></div> |
|
|
149 |
<p style="display:block;"><span class="exportSelected"></span></p> |
| 150 |
[% UNLESS lateorder.budget_lock %] |
| 151 |
<p style="display:block;"><input type="submit" value="Claim Order" /></p> |
| 152 |
[% END %] |
| 153 |
</form> |
| 131 |
[% ELSE %]<p>There are no late orders.</p> |
154 |
[% ELSE %]<p>There are no late orders.</p> |
| 132 |
[% END %] |
155 |
[% END %] |
| 133 |
</div> |
156 |
</div> |
| 134 |
- |
|
|