Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / am / edit_units.html
1 [%- USE T8 %][%- USE LxERP %][% USE L %]
2 [% USE HTML %]
3 <h1>[% title %]</h1>
4
5 [% INCLUDE "common/flash.html" %]
6
7 [% PROCESS "am/_units_header_info.html" %]
8
9 <hr>
10
11 <p>
12  [% 'Units that have already been used (e.g. for parts and services or in invoices or warehouse transactions) cannot be changed.' | $T8 %]
13 </p>
14
15 <p>
16  [% 'Units marked for deletion will be deleted upon saving.' | $T8 %]
17 </p>
18
19 <p>
20  [% 'You can declare different translations for singular and plural for each unit (e.g. &quot;day&quot; and &quot;days).' | $T8 %]
21 </p>
22
23 <form method="post" action="[% HTML.escape(script) %]" id="form">
24
25  <input type="hidden" name="type" value="unit">
26
27  <table id="unit_list">
28   <thead>
29   <tr class="listheading">
30    <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
31    <th>[% 'Delete' | $T8 %]</th>
32    <th>[% 'Unit' | $T8 %]</th>
33    <th>[% 'Base unit' | $T8 %]</th>
34    <th>[% 'Factor' | $T8 %]</th>
35    [% FOREACH language = LANGUAGES %]
36     <th>[% language.description %]</th>
37    [% END %]
38   </tr>
39   </thead>
40
41   <tbody>
42   [% FOREACH row = UNITS %]
43    <tr class="listrow[% loop.count % 2 %]" id="unit_id_[% row.id %]">
44     <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
45     [% IF row.in_use %]
46      <td>
47       <input type="hidden" name="unchangeable_[% loop.count %]" value="1">
48       <input type="hidden" name="old_name_[% loop.count %]" value="[% HTML.escape(row.name) %]">
49      </td>
50
51      <td>[% HTML.escape(row.name) %]</td>
52      <td>[% IF row.base_unit %][% HTML.escape(row.base_unit) %][% ELSE %]---[% END %]</td>
53      <td>[% IF row.base_unit %][% HTML.escape(row.factor) %][% ELSE %]---[% END %]</td>
54
55      [% ELSE %]
56
57      <td align="center"><input type="checkbox" name="delete_[% loop.count %]"></td>
58      <td>
59       <input type="hidden" name="old_name_[% loop.count %]" value="[% HTML.escape(row.name) %]">
60       <input name="name_[% loop.count %]" size="10" maxlength="20" value="[% HTML.escape(row.name) %]">
61      </td>
62      <td>
63       <select name="base_unit_[% loop.count %]">
64        [% FOREACH option = row.BASE_UNIT_DDBOX %]<option [% option.selected %]>[% HTML.escape(option.name) %]</option>[% END %]
65       </select>
66      </td>
67      <td><input name="factor_[% loop.count %]" size="8" value="[% row.factor %]"></td>
68     [% END %]
69
70     [% FOREACH language = row.UNITLANGUAGES %]
71      <td>
72       [% 'singular first char' | $T8 %]:
73       <input name="localized_[% language.idx %]_[% language.language_id %]" value="[% HTML.escape(language.localized) %]" size="6" maxlength="20">
74       [% 'plural first char' | $T8 %]:
75       <input name="localized_plural_[% language.idx %]_[% language.language_id %]" value="[% HTML.escape(language.localized_plural) %]" size="6" maxlength="20">
76      </td>
77     [% END %]
78    </tr>
79   [% END %]
80   </tbody>
81  </table>
82
83  <input type="hidden" name="rowcount" value="[% UNITS.size %]">
84
85  </form>
86
87  [% L.sortable_element('#unit_list tbody', url => 'controller.pl?action=Unit/reorder', with => 'unit_id') %]