Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5a577869

Von Hans Peter Schlaepfer vor mehr als 5 Jahren hinzugefügt

  • ID 5a5778690d576dc50a3209255c219a6463a6d7ed
  • Vorgänger ccbe3efb
  • Nachfolger a8253337

Neues kivitendo Design Aenderungen in templates/webpages/wh/..

Unterschiede anzeigen:

templates/webpages/wh/warehouse_selection.html
1
[%- USE T8 %]
2
[%- USE HTML %]
3
[%- USE L %]
4
[%- USE JavaScript %][%- USE P -%]
1
[% USE T8 %]
2
[% USE HTML %]
3
[% USE L %]
4
[% USE JavaScript %]
5
[% USE P %]
6

  
5 7
<h1>[% title %]</h1>
6 8

  
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
      warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0] = new Array();
15
      warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['description'] = "---";
16
      warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['id'] = "";
17
      [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
9
<script type="text/javascript"><!--
10
  warehouses = new Array();
11
  [% USE WAREHOUSES_it = Iterator(WAREHOUSES) %]
12
  [% FOREACH warehouse = WAREHOUSES_it %]
13
    warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
14
    warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
15
    warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
16
    warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0] = new Array();
17
    warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['description'] = "---";
18
    warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['id'] = "";
19
    [% USE BINS_it = Iterator(warehouse.BINS) %]
20
    [% FOREACH bin = BINS_it %]
18 21
      warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]] = new Array();
19 22
      warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['description'] = "[% JavaScript.escape(bin.description) %]";
20 23
      warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['id'] = [% bin.id %];
21
      [% END %]
22
      [% END %]
24
    [% END %]
25
  [% END %]
23 26

  
24
      function warehouse_selected(warehouse_id, bin_id) {
25
        var control = document.getElementById("bin_id");
27
  function warehouse_selected(warehouse_id, bin_id) {
28
    var control = document.getElementById("bin_id");
26 29

  
27
        for (var i = control.options.length - 1; i >= 0; i--) {
28
          control.options[i] = null;
29
        }
30
    for (var i = control.options.length - 1; i >= 0; i--) {
31
      control.options[i] = null;
32
    }
30 33

  
31
        var warehouse_index = 0;
34
    var warehouse_index = 0;
32 35

  
33
        for (i = 0; i < warehouses.length; i++)
34
          if (warehouses[i]['id'] == warehouse_id) {
35
            warehouse_index = i;
36
            break;
37
          }
36
    for (i = 0; i < warehouses.length; i++)
37
      if (warehouses[i]['id'] == warehouse_id) {
38
        warehouse_index = i;
39
        break;
40
      }
38 41

  
39
        var warehouse = warehouses[warehouse_index];
40
        var bin_index = 0;
42
    var warehouse = warehouses[warehouse_index];
43
    var bin_index = 0;
41 44

  
42
        for (i = 0; i < warehouse['bins'].length; i++)
43
          if (warehouse['bins'][i]['id'] == bin_id) {
44
            bin_index = i;
45
            break;
46
          }
45
    for (i = 0; i < warehouse['bins'].length; i++)
46
      if (warehouse['bins'][i]['id'] == bin_id) {
47
        bin_index = i;
48
        break;
49
      }
47 50

  
48
        for (i = 0; i < warehouse['bins'].length; i++) {
49
          control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
50
        }
51
    for (i = 0; i < warehouse['bins'].length; i++) {
52
      control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
53
    }
51 54

  
52 55

  
53
        control.options[bin_index].selected = true;
54
      }
56
    control.options[bin_index].selected = true;
57
  }
55 58

  
56
      $(function() {
57
        warehouse_selected(0, 0);
58
        document.Form.partnumber.focus();
59
      });
60
     -->
61
 </script>
59
  $(function() {
60
    warehouse_selected(0, 0);
61
    document.Form.partnumber.focus();
62
  });
63
--></script>
62 64

  
63
 <form name="Form" method="post" action="wh.pl" id="form">
65
<form name="Form" method="post" action="wh.pl" id="form">
66
<div class="wrapper">
64 67

  
65
  [% IF saved_message %]
68
[% IF saved_message %]
66 69
  <p>[% saved_message %]</p>
67
  [% END %]
70
[% END %]
68 71

  
69
  <p>
70
   [% 'If you enter values for the part number and / or part description then only those bins containing parts whose part number or part description match your input will be shown.' | $T8 %]
71
  </p>
72
<p>[% 'If you enter values for the part number and / or part description then only those bins containing parts whose part number or part description match your input will be shown.' | $T8 %]</p>
72 73

  
73
  <p>
74
   <table>
74
<table class="tbl-horizontal">
75
  <tbody>
75 76
    <tr>
76
     <th align="right" nowrap>[% 'Transfer from warehouse' | $T8 %]:</th>
77
     <td>
78
      <select name="warehouse_id" id="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
79
       [%- FOREACH warehouse = WAREHOUSES %]
80
       <option value="[% HTML.escape(warehouse.id) %]">[% warehouse.description %]</option>
81
       [%- END %]
82
      </select>
83
     </td>
77
      <th>[% 'Transfer from warehouse' | $T8 %]</th>
78
      <td>
79
        <select name="warehouse_id" id="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)" class="wi-lightwide">
80
          [% FOREACH warehouse = WAREHOUSES %]
81
          <option value="[% HTML.escape(warehouse.id) %]">[% warehouse.description %]</option>
82
          [% END %]
83
        </select>
84
      </td>
84 85
    </tr>
85

  
86 86
    <tr>
87
     <th align="right" nowrap>[% 'Bin' | $T8 %]:</th>
88
     <td><select id="bin_id" name="bin_id"></select></td>
87
      <th>[% 'Bin' | $T8 %]</th>
88
      <td>
89
        <select id="bin_id" name="bin_id" class="wi-lightwide"></select>
90
      </td>
89 91
    </tr>
90

  
91 92
    <tr>
92
     <th align="right" nowrap>[% 'Limit part selection' | $T8 %]:</th>
93
     <td></td>
93
      <th>[% 'Limit part selection' | $T8 %]</th>
94
      <td><span class="plain-data">&nbsp;</span></td>
94 95
    </tr>
95

  
96 96
    <tr>
97
     <th align="right" nowrap>[% 'Part' | $T8 %]</th>
98
     <td>
99
      [% P.part.picker("part_id", '', size="30", part_type="part,assembly") %]
100
     </td>
97
      <th>[% 'Part' | $T8 %]</th>
98
      <td>[% P.part.picker("part_id", '', part_type="part,assembly", class="wi-lightwide") %]</td>
101 99
    </tr>
102

  
103 100
    <tr>
104
     <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
105
     <td><input name="chargenumber" size="30"></td>
101
      <th>[% 'Charge number' | $T8 %]</th>
102
      <td><input type="text" name="chargenumber" class="wi-lightwide"></td>
106 103
    </tr>
107

  
108 104
    [% IF INSTANCE_CONF.get_show_bestbefore %]
109
    <tr>
110
     <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
111
     <td>
112
       [% L.date_tag('bestbefore') %]
113
     </td>
114
    </tr>
105
      <tr>
106
        <th>[% 'Best Before' | $T8 %]</th>
107
        <td><span class="wi-date">[% L.date_tag('bestbefore') %]</span></td>
108
      </tr>
115 109
    [% END %]
116

  
117 110
    <tr>
118
     <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
119
     <td><input name="ean" size="30"></td>
111
      <th>[% 'EAN' | $T8 %]</th>
112
      <td><input type="text" name="ean" class="wi-lightwide"></td>
120 113
    </tr>
121
   </table>
122
  </p>
123
 </form>
114
  </tbody>
115
</table>
116

  
117
</div><!-- /.wrapper -->
118
</form>

Auch abrufbar als: Unified diff