{# # --------------------------------------------------------------------- # # GLPI - Gestionnaire Libre de Parc Informatique # # http://glpi-project.org # # @copyright 2015-2025 Teclib' and contributors. # @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 . # # --------------------------------------------------------------------- #} {% import 'components/form/fields_macros.html.twig' as fields %} {% set rand = random() %}
{% set remove_button %} {% endset %}
{% for itemtype, items_ids in specific_values_extra_field.associated_items %} {% for items_id in items_ids %} {{ fields.dropdownItemsFromItemtypes( specific_values_extra_field.input_name, '', { 'init' : true, 'itemtypes' : specific_values_extra_field.itemtypes, 'no_label' : true, 'display_emptychoice': false, 'itemtype_name' : specific_values_extra_field.input_name ~ '[itemtype][]', 'items_id_name' : specific_values_extra_field.input_name ~ '[items_id][]', 'default_itemtype' : itemtype, 'default_items_id' : items_id, 'width' : '30%', 'add_field_class' : 'd-flex input-group flex-nowrap', 'mb' : '', 'add_field_html' : remove_button, 'add_field_attribs' : { 'data-glpi-associated-items-specific-values-extra-field-item': '' }, 'aria_label' : specific_values_extra_field.itemtype_aria_label, 'specific_tags_items_id_dropdown': { 'aria-label': specific_values_extra_field.items_id_aria_label, 'data-glpi-associated-items-items-id-dropdown': '' } } ) }} {% endfor %} {% endfor %} {{ fields.dropdownItemsFromItemtypes( specific_values_extra_field.input_name, '', { 'init' : true, 'itemtypes' : specific_values_extra_field.itemtypes, 'no_label' : true, 'display_emptychoice': true, 'emptylabel' : specific_values_extra_field.empty_label, 'itemtype_name' : specific_values_extra_field.input_name ~ '[itemtype][]', 'items_id_name' : specific_values_extra_field.input_name ~ '[items_id][]', 'width' : '30%', 'add_field_class' : 'd-flex input-group flex-nowrap', 'mb' : '', 'add_field_html' : remove_button, 'add_field_attribs' : { 'data-glpi-associated-items-specific-values-extra-field-item': '' }, 'aria_label' : specific_values_extra_field.itemtype_aria_label, 'specific_tags_items_id_dropdown': { 'aria-label': specific_values_extra_field.items_id_aria_label, 'data-glpi-associated-items-items-id-dropdown': '' } } ) }}
{{ fields.dropdownArrayField( specific_answer_extra_field.input_name, '', specific_answer_extra_field.possible_values, "", options|merge({ field_class: '', no_label: true, display_emptychoice: true, values: specific_answer_extra_field.values ?? [], multiple: true, aria_label: specific_answer_extra_field.aria_label, mb: '' }) ) }}