Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / am / edit_bins.html
diff --git a/templates/webpages/am/edit_bins.html b/templates/webpages/am/edit_bins.html
new file mode 100644 (file)
index 0000000..8762dd3
--- /dev/null
@@ -0,0 +1,53 @@
+[%- USE HTML -%][%- USE T8 -%]
+
+<h1>[% title %]</h1>
+
+[% UNLESS BINS.size %]
+ <p>[% 'No bins have been added to this warehouse yet.' | $T8 %]</p>
+
+[% ELSE %]
+
+ <p>
+  [%- 'Bins that have been used in the past cannot be deleted anymore. For these bins there\'s no checkbox in the &quot;Delete&quot; column.' | $T8 %]
+ </p>
+
+ <form method="post" action="am.pl" id="form">
+
+  <input type="hidden" name="warehouse_id" value="[% HTML.escape(id) %]">
+
+  <input type="hidden" name="type" value="bin">
+  <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
+
+  <table border="0">
+   <tr>
+    <th class="listheading">[% 'Delete' | $T8 %]</th><th class="listheading">[% 'Description' | $T8 %]</th>
+    <th class="listheading">[% 'Delete' | $T8 %]</th><th class="listheading">[% 'Description' | $T8 %]</th>
+   </tr>
+   [%- SET row_odd = '1' %]
+   [%- USE bin_it = Iterator(BINS) %]
+   [%- FOREACH bin = bin_it %]
+   [%- IF row_odd %]
+   <tr>
+    [%- END %]
+
+    <td>[% IF bin.in_use %]&nbsp;[% ELSE %]<input type="checkbox" name="delete_[% bin_it.count %]" value="1">[% END %]</td>
+    <td>
+     <input type="hidden" name="id_[% bin_it.count %]" value="[% HTML.escape(bin.id) %]">
+     <input name="description_[% bin_it.count %]" value="[% HTML.escape(bin.description) %]">
+    </td>
+
+    [%- SET end_tr = '0' %]
+    [%- UNLESS row_odd %][%- SET end_tr = '1' %][%- END %]
+    [%- IF bin_it.last %][%- SET end_tr = '1' %][%- END %]
+    [%- IF end_tr %]
+   </tr>
+   [%- END %]
+
+   [%- IF row_odd %][% SET row_odd = '0' %][% ELSE %][% SET row_odd = '1' %][% END %]
+   [%- END %]
+  </table>
+
+  <input type="hidden" name="rowcount" value="[% BINS.size %]">
+ </form>
+
+[% END %]