{# # --------------------------------------------------------------------- # # 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 "layout/page_without_tabs.html.twig" %} {% set tabler_container_size = "narrow" %} {# TODO: rework this page style to use the standard tabler_title name for the form's title #} {% block content_body %} {# Is this a single or multi sections forms ? #} {% set is_single_section_form = form.getSections()|length == 1 %}
{# Form header: title and description #}

{{ form.fields.name }}

{{ form.fields.header|safe_html }}
{% for section in form.getSections() %} {# Is this the first section of a form ? #} {% set is_first_section = loop.index0 == 0 %} {% set section_index = loop.index0 %}
{{ __("Step %d of %d")|format(loop.index, form.getSections()|length) }}

{{ section.fields.name }}

{{ section.fields.description|safe_html }}
{% for form_block in section.getBlocks() %} {% if form_block is instanceof('Glpi\\Form\\Question') %} {% set question_type = form_block.getQuestionType() %} {% endif %} {% set skip_question = false %} {# Skip unknown types (may be a disabled plugin) #} {% if form_block is instanceof('Glpi\\Form\\Question') and question_type is null %} {% set skip_question = true %} {% endif %} {# Skip questions not allowed for anonymous forms #} {% if not skip_question and form_block is instanceof('Glpi\\Form\\Question') and unauthenticated_user and not question_type.isAllowedForUnauthenticatedAccess() %} {% set skip_question = true %} {% endif %} {% if not skip_question %}

{{ form_block.fields.name }} {% if form_block.fields.is_mandatory %} * {% endif %}

{% if form_block is instanceof('Glpi\\Form\\Question') %}
{{ question_type.renderEndUserTemplate(form_block)|raw }}
{% endif %}
{{ form_block.fields.description|safe_html }}
{% endif %} {% endfor %} {% endfor %} {# Form reference #} {# Actions #}
{# Final "success" confirmation #}
{{ __("Form submitted") }}

{{ __("Your form has been submitted successfully.") }}

{% endblock content_body %}