{#
# ---------------------------------------------------------------------
#
# 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 %}
{% import 'components/form/basic_inputs_macros.html.twig' as inputs %}
{% block form_fields %}
{% set field_options = {
label_class: 'col-xxl-2',
input_class: 'col-xxl-10',
} %}
{% if _request['_in_modal'] %}
{{ inputs.hidden('_in_modal', 1) }}
{% endif %}
{% if domains_id is defined %}
{{ inputs.hidden('domains_id', domains_id) }}
{% else %}
{% set domain_field %}
{% if domain.isTemplate %}
{{ inputs.hidden('domains_id', item.fields['domains_id']) }}
{{ _n('%1$s template', '%1$s templates', 1)|format(domain.fields['template_name']) }}
{% else %}
{{ fields.dropdownField('Domain', 'domains_id', item.fields['domains_id'], null, {
no_label: true,
mb: '',
entity: item.fields['entities_id']
}) }}
{% endif %}
{% endset %}
{{ fields.htmlField('', domain_field, 'Domain'|itemtype_name, field_options) }}
{% endif %}
{{ fields.textField('name', item.fields['name'], __('Name'), field_options) }}
{{ fields.dropdownField(
'DomainRecordType',
'domainrecordtypes_id',
item.fields['domainrecordtypes_id'],
'DomainRecordType'|itemtype_name,
field_options
) }}
{{ fields.dropdownField(
'User',
'users_id_tech',
item.fields['users_id_tech'],
__('Technician in charge'),
field_options|merge({
'entity': item.fields['entities_id'],
'right': 'own_ticket',
})
) }}
{{ fields.dropdownField(
'Group',
'groups_id_tech',
item.fields['groups_id_tech'],
__('Group in charge'),
field_options|merge({
'entity': item.fields['entities_id'],
'condition': {'is_assign': 1},
})
) }}
{# In this case, date_creation is a user-changeable field (indicating when the actual domain record was added?) #}
{# TODO shouldn't this use a 'date' field instead of changing the purpose of date_creation? #}
{{ fields.dateField('date_creation', item.fields['date_creation'], __('Creation date'), {
clearable: true
} + field_options) }}
{{ fields.numberField('ttl', item.fields['ttl'], __('TTL'), field_options) }}
{{ inputs.hidden('data_obj', item.fields['data_obj'], {
id: 'data_obj' ~ rand
}) }}
{% set data_field_helper %}
{% endset %}
{{ fields.textField('data', item.fields['data'], __('Data'), {
full_width: true,
label_class: 'col-xxl-1',
input_class: 'col-xxl-11 d-flex',
add_field_html: data_field_helper,
id: 'data' ~ rand
}) }}
{% endblock %}