WebshopApi: ShopPart Controller
[kivitendo-erp.git] / templates / webpages / shop_part / edit.html
1 [%- USE HTML %]
2 [%- USE T8 %]
3 [%- USE L -%]
4 [%- USE P -%]
5 [%- USE LxERP -%]
6 [%- USE Dumper -%]
7
8 <p>
9 [% LxERP.t8("Part") %]: [% HTML.escape(SELF.shop_part.part.displayable_name) %]<br>
10 [% LxERP.t8("Shop") %]: [% HTML.escape(SELF.shop_part.shop.description) %]
11 <p>
12 [% # Dumper.dump_html(SELF) %]
13 <form action="controller.pl" method="post">
14   <div>
15     [% IF SELF.shop_part.id %]
16     [%- L.hidden_tag("shop_part.id", SELF.shop_part.id) %]
17     [%- L.hidden_tag("shop_part.shop_id", SELF.shop_part.shop_id) %]
18     [% ELSE %]
19     [%- L.hidden_tag("shop_part.shop_id", FORM.shop_id) %]
20     [%- L.hidden_tag("shop_part.part_id", FORM.part_id) %]
21     [% END %]
22
23     <table>
24     <tr>
25      <td>[% LxERP.t8("Description") %]</td>
26      <td colspan="3">[% L.textarea_tag('shop_part.shop_description', SELF.shop_part.shop_description, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]</td>
27     </tr>
28     <tr>
29      <td>[% LxERP.t8("Active") %]</td>
30      <td>[% L.yes_no_tag("shop_part.active", SELF.shop_part.active, default = "yes") %]</td>
31      <td>[% LxERP.t8("Date") %]</td>
32      <td>[% L.date_tag("shop_part.show_date", SELF.shop_part.show_date) %]</td>
33     </tr>
34     <tr>
35       <td>[% 'Price Source' | $T8 %]</th>
36       [% IF SELF.shop_part.active_price_source %]
37         [% SET price_source = SELF.shop_part.active_price_source %]
38       [% ELSE %]
39         [% SET price_source = SELF.shop_part.shop.price_source %]
40       [% END %]
41       <td>[% L.select_tag('shop_part.active_price_source', SELF.price_sources, value_key = 'id', title_key = 'name', with_empty = 0, default = price_source, default_value_key='id' ) %]</td>
42      <td>[% LxERP.t8("Front page") %]</td>
43      <td>[% L.yes_no_tag('shop_part.front_page', SELF.shop_part.front_page) %]</td>
44     </tr>
45     <tr>
46      <td>[% LxERP.t8("Sort order") %]</td>
47      <td>[% L.input_tag("shop_part.sortorder", SELF.shop_part.sortorder, size=2) %]</td>
48      <td>[% LxERP.t8("Meta tag title") %]</td>
49      <td>[% L.input_tag("shop_part.metatag_title", SELF.shop_part.metatag_title, size=12) %]</td>
50     </tr>
51     <tr>
52      <td>[% LxERP.t8("Meta tag keywords") %]</td>
53      <td>[% L.input_tag("shop_part.metatag_keywords", SELF.shop_part.metatag_keywords, size=22) %]</td>
54      <td>[% LxERP.t8("Meta tag description") %]</td>
55      <td>[% L.textarea_tag("shop_part.metatag_description", SELF.shop_part.metatag_description, rows=4) %]</td>
56     </tr>
57     </table>
58     [% # L.dump(SELF.shop_part) %]
59
60     [% IF SELF.shop_part.id %]
61     [% L.button_tag("kivi.ShopPart.save_shop_part(" _ SELF.shop_part.id _ ")", LxERP.t8("Save"))  %]</td>
62     [% ELSE %]
63     [% L.button_tag("kivi.ShopPart.add_shop_part(" _ FORM.part_id _", " _ FORM.shop_id _")", LxERP.t8("Save"))  %]</td>
64     [% END %]
65     [% # L.button_tag("kivi.ShopPart.update_partnumber()", LxERP.t8("Update Partnumber"))  %]</td>
66
67     [% # L.hidden_tag("action", "ShopPart/dispatch") %]
68     [% # L.submit_tag('action_update', LxERP.t8('Save')) %]
69
70
71   </div>
72 </form>
73
74
75
76 [%- IF SELF.shop_part.part.image && INSTANCE_CONF.get_parts_show_image %]
77          <a href="[% SELF.shop_part.part.image | html %]" target="_blank"><img style="[% INSTANCE_CONF.get_parts_image_css %]" src="[% SELF.shop_part.part.image | html %]"/></a>
78 [%- END %]
79
80 [% # SELF.shop_part.shop_description %]
81 [% # L.dump(SELF.shop_part) %]