|
1 |
[%- USE T8 %]
|
|
2 |
[%- USE HTML %]
|
|
3 |
[%- USE LxERP %]
|
|
4 |
[%- USE JavaScript -%]
|
|
5 |
<script type="text/javascript" src="js/common.js"></script>
|
|
6 |
<script type="text/javascript" src="js/parts_language_selection.js"></script>
|
|
7 |
<script type="text/javascript">
|
|
8 |
<!--
|
|
9 |
warehouses = new Array();
|
|
10 |
[%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
|
|
11 |
warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
|
|
12 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
|
|
13 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
|
|
14 |
[% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
|
|
15 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count - 1 %]] = new Array();
|
|
16 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
|
|
17 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
|
|
18 |
[% END %]
|
|
19 |
[% END %]
|
|
20 |
|
|
21 |
function warehouse_selected(warehouse_id, bin_id) {
|
|
22 |
var control = document.getElementById("bin_id");
|
|
23 |
|
|
24 |
for (var i = control.options.length - 1; i >= 0; i--) {
|
|
25 |
control.options[i] = null;
|
|
26 |
}
|
|
27 |
|
|
28 |
var warehouse_index = 0;
|
|
29 |
|
|
30 |
for (i = 0; i < warehouses.length; i++)
|
|
31 |
if (warehouses[i]['id'] == warehouse_id) {
|
|
32 |
warehouse_index = i;
|
|
33 |
break;
|
|
34 |
}
|
|
35 |
|
|
36 |
var warehouse = warehouses[warehouse_index];
|
|
37 |
var bin_index = 0;
|
|
38 |
|
|
39 |
for (i = 0; i < warehouse['bins'].length; i++)
|
|
40 |
if (warehouse['bins'][i]['id'] == bin_id) {
|
|
41 |
bin_index = i;
|
|
42 |
break;
|
|
43 |
}
|
|
44 |
|
|
45 |
for (i = 0; i < warehouse['bins'].length; i++) {
|
|
46 |
control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
|
|
47 |
}
|
|
48 |
|
|
49 |
|
|
50 |
control.options[bin_index].selected = true;
|
|
51 |
}
|
|
52 |
|
|
53 |
$(function() {
|
|
54 |
warehouse_selected([% warehouse_id %], [% bin_id %]);
|
|
55 |
})
|
|
56 |
-->
|
|
57 |
</script>
|
Nachtrag zum Commit von eben zu für 2284
Copy / Paste Fehler in form_header.html
Copy / Paste Fehler in Default.pm
Vergessene ausgelagerte common select_warehouse_bin.html
hinzugefügt.