Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9f5bccd8

Von Jan Büren vor mehr als 11 Jahren hinzugefügt

  • ID 9f5bccd896bc0684521e270ec9a158dba097aa99
  • Vorgänger 82053b45
  • Nachfolger ba0c9f34

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.

Unterschiede anzeigen:

SL/DB/MetaSetup/Default.pm
85 85
    warehouse => {
86 86
      class       => 'SL::DB::Warehouse',
87 87
      key_columns => { warehouse_id => 'id' },
88

  
88
    },
89 89
    currency => {
90 90
      class       => 'SL::DB::Currency',
91 91
      key_columns => { currency_id => 'id' },
templates/webpages/common/select_warehouse_bin.html
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>
templates/webpages/ic/form_header.html
1
[[%- USE T8 %]
1
[%- USE T8 %]
2 2
[%- USE HTML %]
3 3
[%- USE LxERP %]
4 4
[% PROCESS 'common/select_warehouse_bin.html' %]

Auch abrufbar als: Unified diff