fc2dffa2404f3697a84ec098cf0d3d1edaa886c7
[kivitendo-erp.git] / templates / webpages / amcvar / search_filter.html
1 [%- USE T8 %]
2 [%- USE L %]
3 [% USE HTML %]
4
5    [%- FOREACH var = variables %]
6    [%- IF var.searchable %]
7    <tr id='cvar_filter_[% var.name %]'>
8     <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
9     <td valign="top">
10
11      [%- IF var.type == 'bool' %]
12      <select name="[% filter_prefix %]cvar_[% HTML.escape(var.name) %]">
13       <option value="">---</option>
14       <option value="yes">[% 'Yes' | $T8 %]</option>
15       <option value="no">[% 'No' | $T8 %]</option>
16      </select>
17
18      [%- ELSIF var.type == 'date' %]
19      [% 'from (time)' | $T8 %]
20      [% L.date_tag(filter_prefix _'cvar_'_ HTML.escape(var.name) _'_from') %]
21
22      [% 'to (time)' | $T8 %]
23      [% L.date_tag(filter_prefix _'cvar_'_ HTML.escape(var.name) _'_to') %]
24
25      [%- ELSIF var.type == 'number' %]
26      <select name="[% filter_prefix %]cvar_[% HTML.escape(var.name) %]_qtyop">
27       <option selected>==</option>
28       <option>=/=</option>
29       <option>&gt;</option>
30       <option>&gt;=</option>
31       <option>&lt;</option>
32       <option>&lt;=</option>
33      </select>
34      <input name="[% filter_prefix %]cvar_[% HTML.escape(var.name) %]"[% IF var.maxlength %]maxlength="[% HTML.escape(var.maxlength) %]"[% END %]>
35
36      [%- ELSIF var.type == 'customer' %]
37      <input name="[% filter_prefix %]cvar_[% var.name | html %]">
38
39      [% ELSIF var.type == 'select' %]
40      <select name="[% filter_prefix %]cvar_[% HTML.escape(var.name) %]">
41       <option value="" selected>---</option>
42       [%- FOREACH option = var.OPTIONS %]
43       <option>[% HTML.escape(option.value) %]</option>
44       [%- END %]
45      </select>
46
47      [%- ELSE %]
48      <input name="[% filter_prefix %]cvar_[% HTML.escape(var.name) %]"[% IF var.maxlength %]maxlength="[% HTML.escape(var.maxlength) %]"[% END %]>
49
50      [%- END %]
51     </td>
52    </tr>
53    [%- END %]
54    [%- END %]
55 [% IF hidden_cvar_filters %]
56    <tr><td></td><td colspan="3"><a href="#" id="cvar_filter-toggle"><i>[% 'click here to edit cvars' | $T8 %]</i></a></td></tr>
57    <script type='text/javascript'>
58      $('#cvar_filter-toggle').click(function() { $('[id^="cvar_filter"]').toggle(); $('[id^="l_cvartd_"]').toggle(); });
59      $(document).ready(function(){ $('[id^="cvar_filter_"]').hide(); $('[id^="l_cvartd_"]').hide(); });
60    </script>
61 [% END %]