{# # --------------------------------------------------------------------- # 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 . # --------------------------------------------------------------------- #} {% set target = params['target'] ?? item.getFormURL() %} {% set canedit = params['canedit'] ?? true %} {% set withtemplate = params['withtemplate'] ?? '' %} {% set rand = random() %} {% set nametype = params['formtitle'] ?? item.getTypeName(1) %} {% set friendlyname = params['friendlyname'] ?? item.getHeaderName() %} {% set no_id = params['noid'] ?? false %} {% set id = item.fields['id'] ?? -1 %} {% set formoptions = params['formoptions'] ?? '' %} {% set entity_id = 0 %} {% set entity_name = '' %} {% if item.isEntityAssign() %} {% if item.getType() == 'Entity' and item.fields['id'] == 0 %} {% set entity_id = null %} {% else %} {% set entity_id = params['entities_id'] ?? item.fields['entities_id'] ?? session('glpiactive_entity') %} {% endif %} {% if is_multi_entities_mode() %} {% set entity_name = get_item_name('Entity', item.fields['entities_id']) %} {% endif %} {% endif %} {% if item.canEdit(item.fields['id']) %}
{% endif %}
{% set template_name = item.fields['template_name']|verbatim_value %} {% if withtemplate == 2 and not item.isNewItem() %} {% set nametype = __('Created from the template %s')|format(template_name) %} {% elseif withtemplate == 1 %} {% elseif item.isNewItem() %} {% set nametype = __('%1$s - %2$s')|format(__('New item'), nametype) %} {% else %} {% if noid == false and (session('glpiis_ids_visible') or nametype|length == 0) %} {% set nametype = __('%1$s - %2$s')|format(nametype, item.fields['id']) %} {% endif %} {% endif %} {% if no_header is not defined or no_header == false %}

{% set icon = item.getIcon() %} {% if icon|length > 0 %}
{% endif %} {% if item.id > 0 %} {{ nametype }} - {{ friendlyname }} {% else %} {{ nametype }} {% endif %} {% if header_toolbar %}
{% for raw_element in header_toolbar %} {{ raw_element|raw }} {% endfor %}
{% endif %}

{% set single_actions_ms_auto = true %} {% if item.isEntityAssign() and is_multi_entities_mode() and item is not instanceof('Entity') %} {% set single_actions_ms_auto = false %} {{ entity_name }} {% if item.maybeRecursive() %} {% endif %} {% endif %} {{ include('components/form/single-action.html.twig') }}
{% endif %} {{ call_plugin_hook(constant('Glpi\\Plugin\\Hooks::PRE_ITEM_FORM'), {'item': item, 'options': params}) }} {# todo modal message #} {% if app.request.request('in_modal') == true %} {% endif %}