{% extends '@MauticCore/Default/content.html.twig' %} {% block mauticContent %}plan{% endblock %} {% block headerTitle %} {% if entity.id %} {{ 'mautic.plan.header.edit'|trans({'%name%': entity.name}) }} {% else %} {{ 'mautic.plan.header.new'|trans }} {% endif %} {% endblock %} {# # Editable, sortable rows (objectives, description items). Each macro renders one row, for existing # rows and, through data-prototype, for new ones. Adding, removing and reordering rows is handled by # Assets/js/plan.js, through the plan-collection-* classes. #} {% macro row_start(dragLabel) %}
  • {% endmacro %} {% macro row_end(removeLabel) %}
  • {% endmacro %} {% macro objective_row(objective) %} {{ _self.row_start('mautic.plan.objective.drag') }} {{ form_row(objective.title) }} {{ form_row(objective.description) }} {{ form_row(objective.isAchieved) }} {{ form_widget(objective.position) }} {{ _self.row_end('mautic.plan.objective.remove') }} {% endmacro %} {% macro description_item_row(item) %} {{ _self.row_start('mautic.plan.description_item.drag') }}
    {# The selected type's pictogram; updated by plan.js when the type changes. #}
    {{ form_row(item.type) }} {# Filled with the selected type's description by plan.js. #}

    {{ plan_item_type_description('description', item.type.vars.value) }}

    {{ form_row(item.description) }} {{ form_widget(item.position) }} {{ _self.row_end('mautic.plan.description_item.remove') }} {% endmacro %} {% macro allocation_item_row(item) %} {{ _self.row_start('mautic.plan.allocation_item.drag') }}
    {# The selected type's pictogram; updated by plan.js when the type changes. #}
    {{ form_row(item.type) }} {# Filled with the selected type's description by plan.js. #}

    {{ plan_item_type_description('allocation', item.type.vars.value) }}

    {{ form_row(item.name) }}
    {{ form_row(item.description) }}
    {{ form_row(item.plannedCost) }}
    {{ form_row(item.realCost) }}
    {{ form_widget(item.position) }} {{ _self.row_end('mautic.plan.allocation_item.remove') }} {% endmacro %} {% block content %} {{ form_start(form) }}
    {{ form_row(form.name) }}
    {{ include('@Plan/Plan/_tabs.html.twig', {'planId': entity.id}) }}
    {# Details #}
    {{ form_row(form.status) }}
    {{ form_row(form.version) }}
    {{ form_row(form.owner) }}
    {% if entity.completedAt %}

    {{ dateToFull(entity.completedAt) }}

    {% endif %}
    {{ form_row(form.startDate) }}
    {{ form_row(form.endDate) }}
    {{ form_row(form.category) }}
    {{ form_row(form.isPublished) }}
    {# Description: description items. #}
    {% set hasTypes = form.descriptionItems.vars.prototype.type.vars.choices is not empty %}
    {{ form_errors(form.descriptionItems) }} {% if not hasTypes %}
    {{ 'mautic.plan.description_item.no_types'|trans }}
    {% endif %}

    {{ 'mautic.plan.description_item.empty'|trans }}

      {% for item in form.descriptionItems %} {{ _self.description_item_row(item) }} {% endfor %}
    {% if hasTypes %} {% endif %}
    {% do form.descriptionItems.setRendered %}
    {# Objectives #}
    {{ form_errors(form.objectives) }}

    {{ 'mautic.plan.objective.empty'|trans }}

      {% for objective in form.objectives %} {{ _self.objective_row(objective) }} {% endfor %}
    {% do form.objectives.setRendered %}
    {# Allocation: the plan's budget, then the allocation items (cost lines). #}
    {{ form_row(form.budgetPlanned) }}
    {% set hasAllocationTypes = form.allocationItems.vars.prototype.type.vars.choices is not empty %}

    {{ 'mautic.plan.field.allocation_items'|trans }}

    {{ form_errors(form.allocationItems) }} {% if not hasAllocationTypes %}
    {{ 'mautic.plan.allocation_item.no_types'|trans }}
    {% endif %}

    {{ 'mautic.plan.allocation_item.empty'|trans }}

      {% for item in form.allocationItems %} {{ _self.allocation_item_row(item) }} {% endfor %}
    {% if hasAllocationTypes %} {% endif %}
    {% do form.allocationItems.setRendered %}
    {# Targets #}

    {{ 'mautic.plan.target.empty'|trans }}

    {# Tasks: read-only here, so that following a link doesn't drop unsaved changes to the plan. #}
    {% if entity.id %}

    {{ 'mautic.plan.task.manage_from_plan_page'|trans }}

    {% endif %} {{ include('@Plan/Plan/_task_table.html.twig', { 'plan': entity, 'taskTree': taskTree|default([]), 'readOnly': true, }) }}
    {{ form_end(form) }} {% endblock %}