{# # --------------------------------------------------------------------- # # 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 %} {% if get_current_user() is not null %} {# @var selected_user \User #} {% if selected_user is not defined or selected_user is empty %} {% set selected_user = get_current_user() %} {% endif %} {% set users = get_current_user().getUsersFromDelegatedGroups() %} {% if users|length > 1 %} {% set user_dropdown_html %} {{ fields.dropdownArrayField( 'delegation_users_id', selected_user.getID(), users, '', { 'no_label' : true, 'width' : 'auto', 'field_class' : '', 'mb' : '', 'aria_label' : __('Select the user to delegate'), 'wrapper_class' : 'd-inline-block', } ) }} {% endset %} {% if selected_user.getID() != get_current_user().getID() %} {% set notification_part_html %} {{ fields.dropdownArrayField( 'delegation_use_notification', '1', { '0': __('He doesn\'t want'), '1': __('He wants'), }, '', { 'no_label' : true, 'width' : 'auto', 'field_class' : '', 'mb' : '', 'aria_label' : __('Do you want to be notified of future events of this ticket'), 'wrapper_class' : 'd-inline-block', } ) }} {% endset %}
{{ __('This ticket is for %1$s and %2$s to be notified of future events of this ticket.')|format( '' ~ user_dropdown_html|raw ~ '', '' ~ notification_part_html|raw ~ '' )|raw }}
{% else %}
{{ __('This ticket is for %1$s')|format( '' ~ user_dropdown_html|raw ~ '' )|raw }}
{% endif %} {% endif %} {% endif %}