{# # --------------------------------------------------------------------- # # GLPI - Gestionnaire Libre de Parc Informatique # # http://glpi-project.org # # @copyright 2015-2023 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 . # # --------------------------------------------------------------------- #} {% extends 'components/itilobject/timeline/form_timeline_item.html.twig' %} {% import 'components/form/fields_macros.html.twig' as fields %} {% set params = params|default({}) %} {% block timeline_card %} {% if form_mode == 'view' %}
{{ entry_i['content']|raw }} {% if entry_i['comment_submission']|length %}
{{ entry_i['comment_submission']|enhanced_html({ 'user_mentions': true, 'images_gallery': true }) }}
{% endif %} {% if entry_i['comment_validation']|length %}
{{ entry_i['comment_validation']|enhanced_html({ 'user_mentions': true, 'images_gallery': true }) }}
{% endif %} {% if entry_i['can_answer'] %}
{{ call_plugin_hook('pre_item_form', {"item": subitem, 'options': params}) }}
{{ fields.textareaField( 'comment_validation', '', _n('Comment', 'Comments', 1), { 'full_width': true, 'enable_richtext': true, 'is_horizontal': false, 'enable_fileupload': false, 'enable_mentions': true, 'entities_id': item.fields['entities_id'], 'rand': rand, } ) }} {{ fields.fileField( 'filename', null, '', { 'multiple': true, 'full_width': true, 'no_label': true, } ) }}
{% endif %}
{% elseif form_mode == 'answer' %}
{{ call_plugin_hook('pre_item_form', {"item": subitem, 'options': params}) }}
{{ fields.textareaField( 'comment_validation', subitem.fields['comment_validation'], _n('Comment', 'Comments', 1), { 'full_width': true, 'enable_richtext': true, 'is_horizontal': false, 'enable_fileupload': false, 'enable_mentions': true, 'entities_id': item.fields['entities_id'], 'rand': rand, } ) }} {{ fields.fileField( 'filename', null, '', { 'multiple': true, 'full_width': true, 'no_label': true, } ) }}
{% else %}

{{ __("Validation request") }}

{{ fields.readOnlyField( 'approval_requester', get_current_user().getFriendlyName(), _n('Requester', 'Requesters', 1), { 'full_width': true, 'rand': rand, } ) }} {% if subitem.isNewItem() %} {{ fields.dropdownArrayField('validatortype', subitem.fields['validatortype'], { 'User': 'User'|itemtype_name, 'Group': 'Group'|itemtype_name }, __('Approver'), { 'display_emptychoice': true, 'rand': rand, 'field_class': 'col-12', 'label_class': 'col-xxl-4', 'input_class': 'col-xxl-8 flex-wrap', 'add_field_html': ' ', }) }} {% set right = 'validate' %} {% if (item.getType() is same as 'Ticket') %} {% set right = item.fields['type'] == 2 ? 'validate_request' : 'validate_incident' %} {% endif %} {% if subitem.fields['validatortype'] is not null %} {% else %} {% endif %} {% else %} {{ fields.dropdownField( 'User', 'users_id_validate', subitem.fields['users_id_validate'], __('Approver'), { 'disabled': true, 'full_width': true, } ) }} {% endif %} {{ fields.textareaField( 'comment_submission', subitem.fields['comment_submission'], _n('Comment', 'Comments', 1), { 'full_width': true, 'enable_richtext': true, 'enable_fileupload': false, 'enable_mentions': true, 'entities_id': item.fields['entities_id'], 'rand': rand, } ) }} {{ fields.fileField( 'filename', null, '', { 'multiple': true, 'full_width': true, } ) }}
{{ call_plugin_hook('post_item_form', {"item": subitem, 'options': params}) }}
{% if scroll %} {% endif %} {% endif %} {% endblock %}