Skip to content

Commit

Permalink
Fix search group criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagh authored Dec 18, 2023
1 parent d8ce556 commit e2b9043
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{% set parents_num = (parents_num|default([]))|merge([num]) %}
{{ call("Glpi\\Search\\Input\\QueryBuilder::showGenericSearch", [itemtype, {
mainform: false,
prefix_crit: prefix ~ num ~ '_criteria_',
prefix_crit: prefix ~ '[' ~ num ~ '][criteria]',
parents_num: parents_num,
criteria: criteria['criteria'],
}]) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@
}) }}
</div>
<input type="hidden" name="criteria{{ prefix ~ "[" ~ num ~ "][meta]" }}" value="true">
{% set field_id = "dropdown_criteria" ~ prefix ~ "[" ~ num ~ "][itemtype]" ~ rand %}
{% set spanid = "show_" ~ itemtype ~ "_" ~ prefix ~ num ~ "_" ~ rand %}
{% set clean_id_prefix = call('Html::cleanId', [prefix]) %}
{% set field_id = "dropdown_criteria" ~ clean_id_prefix ~ "[" ~ num ~ "][itemtype]" ~ rand %}
{% set span_id = "show_" ~ itemtype ~ "_" ~ clean_id_prefix ~ num ~ "_" ~ rand %}
{% set params = {
action: 'display_criteria',
itemtype: '__VALUE__',
Expand All @@ -81,11 +82,11 @@
} %}
{% do call('Ajax::updateItemOnSelectEvent', [
field_id,
spanid,
span_id,
config('root_doc') ~ "/ajax/search.php",
params
]) %}
<div class="col-auto" id="{{ spanid }}">
<div class="col-auto" id="{{ span_id }}">
<div class="row">
{% if metacriteria['itemtype'] is defined and metacriteria['itemtype'] is not empty %}
{% set params = params|merge({itemtype: metacriteria['itemtype']}) %}
Expand Down

0 comments on commit e2b9043

Please sign in to comment.