<body> entfernt.
[kivitendo-erp.git] / templates / webpages / am / edit_units.html
1 [%- USE T8 %][%- USE LxERP %][% USE L %]
2 [% USE HTML %]
3
4 <script type="text/javascript" src="js/jquery-ui.js"></script>
5
6
7  [% IF saved_message %]
8   <p>[% saved_message %]</p>
9
10   <hr>
11  [% END %]
12
13  <form method="post" action="[% HTML.escape(script) %]">
14
15  <input type="hidden" name="type" value="unit">
16
17  <table width="100%">
18   <tr>
19    <th class="listtop" colspan="2">[% title %]</th>
20   </tr>
21   <tr height="5"></tr>
22  </table>
23
24  <p>
25   [% LxERP.t8('All units have either no or exactly one base unit of which they are multiples.') %]
26   [% LxERP.t8('If you select a base unit then you also have to enter a factor.') %]
27   [% LxERP.t8('You have to define a unit as a multiple of a smaller unit.') %]
28   [% LxERP.t8('Therefore the definition of "kg" with the base unit "g" and a factor of 1000 is valid while defining "g" with a base unit of "kg" and a factor of "0.001" is not.') %]
29  </p>
30
31  <hr>
32
33  <table width="100%">
34   <tr><th class="listtop">[% 'Add unit' | $T8 %]</th></tr>
35  </table>
36
37  <table>
38   <tr>
39    <th align="right">[% 'Unit' | $T8 %]</th>
40    <td><input name="new_name" size="20" maxlength="20"></td>
41   </tr>
42   <tr>
43    <th align="right">[% 'Base unit' | $T8 %]</th>
44    <td>
45     <select name="new_base_unit">
46      [% FOREACH row = NEW_BASE_UNIT_DDBOX %]<option [% row.selected %]>[% row.name %]</option>[% END %]
47     </select>
48    </td>
49   </tr>
50   <tr>
51    <th align="right">[% 'Factor' | $T8 %]</th>
52    <td><input name="new_factor"></td>
53   </tr>
54
55   [% FOREACH language = LANGUAGES %]
56    <tr>
57     <th align="right">[% language.description %]</th>
58     <td><input name="new_localized_[% language.id %]" size="20" maxlength="20"></td>
59     <th align="right">[% 'Plural' | $T8 %]</th>
60     <td><input name="new_localized_plural_[% language.id %]" size="20" maxlength="20"></td>
61    </tr>
62   [% END %]
63  </table>
64
65  <input type="submit" class="submit" name="action" value="[% 'Add' | $T8 %]">
66
67  <hr>
68
69  <table width="100%">
70   <tr><th class="listtop">[% 'Edit units' | $T8 %]</th></tr>
71  </table>
72
73  <p>
74   [% 'Units that have already been used (e.g. for parts and services or in invoices or warehouse transactions) cannot be changed.' | $T8 %]
75  </p>
76
77  <p>
78   [% 'Units marked for deletion will be deleted upon saving.' | $T8 %]
79  </p>
80
81  <p>
82   [% 'You can declare different translations for singular and plural for each unit (e.g. &quot;day&quot; and &quot;days).' | $T8 %]
83  </p>
84
85  <table id="unit_list">
86   <thead>
87   <tr class="listheading">
88    <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
89    <th>[% 'Delete' | $T8 %]</th>
90    <th>[% 'Unit' | $T8 %]</th>
91    <th>[% 'Base unit' | $T8 %]</th>
92    <th>[% 'Factor' | $T8 %]</th>
93    [% FOREACH language = LANGUAGES %]
94     <th>[% language.description %]</th>
95    [% END %]
96   </tr>
97   </thead>
98
99   <tbody>
100   [% FOREACH row = UNITS %]
101    <tr class="listrow[% loop.count % 2 %]" id="unit_id_[% row.id %]">
102     <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
103     [% IF row.in_use %]
104      <td>
105       <input type="hidden" name="unchangeable_[% loop.count %]" value="1">
106       <input type="hidden" name="old_name_[% loop.count %]" value="[% HTML.escape(row.name) %]">
107      </td>
108
109      <td>[% HTML.escape(row.name) %]</td>
110      <td>[% IF row.base_unit %][% HTML.escape(row.base_unit) %][% ELSE %]---[% END %]</td>
111      <td>[% IF row.base_unit %][% HTML.escape(row.factor) %][% ELSE %]---[% END %]</td>
112
113      [% ELSE %]
114
115      <td align="center"><input type="checkbox" name="delete_[% loop.count %]"></td>
116      <td>
117       <input type="hidden" name="old_name_[% loop.count %]" value="[% HTML.escape(row.name) %]">
118       <input name="name_[% loop.count %]" size="10" maxlength="20" value="[% HTML.escape(row.name) %]">
119      </td>
120      <td>
121       <select name="base_unit_[% loop.count %]">
122        [% FOREACH option = row.BASE_UNIT_DDBOX %]<option [% option.selected %]>[% HTML.escape(option.name) %]</option>[% END %]
123       </select>
124      </td>
125      <td><input name="factor_[% loop.count %]" size="8" value="[% row.factor %]"></td>
126     [% END %]
127
128     [% FOREACH language = row.UNITLANGUAGES %]
129      <td>
130       [% 'singular first char' | $T8 %]:
131       <input name="localized_[% language.idx %]_[% language.language_id %]" value="[% HTML.escape(language.localized) %]" size="6" maxlength="20">
132       [% 'plural first char' | $T8 %]:
133       <input name="localized_plural_[% language.idx %]_[% language.language_id %]" value="[% HTML.escape(language.localized_plural) %]" size="6" maxlength="20">
134      </td>
135     [% END %]
136    </tr>
137   [% END %]
138   </tbody>
139  </table>
140
141  <input type="hidden" name="rowcount" value="[% UNITS.size %]">
142
143  <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
144
145  </form>
146
147  [% L.sortable_element('#unit_list tbody', url => 'controller.pl?action=Unit/reorder', with => 'unit_id') %]
148