{# # --------------------------------------------------------------------- # # 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 . # # --------------------------------------------------------------------- #} {% set canedit = params['canedit'] ?? true %} {% set withtemplate = params['withtemplate'] ?? '' %} {% set rand = rand|default(random()) %} {% set nametype = params['formtitle'] ?? item.getTypeName(1) %} {% set friendlyname = params['friendlyname'] ?? item.getHeaderName() %} {% set id = item.fields['id'] ?? -1 %} {% set in_navheader = in_navheader|default(false) %} {% set entity_name = entity_name|default('') %} {% if entity_id is not defined and item.isEntityAssign() %} {% if item.getType() == 'Entity' and item.fields['id'] == 0 %} {% set entity_id = null %} {% else %} {% set entity_id = params['entities_id'] ?? item.getEntityID() ?? session('glpiactive_entity') %} {% endif %} {% if is_multi_entities_mode() %} {% set entity_name = get_item_name('Entity', item.getEntityID()) %} {% endif %} {% elseif entity_id is not defined %} {% set entity_id = 0 %} {% 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 item.canEdit(item.fields['id']) %}
{% endif %}
{% if withtemplate == 1 and item.isNewItem() %} {% endif %}

{% set icon = item.getIcon() %} {% if not in_navheader and icon|length > 0 %}
{% endif %} {% if in_navheader %} {% endif %} {% if withtemplate == 1 and item.id > 0 %} {{ _n('Template', 'Templates', 1) }} - {{ nametype }} - {{ template_name }} {% elseif item.id > 0 %} {{ nametype }} - {{ friendlyname }} {% else %} {{ nametype }} {% endif %} {% if in_navheader and item.isField('is_dynamic') and item.fields['is_dynamic'] %} {% 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') }} {% if inside_main is not defined %} {% endif %}