{# # --------------------------------------------------------------------- # GLPI - Gestionnaire Libre de Parc Informatique # Copyright (C) 2015-2022 Teclib' and contributors. # # http://glpi-project.org # # based on GLPI - Gestionnaire Libre de Parc Informatique # Copyright (C) 2003-2014 by the INDEPNET Development Team. # # --------------------------------------------------------------------- # # LICENSE # # This file is part of GLPI. # # GLPI 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 2 of the License, or # (at your option) any later version. # # GLPI 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 GLPI. 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': true, 'enable_mentions': true, 'rand': rand, } ) }}
{% 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': true, 'enable_mentions': true, 'rand': rand, } ) }}
{% 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': ' ', }) }} {% 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': true, 'enable_mentions': true, 'rand': rand, } ) }}
{{ call_plugin_hook('post_item_form', {"item": subitem, 'options': params}) }}
{% endif %} {% endblock %}