4ec984b769f3fd752dbe91381884e2daa8e9c107
[kivitendo-erp.git] / templates / webpages / common / render_cvar_filter_input.html
1 [%- USE HTML -%][%- USE L -%][%- USE LxERP -%][%- USE T8 -%]
2 [%- SET id__    = cvar_cfg.id
3         name__  = 'filter.cvar.' _ id__
4         value__ = filter.cvar.$id__ %]
5 [%- IF cvar_cfg.type == 'bool' %]
6  [%- L.select_tag(name__, [ '', [ 1, LxERP.t8('Yes') ], [ 0, LxERP.t8('No') ] ], default=value__, class=cvar_class) %]
7
8 [%- ELSIF cvar_cfg.type == 'number' %]
9  [% L.select_tag(name__ _ '::', [ [ 'eq', '==' ], [ 'ne', '=/=' ], [ 'gt', '>' ], [ 'ge', '>=' ], [ 'lt', '<' ], [ 'le', '<=' ] ], default=filter.cvar.item(cvar_cfg.id _ '__')) %]
10  [% L.input_tag(name__, value__, class=cvar_class) %]
11
12 [%- ELSIF cvar_cfg.type == 'date' %]
13  [% L.select_tag(name__ _ '::', [ [ 'eq', '==' ], [ 'ne', '=/=' ], [ 'gt', '>' ], [ 'ge', '>=' ], [ 'lt', '<' ], [ 'le', '<=' ] ], default=filter.cvar.item(cvar_cfg.id _ '__')) %]
14  [% L.date_tag(name__, value__, class=cvar_class) %]
15
16 [% ELSIF cvar_cfg.type == 'select' %]
17  [% options__ = [ '' ];
18     options__ = options__.import(cvar_cfg.processed_options);
19     L.select_tag(name__, options__, default=value__, class=cvar_class) %]
20
21 [% ELSIF cvar_cfg.type == 'customer' %]
22  [%- L.customer_vendor_picker(name__, value__, type='customer', class=cvar_class) %]
23
24 [% ELSIF cvar_cfg.type == 'vendor' %]
25  [%- L.customer_vendor_picker(name__, value__, type='vendor', class=cvar_class) %]
26
27 [% ELSIF cvar_cfg.type == 'part' %]
28  [%- L.part_picker(name__, value__, class=cvar_class) %]
29
30 [%- ELSE %]
31  [% SET value_name__ = id__ _ '_substr__ilike'
32         value__      = filter.cvar.$value_name__ %]
33  [%- L.input_tag(name__ _ ':substr::ilike', value__, maxlength=cvar_cfg.maxlength, class=cvar_class) %]
34
35 [%- END %]