Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / shop_part / categories.html
diff --git a/templates/webpages/shop_part/categories.html b/templates/webpages/shop_part/categories.html
new file mode 100644 (file)
index 0000000..55e6628
--- /dev/null
@@ -0,0 +1,35 @@
+[%- USE HTML %]
+[%- USE T8 %]
+[%- USE L -%]
+[%- USE P -%]
+[%- USE LxERP -%]
+[%- USE Dumper -%]
+
+[%  LxERP.t8("Part") %]: [% HTML.escape(SELF.shop_part.part.displayable_name) %]<br>
+[%  LxERP.t8("Shop") %]: [% HTML.escape(SELF.shop_part.shop.description) %]<br>
+
+<form action="controller.pl" method="post">
+  [% BLOCK recurse %]
+      [% FOREACH categorie = categories_array %]
+        <ul>
+          <li>
+          [% checked = '' %]
+          [% FOREACH cat_row = SELF.shop_part.shop_category %]
+            [% IF (cat_row.0 == categorie.id) || (SELF.shop_part.shop.connector == 'shopware6' && cat_row == categorie.id) %]
+              [% checked = 'checked' %]
+            [% END %]
+          [% END %]
+            [% L.checkbox_tag('categories[]',value=categorie.id, checked=checked) %][% HTML.escape(categorie.name) %][% L.hidden_tag("cat_id_" _ categorie.id, categorie.name) %]
+          </li>
+          [% IF categorie.children.size %]
+            [% INCLUDE recurse categories_array=categorie.children %]
+          [% END %]
+        </ul>
+    [% END %]
+  [% END %]
+  <div><h2>[% LxERP.t8("Shopcategories") %]</h2>
+    [% # Dumper.dump_html( CATEGORIES ) %]
+    [% INCLUDE recurse categories_array=CATEGORIES %]
+  </div>
+    [% L.button_tag("kivi.ShopPart.save_categories(" _ SELF.shop_part.id _", " _ SELF.shop_part.shop.id _")", LxERP.t8("Save"))  %]</td>
+</form>