{# # --------------------------------------------------------------------- # # 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 withtemplate = params['withtemplate'] ?? '' %} {% set candel = params['candel'] ?? true %} {% set canedit = params['canedit'] ?? true %} {% set id = item.fields['id'] ?? -1 %}
{{ call_plugin_hook(constant('Glpi\\Plugin\\Hooks::POST_ITEM_FORM'), {'item': item, 'options': params}) }}
{% if canedit or item.canEdit(item.fields['id']) %}
{% if withtemplate|length > 0 or item.isNewID(id) %} {% if id <= 0 or withtemplate == 2 %} {% else %} {% endif %} {% else %} {% if candel and not item.can(id, constant('DELETE')) and not item.can(id, constant('PURGE')) %} {% set candel = false %} {% endif %} {% if canedit and item.can(id, constant('UPDATE')) %} {% endif %} {% if candel %} {% if item.isDeleted() %} {% if item.can(id, constant('DELETE')) %} {% endif %} {% if item.can(id, constant('PURGE')) %} {% set item_devices = call('Item_Devices::getConcernedItems') %} {% set show_keep_devices = item.getType() in item_devices %} {% set span_cls = "" %} {% if show_keep_devices %} {% set span_cls = "border border-danger d-flex align-items-start flex-wrap p-1 px-2 me-2" %} {% endif %} {% if show_keep_devices %} {% endif %} {% endif %} {% else %} {% if (not item.maybeDeleted() or item.useDeletedToLockIfDynamic()) %} {% if item.can(id, constant('PURGE')) %} {% endif %} {% elseif not item.isDeleted() and item.can(id, constant('DELETE')) %} {% endif %} {% endif %} {% endif %} {% if item.isField('date_mod') %} {% endif %} {% endif %} {% if not item.isNewID(id) %} {% endif %} {% if canedit and params['addbuttons']|length > 0 %} {% for key, val in params['addbuttons'] %} {% endfor %} {% endif %}
{# #mainformtable #} {# [name=asset_form] #} {% else %} {# #mainformtable #} {% endif %}