4 [%- USE LxERP %][%- USE P -%]
5 [%- BLOCK cvar_inputs %]
6 [%- SET render_cvar_tag_options = {};
7 render_cvar_tag_options.import(cvar_tag_options) IF cvar_tag_options;
8 SET cvar_tag_name = HTML.escape(cvar.name_prefix) _ "cvar_" _ HTML.escape(cvar.var.name) _ HTML.escape(cvar.name_postfix);
9 IF !render_cvar_tag_options.id && (cvar.var.type != 'select');
10 SET render_cvar_tag_options.no_id = 1;
14 [%- IF (!cvar.hide_non_editable || cvar.var.flag_editable) && !cvar.partsgroup_filtered %]
17 [%- IF show_disabled_message %]
18 <i>[% 'Element disabled' | $T8 %]</i>
21 [%- ELSIF cvar.var.type == 'bool' %]
22 [%- render_cvar_tag_options.import(checked=cvar.value, value=1);
23 L.checkbox_tag(cvar_tag_name, render_cvar_tag_options) %]
25 [%- ELSIF cvar.var.type == 'textfield' %]
26 [% render_cvar_tag_options.import(cols=cvar.var.width, rows=cvar.var.height);
27 L.textarea_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
29 [%- ELSIF cvar.var.type == 'date' %]
30 [%- L.date_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
32 [%- ELSIF cvar.var.type == 'timestamp' %]
33 [%- L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
35 [%- ELSIF cvar.var.type == 'select' %]
36 [%- render_cvar_tag_options.name=cvar_tag_name %]
37 <select [% P.stringify_attributes(render_cvar_tag_options) %]>
38 [%- IF LxERP.is_rdbo(cvar.var, 'CustomVariableConfig') %]
39 [%- FOREACH option = cvar.var.processed_options %]
40 [%- SET render_cvar_opts = {
43 render_cvar_opts.selected = 'selected' IF option == cvar.value;
44 L.html_tag('option', option, render_cvar_opts) %]
47 [%- FOREACH option = cvar.var.OPTIONS %]
48 [%- SET render_cvar_opts = {
51 render_cvar_opts.selected = 'selected' IF option.value == cvar.value;
52 L.html_tag('option', option.value, render_cvar_opts) %]
57 [%- ELSIF cvar.var.type == 'customer' %]
58 [%- render_cvar_tag_options.type = 'customer' %]
59 [%- L.customer_vendor_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
61 [%- ELSIF cvar.var.type == 'vendor' %]
62 [%- render_cvar_tag_options.type = 'vendor' %]
63 [%- L.customer_vendor_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
65 [%- ELSIF cvar.var.type == 'part' %]
66 [% L.part_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
68 [%- ELSIF cvar.var.type == 'number' %]
69 [%- L.input_tag(cvar_tag_name, LxERP.format_amount(cvar.value, -2), render_cvar_tag_options) %]
72 [% render_cvar_tag_options.maxlength=cvar.var.maxlength IF cvar.var.maxlength;
73 L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]