Pflichtenheft: nach benutzerdefinierten Variablen suchen können
[kivitendo-erp.git] / templates / webpages / common / render_cvar_filter_input.html
diff --git a/templates/webpages/common/render_cvar_filter_input.html b/templates/webpages/common/render_cvar_filter_input.html
new file mode 100644 (file)
index 0000000..b1467c2
--- /dev/null
@@ -0,0 +1,35 @@
+[%- USE HTML -%][%- USE L -%][%- USE LxERP -%][%- USE T8 -%]
+[%- SET id__    = cvar_cfg.id
+        name__  = 'filter.cvar.' _ id__
+        value__ = filter.cvar.$id__ %]
+[%- IF cvar_cfg.type == 'bool' %]
+ [%- L.select_tag(name__, [ '', [ 1, LxERP.t8('Yes') ], [ 0, LxERP.t8('No') ] ], default=value__, class=cvar_class) %]
+
+[%- ELSIF cvar_cfg.type == 'number' %]
+ [% L.select_tag(name__ _ '::', [ [ 'eq', '==' ], [ 'ne', '=/=' ], [ 'gt', '>' ], [ 'ge', '>=' ], [ 'lt', '<' ], [ 'le', '<=' ] ]) %]
+ [% L.input_tag(name__, value__, class=cvar_class) %]
+
+[%- ELSIF cvar_cfg.type == 'date' %]
+ [% L.select_tag(name__ _ '::', [ [ 'eq', '==' ], [ 'ne', '=/=' ], [ 'gt', '>' ], [ 'ge', '>=' ], [ 'lt', '<' ], [ 'le', '<=' ] ]) %]
+ [% L.date_tag(name__, value__, class=cvar_class) %]
+
+[% ELSIF cvar_cfg.type == 'select' %]
+ [% options__ = [ '' ];
+    options__ = options__.import(cvar_cfg.processed_options);
+    L.select_tag(name__, options__, default=value__, class=cvar_class) %]
+
+[% ELSIF cvar_cfg.type == 'customer' %]
+ [%- L.customer_vendor_picker(name__, value__, type='customer', class=cvar_class) %]
+
+[% ELSIF cvar_cfg.type == 'vendor' %]
+ [%- L.customer_vendor_picker(name__, value__, type='vendor', class=cvar_class) %]
+
+[% ELSIF cvar_cfg.type == 'part' %]
+ [%- L.part_picker(name__, value__, class=cvar_class) %]
+
+[%- ELSE %]
+ [% SET value_name__ = id__ _ '_substr__ilike'
+        value__      = filter.cvar.$value_name__ %]
+ [%- L.input_tag(name__ _ ':substr::ilike', value__, maxlength=cvar_cfg.maxlength, class=cvar_class) %]
+
+[%- END %]