{# # --------------------------------------------------------------------- # # GLPI - Gestionnaire Libre de Parc Informatique # # http://glpi-project.org # # @copyright 2015-2024 Teclib' and contributors. # @copyright 2003-2014 by the INDEPNET Development Team. # @licence https://www.gnu.org/licenses/gpl-3.0.html # # --------------------------------------------------------------------- # # LICENSE # # This file is part of GLPI. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # --------------------------------------------------------------------- #} {% set is_ajax = _request['searchform_id'] is defined and _request['searchform_id'] is not null %} {% set rand = random() %} {% set mainform = mainform is not defined ? true : mainform %} {% set main_block_class = mainform ? '' : 'sub_criteria' %} {% set card_class %} {% if mainform %} {{ 'search-form card card-sm' ~ (user_pref('show_search_form') ? ' border mb-3' : '') }} {% else %} {{ 'border d-inline-block ms-1' }} {% endif %} {% endset %} {% set hide_criteria = not(p.hide_criteria is defined and not p.hide_criteria) %} {% set extra_actions_templates = p.extra_actions_templates|default([]) %} {% set hide_controls = p.hide_controls is defined and p.hide_controls %} {% set showmassiveactions = not p.showmassiveactions is defined or p.showmassiveactions %} {% if mainform and showaction %}
{% for param_name, param_value in additional_params %} {% endfor %} {% endif %}
{# init criteria count #} {% set nbsearchcountvar = "nbcriteria" ~ normalized_itemtype ~ random() %}
{% if p.defaultfilter is defined %}
{{ p.defaultfilter['name'] }}
{% endif %} {% for i in p['criteria']|keys %} {{ call("Glpi\\Search\\Input\\QueryBuilder::displayCriteria", [{ itemtype: itemtype, num: i, p: p }]) }} {% endfor %}
{% if _get['savedsearches_id'] is defined %} {% endif %} {# Keep track of display params affecting the results, they must be kept on refresh #} {# TODO These tokens could be data attributes on the related elements #} {% set idor_display_criteria = idor_token(itemtype) %} {% set idor_display_meta_criteria = idor_token(itemtype) %} {% set idor_display_criteria_group = idor_token(itemtype) %} {% set itemtype_escaped = itemtype|escape('js') %} {# TODO JS could probably be moved to a JS file #} {% set ajax_url = config('root_doc') ~ "/ajax/search.php" %} {% if p['addhidden']|length > 0 %} {% for key, val in p['addhidden'] %} {% endfor %} {% endif %} {% if mainform %} {% endif %}
{% if mainform and showaction %}
{% endif %}