{# # --------------------------------------------------------------------- # # 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 "generic_show_form.html.twig" %} {% import 'components/form/fields_macros.html.twig' as fields %} {% set params = params ?? [] %} {% set rand_field = rand|default(random()) %} {% block more_fields %} {{ fields.dropdownField('WebhookCategory', 'webhookcategories_id', item.fields['webhookcategories_id'], 'WebhookCategory'|itemtype_name) }} {{ fields.dropdownArrayField( 'itemtype', item.fields['itemtype'], item.getItemtypesDropdownValues(), __('Itemtype'), field_options|merge({ display_emptychoice: item.isNewItem(), rand: rand_field, }) ) }} {{ fields.dropdownArrayField( 'event', item.fields['event'], item.getGlpiEventsList(item.fields['itemtype']), _n('Event', 'Events', 1), field_options|merge({ display_emptychoice: item.isNewItem(), container_id: 'show_event_field', }) ) }} {% do call('Ajax::updateItemOnSelectEvent', [ 'dropdown_itemtype' ~ rand_field, 'show_event_field', config('root_doc') ~ '/ajax/webhook.php', { 'itemtype': '__VALUE__', 'action': 'get_events_from_itemtype' } ]) %} {{ fields.numberField( 'sent_try', item.fields['sent_try'], __('Number of retries'), { 'min': 0, 'max': 255 } ) }} {{ fields.largeTitle(_n('Target', 'Targets', 1), 'ti ti-viewfinder') }} {% set url_editor_container_id = 'url_' ~ random() %} {% set url_editor_container %}
{% endset %} {{ fields.htmlField('url', url_editor_container, __('URL'), field_options|merge({ wrapper_class: 'd-flex flex-grow-1', helper: __('It is strongly advised to use the HTTPS protocol.') ~ ' ' ~ __('You may use the same placeholder tags as in the payload content and header values.') })) }} {{ fields.dropdownArrayField( 'http_method', item.fields['http_method'], item.getHttpMethod(), __('HTTP method'), field_options ) }} {{ fields.dropdownYesNo('save_response_body', item.fields['save_response_body'], __('Save response body')) }} {{ fields.dropdownYesNo('log_in_item_history', item.fields['log_in_item_history'], __('Log in item history')) }} {% endblock %}