{# # --------------------------------------------------------------------- # # 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 = {'item': item}|merge(params|default({})) %} {% set candedit = item.maySolve() %} {% set can_read_kb = has_profile_right('knowbase', constant('READ')) or has_profile_right('knowbase', constant('KnowbaseItem::READFAQ')) %} {% set can_update_kb = has_profile_right('knowbase', constant('UPDATE')) %} {% set nokb = params['nokb'] is defined or params['nokb'] == true %} {% set rand = random() %} {% block timeline_card %} {% if form_mode == 'view' %}
{{ entry_i['content']|enhanced_html({ 'user_mentions': true, 'images_gallery': true }) }}
{% if entry_i['requesttypes_id'] %} {{ get_item_name('RequestType', entry_i['requesttypes_id']) }} {% endif %} {% if entry_i['sourceitems_id'] %} {% set merged_badge %} {{ get_item_link('Ticket', entry_i['sourceitems_id']) }} {% endset %} {{ __('Merged from Ticket %1$s')|format(merged_badge)|raw }} {% endif %} {% if entry_i['sourceof_items_id'] %} {% set promoted_badge %} {{ get_item_link('Ticket', entry_i['sourceof_items_id']) }} {% endset %} {{ __('Promoted to Ticket %1$s')|format(promoted_badge)|raw }} {% endif %} {{ include('components/itilobject/timeline/pending_reasons_messages.html.twig') }}
{% else %}
{{ call_plugin_hook('pre_item_form', {"item": subitem, 'options': params}) }} {% set add_reopen = (_get['_openfollowup'] ?? false) or item.needReopen() %} {% if add_reopen %} {% endif %}
{% set col_md = get_current_interface() == 'central' ? 'col-xl-7 col-xxl-8' : 'col-xxl-12' %}
{{ fields.textareaField( 'content', subitem.fields['content'], '', { 'full_width': true, 'no_label': true, 'enable_richtext': true, 'enable_fileupload': true, 'enable_mentions': true, 'entities_id': item.fields['entities_id'], 'rand': rand, 'required': add_reopen } ) }}
{% if get_current_interface() == 'central' %}
{% set fup_template_lbl %} {% endset %} {{ fields.dropdownField( 'ITILFollowupTemplate', 'itilfollowuptemplates_id', subitem.fields['itilfollowuptemplates_id'], fup_template_lbl, { 'full_width': true, 'icon_label': true, 'on_change': 'itilfollowuptemplate_update' ~ rand ~ '(this.value)', 'rand': rand, } ) }} {% set fup_source_lbl %} {% endset %} {{ fields.dropdownField( 'RequestType', 'requesttypes_id', subitem.fields['requesttypes_id'], fup_source_lbl, { 'full_width': true, 'icon_label': true, 'condition': { 'is_active': 1, 'is_itilfollowup': 1, }, 'rand': rand, } ) }} {% set fup_private_lbl %} {% endset %} {{ fields.sliderField( 'is_private', subitem.fields['is_private'], fup_private_lbl, { 'full_width': true, 'icon_label': true, 'rand': rand, } ) }} {% if can_read_kb and kb_id_toload > 0 %} {% set link_kb_lbl %} {% endset %} {{ fields.sliderField( 'kb_linked_id', 1, link_kb_lbl, { 'full_width': true, 'icon_label': true, 'rand': rand, 'yes_value': kb_id_toload, } ) }} {% endif %} {% if candedit and can_update_kb and not nokb %} {% set fup_to_kb_lbl %} {% endset %} {{ fields.sliderField( '_fup_to_kb', 0, fup_to_kb_lbl, { 'full_width': true, 'icon_label': true, 'rand': rand, } ) }} {% endif %}
{% endif %}
{{ call_plugin_hook('post_item_form', {"item": subitem, 'options': params}) }}
{% endif %} {% endblock %}