{# # --------------------------------------------------------------------- # # GLPI - Gestionnaire Libre de Parc Informatique # # http://glpi-project.org # # @copyright 2015-2025 Teclib' and contributors. # @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 . # # --------------------------------------------------------------------- #} {% import 'components/form/fields_macros.html.twig' as fields %} {% import 'components/form/basic_inputs_macros.html.twig' as inputs %}
{{ __('Add a document') }}
{{ fields.dropdownField('DocumentCategory', 'documentcategories_id', item.fields['documentcategories_id'] ?? '', 'DocumentCategory'|itemtype_name, { entity: entities, 'field_class': 'col-12 col-sm-10', }) }} {{ fields.fileField('filename', null, null, { no_label: true, multiple: true, 'field_class': 'col-12 col-sm-10', }) }}
{{ inputs.submit('add', _x('button', 'Add a new file'), 1) }}
{{ inputs.hidden('entities_id', entity) }} {{ inputs.hidden('is_recursive', item.isRecursive() ? '1' : '0') }} {{ inputs.hidden('itemtype', item.getType()) }} {{ inputs.hidden('items_id', item.getID()) }} {% if item.getType == 'Ticket' %} {{ inputs.hidden('tickets_id', item.getID()) }} {% endif %} {{ inputs.hidden('_glpi_csrf_token', csrf_token()) }}
{% if canview %}
{{ __('Associate an existing document') }}
{{ fields.dropdownField('Document', 'documents_id', null, 'Document'|itemtype_name, { entity: entities, used: used, 'field_class': 'col-12 col-sm-12', 'label_class': 'col-xxl-2', 'input_class': 'col-xxl-10', }) }}
{{ inputs.submit('add', _x('button', 'Associate'), 1) }}
{{ inputs.hidden('itemtype', item.getType()) }} {{ inputs.hidden('items_id', item.getID()) }} {% if item.getType() == 'Ticket' %} {{ inputs.hidden('tickets_id', item.getID()) }} {{ inputs.hidden('documentcategories_id', config('documentcategories_id_forticket')) }} {% endif %} {{ inputs.hidden('_glpi_csrf_token', csrf_token()) }}
{% endif %}