[%- USE T8 %][%- USE LxERP %][% USE L %]
[% USE HTML %]
+<h1>[% title %]</h1>
-<script type="text/javascript" src="js/jquery-ui.js"></script>
+[% INCLUDE "common/flash.html" %]
-<body>
+[% PROCESS "am/_units_header_info.html" %]
- [% IF saved_message %]
- <p>[% saved_message %]</p>
+<hr>
- <hr>
- [% END %]
+<p>
+ [% 'Units that have already been used (e.g. for parts and services or in invoices or warehouse transactions) cannot be changed.' | $T8 %]
+</p>
- <form method="post" action="[% HTML.escape(script) %]">
+<p>
+ [% 'Units marked for deletion will be deleted upon saving.' | $T8 %]
+</p>
- <input type="hidden" name="type" value="unit">
-
- <table width="100%">
- <tr>
- <th class="listtop" colspan="2">[% title %]</th>
- </tr>
- <tr height="5"></tr>
- </table>
-
- <p>
- [% LxERP.t8('All units have either no or exactly one base unit of which they are multiples.') %]
- [% LxERP.t8('If you select a base unit then you also have to enter a factor.') %]
- [% LxERP.t8('You have to define a unit as a multiple of a smaller unit.') %]
- [% 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.') %]
- </p>
-
- <hr>
-
- <table width="100%">
- <tr><th class="listtop">[% 'Add unit' | $T8 %]</th></tr>
- </table>
-
- <table>
- <tr>
- <th align="right">[% 'Unit' | $T8 %]</th>
- <td><input name="new_name" size="20" maxlength="20"></td>
- </tr>
- <tr>
- <th align="right">[% 'Base unit' | $T8 %]</th>
- <td>
- <select name="new_base_unit">
- [% FOREACH row = NEW_BASE_UNIT_DDBOX %]<option [% row.selected %]>[% row.name %]</option>[% END %]
- </select>
- </td>
- </tr>
- <tr>
- <th align="right">[% 'Factor' | $T8 %]</th>
- <td><input name="new_factor"></td>
- </tr>
+<p>
+ [% 'You can declare different translations for singular and plural for each unit (e.g. "day" and "days).' | $T8 %]
+</p>
- [% FOREACH language = LANGUAGES %]
- <tr>
- <th align="right">[% language.description %]</th>
- <td><input name="new_localized_[% language.id %]" size="20" maxlength="20"></td>
- <th align="right">[% 'Plural' | $T8 %]</th>
- <td><input name="new_localized_plural_[% language.id %]" size="20" maxlength="20"></td>
- </tr>
- [% END %]
- </table>
-
- <input type="submit" class="submit" name="action" value="[% 'Add' | $T8 %]">
-
- <hr>
-
- <table width="100%">
- <tr><th class="listtop">[% 'Edit units' | $T8 %]</th></tr>
- </table>
-
- <p>
- [% 'Units that have already been used (e.g. for parts and services or in invoices or warehouse transactions) cannot be changed.' | $T8 %]
- </p>
-
- <p>
- [% 'Units marked for deletion will be deleted upon saving.' | $T8 %]
- </p>
+<form method="post" action="[% HTML.escape(script) %]" id="form">
- <p>
- [% 'You can declare different translations for singular and plural for each unit (e.g. "day" and "days).' | $T8 %]
- </p>
+ <input type="hidden" name="type" value="unit">
<table id="unit_list">
<thead>
<tr class="listheading">
- <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
+ <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
<th>[% 'Delete' | $T8 %]</th>
<th>[% 'Unit' | $T8 %]</th>
<th>[% 'Base unit' | $T8 %]</th>
<tbody>
[% FOREACH row = UNITS %]
<tr class="listrow[% loop.count % 2 %]" id="unit_id_[% row.id %]">
- <td align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
+ <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
[% IF row.in_use %]
<td>
<input type="hidden" name="unchangeable_[% loop.count %]" value="1">
<input type="hidden" name="rowcount" value="[% UNITS.size %]">
- <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
-
</form>
- [% L.sortable_element('#unit_list tbody', 'url' => 'controller.pl?action=Unit/reorder', 'with' => 'unit_id') %]
-
-</body>
-</html>
+ [% L.sortable_element('#unit_list tbody', url => 'controller.pl?action=Unit/reorder', with => 'unit_id') %]