1 {# Get inputbox based on different column types (Foreign key, geometrical, enum) #}
2 {% if foreigners and search_column_in_foreigners %}
3 {% if foreign_data.dispRow is iterable %}
4 <select name="criteriaValues[{{ column_index }}]"
5 id="{{ column_id }}{{ column_index }}">
6 {{ foreign_dropdown|raw }}
8 {% elseif foreign_data.foreignLink %}
10 id="{{ column_id }}{{ column_index }}"
11 name="criteriaValues[{{ column_index }}]"
12 id="field_{{ column_name_hash }}[{{ column_index }}]"
14 {% if criteria_values[column_index] is defined %}
15 value="{{ criteria_values[column_index] }}"
17 <a class="ajax browse_foreign" href="{{ url('/browse-foreigners') }}" data-post="
18 {{- get_common({'db': db, 'table': table}, '', false) -}}
19 &field={{ column_name|url_encode }}&fieldkey=
20 {{- column_index }}&fromsearch=1">
21 {{ get_icon('b_browse', t('Browse foreign values')) }}
24 {% elseif column_type in get_gis_datatypes() %}
26 name="criteriaValues[{{ column_index }}]"
29 id="field_{{ column_index }}">
31 <span class="open_search_gis_editor">
32 {{ link_or_button('#', null, get_icon('b_edit', t('Edit/Insert'))) }}
35 {% elseif column_type starts with 'enum'
36 or (column_type starts with 'set' and in_zoom_search_edit) %}
37 {% set in_zoom_search_edit = false %}
38 {% set value = parse_enum_set_values(column_type) %}
39 {% set cnt_value = value|length %}
41 Enum in edit mode --> dropdown
42 Enum in search mode --> multiselect
43 Set in edit mode --> multiselect
44 Set in search mode --> input (skipped here, so the 'else' section would handle it)
46 {% if (column_type starts with 'enum' and not in_zoom_search_edit)
47 or (column_type starts with 'set' and in_zoom_search_edit) %}
48 <select name="criteriaValues[{{ column_index }}]"
49 id="{{ column_id }}{{ column_index }}">
51 <select name="criteriaValues[{{ column_index }}]"
52 id="{{ column_id }}{{ column_index }}"
54 size="{{ min(3, cnt_value) }}">
56 {# Add select options #}
57 <option value=""></option>
58 {% for i in 0..cnt_value - 1 %}
59 {% if criteria_values[column_index] is defined
60 and criteria_values[column_index] is iterable
61 and value[i] in criteria_values[column_index] %}
62 <option value="{{ value[i]|raw }}" selected>
66 <option value="{{ value[i]|raw }}">
73 {% set the_class = 'textfield' %}
74 {% if column_type == 'date' %}
75 {% set the_class = the_class ~ ' datefield' %}
76 {% elseif column_type == 'datetime' or column_type starts with 'timestamp' %}
77 {% set the_class = the_class ~ ' datetimefield' %}
78 {% elseif column_type starts with 'bit' %}
79 {% set the_class = the_class ~ ' bit' %}
82 {% if is_integer or is_float %}
93 name="criteriaValues[{{ column_index }}]"
94 data-type="{{ column_data_type }}"
95 {{ html_attributes|raw }}
97 class="{{ the_class }}"
98 id="{{ column_id }}{{ column_index }}"
99 {% if criteria_values[column_index] is defined %}
100 value="{{ criteria_values[column_index] }}"