{# # --------------------------------------------------------------------- # # 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 . # # --------------------------------------------------------------------- #} {% 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' %} {# Item displayed in timeline #}
{{ 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' %} {# Form displayed when user updates its 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 %} {# Form displayed when user creates/edits an approval request #}

{{ __("Validation request") }}

{{ fields.dropdownField( 'ITILValidationTemplate', 'itilvalidationtemplates_id', '', _n('Template', 'Templates', 1), { 'full_width': true, 'on_change': 'itilvalidationtemplate_update' ~ rand ~ '(this.value);', 'entity': item.fields['entities_id'], 'rand': rand, }, ) }} {{ fields.readOnlyField( 'approval_requester', get_current_user().getFriendlyName(), _n('Requester', 'Requesters', 1), { 'full_width': true, 'rand': rand, } ) }} {% if subitem.isNewItem() %} {% set validation_right = 'validate' %} {% if item.getType() == 'Ticket' %} {% if item.fields['type'] == constant('Ticket::INCIDENT_TYPE') %} {% set validation_right = 'validate_incident' %} {% elseif item.fields['type'] == constant('Ticket::DEMAND_TYPE') %} {% set validation_right = 'validate_request' %} {% endif %} {% endif %} {{ fields.field( '_add_validation', subitem.dropdownValidator({ 'parents_id': item.fields['id'], 'entity': item.fields['entities_id'], 'itemtype_target': subitem.fields['itemtype_target'], 'items_id_target': subitem.fields['items_id_target'] ?? '', 'right': validation_right, 'display': false, 'rand': rand, }), __('Approver'), { 'full_width': true, } ) }} {% else %} {{ fields.readOnlyField( '', get_item_name(subitem.fields['itemtype_target'], subitem.fields['items_id_target']), __('Approver'), { '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 %}