{% extends '@MauticCore/Default/content.html.twig' %} {% block mauticContent %}plan{% endblock %} {# # No routeBase on the page_actions includes: core would turn it into mautic_plan_* route names. # The buttons use actionRoute (plan_action) from the controller, and the close button gets its URL here. #} {% block preHeader %} {{- include('@MauticCore/Helper/page_actions.html.twig', { 'item': item, 'templateButtons': { 'close': true, }, 'closeUrl': path('plan_index'), 'targetLabel': 'mautic.plan.header.index'|trans, }) -}} {# Core's helper renders an empty pill when there is no category. #} {% if item.category %} {{ include('@MauticCore/Modules/category--inline.html.twig', {'category': item.category}) }} {% endif %} {% endblock %} {% block headerTitle %}{{ item.name }}{% endblock %} {# # Under the title, as on an email's page: the plan status, then the total planned and real costs of the # allocation items, in the general currency. A real total above the planned total is red, otherwise green. #} {% block publishStatus %} {% set statusColors = { 'draft': 'warm-gray', 'planned': 'blue', 'active': 'green', 'paused': 'warning', 'completed': 'teal', 'archived': 'cool-gray', } %} {% include '@MauticCore/Helper/_tag.html.twig' with { tags: [{ color: statusColors[item.status.value]|default('gray'), label: item.status.labelKey, icon: 'ri-flag-line', attributes: {'class': 'plan-status-tag'}, }] } %} {% set totals = item.allocationTotals %} {% if totals.planned is not null or totals.real is not null %}
{% set totalTags = [] %} {% if totals.planned is not null %} {% set totalTags = totalTags|merge([{ color: 'high-contrast', icon: 'ri-wallet-3-line', label: 'mautic.plan.header.total_planned'|trans({'%amount%': plan_money(totals.planned), '%currency%': plan_currency()}), attributes: {'class': 'plan-total-planned', 'title': 'mautic.plan.header.total_planned.tooltip'|trans, 'data-toggle': 'tooltip'}, }]) %} {% endif %} {% if totals.real is not null %} {% set overPlan = totals.planned is not null and (totals.real + 0) > (totals.planned + 0) %} {% set totalTags = totalTags|merge([{ color: overPlan ? 'red' : 'green', icon: overPlan ? 'ri-error-warning-line' : 'ri-checkbox-circle-line', label: 'mautic.plan.header.total_real'|trans({'%amount%': plan_money(totals.real), '%currency%': plan_currency()}), attributes: {'class': 'plan-total-real', 'title': (overPlan ? 'mautic.plan.header.total_real.over' : 'mautic.plan.header.total_real.tooltip')|trans, 'data-toggle': 'tooltip'}, }]) %} {% endif %} {% include '@MauticCore/Helper/_tag.html.twig' with { tags: totalTags } %} {% endif %} {% endblock %} {% block actions %} {{- include('@MauticCore/Helper/page_actions.html.twig', { 'item': item, 'templateButtons': { 'edit': securityHasEntityAccess(permissions['plan:plans:editown'], permissions['plan:plans:editother'], item.createdBy), 'delete': securityHasEntityAccess(permissions['plan:plans:deleteown'], permissions['plan:plans:deleteother'], item.createdBy), }, 'langVar': 'plan', }) -}} {% endblock %} {% block content %} {% set objectives = item.objectives %} {% set achievedCount = objectives|filter(o => o.achieved)|length %} {% set descriptionItems = item.descriptionItems %} {% set allocationItems = item.allocationItems %} {% set allocationTotals = item.allocationTotals %} {{ include('@Plan/Plan/_tabs.html.twig', {'planId': item.id, 'counts': { 'description': descriptionItems|length, 'objectives': objectives|length, 'allocation': allocationItems|length, 'targets': item.targets|length, 'stakeholders': item.stakeholders|length, 'tasks': taskTree|length, }}) }}| {{ 'mautic.plan.field.status'|trans }} | {{ item.status.labelKey|trans }} |
| {{ 'mautic.plan.field.completed_at'|trans }} | {{ dateToFull(item.completedAt) }} |
| {{ 'mautic.plan.field.version'|trans }} | {{ item.version }} |
| {{ 'mautic.plan.field.owner'|trans }} | {{ item.owner ? item.owner.name : 'mautic.plan.owner.none'|trans }} |
| {{ 'mautic.plan.field.start_date'|trans }} | {{ item.startDate ? dateToFull(item.startDate) : 'mautic.plan.value.none'|trans }} |
| {{ 'mautic.plan.field.end_date'|trans }} | {{ item.endDate ? dateToFull(item.endDate) : 'mautic.plan.value.none'|trans }} |
| {{ 'mautic.core.category'|trans }} | {{ item.category ? item.category.title : 'mautic.plan.value.none'|trans }} |
| {{ 'mautic.core.form.available'|trans }} | {{ (item.isPublished ? 'mautic.core.form.yes' : 'mautic.core.form.no')|trans }} |
| {{ 'mautic.core.created'|trans }} | {{ item.dateAdded ? dateToFull(item.dateAdded) : '' }}{% if item.createdByUser %} ({{ item.createdByUser }}){% endif %} |
| {{ 'mautic.core.modified'|trans }} | {{ dateToFull(item.dateModified) }}{% if item.modifiedByUser %} ({{ item.modifiedByUser }}){% endif %} |
| {{ 'mautic.core.id'|trans }} | {{ item.id }} |
{{ 'mautic.plan.description_item.empty'|trans }}
{% else %} {# Harmonized columns: Pictogram (no label), Type, Description. Description items have no name of their own, so the Name column is left out here. Filter + click-to-sort (plan.js). #} {{ include('@Plan/Plan/_tab_table_filter.html.twig') }}| {{ 'mautic.plan.description_item.field.type'|trans }} | {{ 'mautic.plan.description_item.field.description'|trans }} | |
|---|---|---|
| {% if typeIcon %}{% endif %} | {{ typeName ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': descriptionItem.type}) }} | {{ include('@Plan/Plan/_description_read_more.html.twig', { 'text': descriptionItem.description, 'id': 'plan-desc-item-' ~ descriptionItem.id, }) }} |
{{ 'mautic.plan.objective.empty'|trans }}
{% else %}{{ 'mautic.plan.objective.progress'|trans({'%achieved%': achievedCount, '%total%': objectives|length}) }}
{# Harmonized columns: Pictogram (no label), Type, Name (title), Description, Priority, Status (achieved). Filter + click-to-sort (plan.js). #} {{ include('@Plan/Plan/_tab_table_filter.html.twig') }}| {{ 'mautic.plan.objective.field.type'|trans }} | {{ 'mautic.plan.objective.field.name'|trans }} | {{ 'mautic.plan.objective.field.description'|trans }} | {{ 'mautic.plan.objective.field.priority'|trans }} | {{ 'mautic.plan.objective.field.is_achieved'|trans }} | |
|---|---|---|---|---|---|
| {% if typeIcon %}{% endif %} | {{ typeName ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': objective.type}) }} | {{ objective.title }} | {{ objective.description|plan_linkify }} | {{ objective.priority ?? '—' }} | {% if objective.achieved %} {{ 'mautic.plan.objective.achieved'|trans }} {% else %} {{ 'mautic.plan.objective.not_achieved'|trans }} {% endif %} |
| {{ 'mautic.plan.field.budget_planned'|trans }} | {% if item.budgetPlanned is not null %} {{ plan_money(item.budgetPlanned) }} {{ plan_currency() }} {% else %} {{ 'mautic.plan.value.none'|trans }} {% endif %} |
{{ 'mautic.plan.allocation_item.empty'|trans }}
{% else %} {# Harmonized columns: Pictogram (no label), Type, Name, Description, then the costs. Filter + click-to-sort (plan.js). #} {{ include('@Plan/Plan/_tab_table_filter.html.twig') }}| {{ 'mautic.plan.allocation_item.field.type'|trans }} | {{ 'mautic.plan.allocation_item.field.name'|trans }} | {{ 'mautic.plan.allocation_item.field.description'|trans }} | {{ 'mautic.plan.allocation_item.field.planned_cost'|trans }} | {{ 'mautic.plan.allocation_item.field.real_cost'|trans }} | |
|---|---|---|---|---|---|
| {% if typeIcon %}{% endif %} | {{ typeName ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': allocationItem.type}) }} | {{ allocationItem.name }} | {{ allocationItem.description|plan_linkify }} | {% if allocationItem.plannedCost is not null %}{{ plan_money(allocationItem.plannedCost) }} {{ plan_currency() }}{% endif %} | {% if allocationItem.realCost is not null %}{{ plan_money(allocationItem.realCost) }} {{ plan_currency() }}{% endif %} |
| {{ 'mautic.plan.allocation.total'|trans }} | {% if allocationTotals.planned is not null %}{{ plan_money(allocationTotals.planned) }} {{ plan_currency() }}{% endif %} | {% if allocationTotals.real is not null %}{{ plan_money(allocationTotals.real) }} {{ plan_currency() }}{% endif %} | |||
{{ 'mautic.plan.stakeholder.empty'|trans }}
{% else %} {# Harmonized columns: Pictogram (no label), Type, Name, then the link's own fields. Filter + click-to-sort (plan.js). #} {{ include('@Plan/Plan/_tab_table_filter.html.twig') }}| {{ 'mautic.plan.stakeholder.field.type'|trans }} | {{ 'mautic.plan.stakeholder.field.name'|trans }} | {{ 'mautic.plan.stakeholder.field.role_in_plan'|trans }} | {{ 'mautic.plan.stakeholder.field.role'|trans }} | {{ 'mautic.plan.stakeholder.field.email'|trans }} | {{ 'mautic.plan.stakeholder.field.phone'|trans }} | {{ 'mautic.plan.stakeholder.field.active'|trans }} | |
|---|---|---|---|---|---|---|---|
| {% set typeIcon = plan_item_type_icon('stakeholder', stakeholder.type) %} {% if typeIcon %}{% endif %} | {{ plan_item_type_name('stakeholder', stakeholder.type) ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': stakeholder.type}) }} | {{ stakeholder.name }} | {{ link.roleInPlan }} | {{ stakeholder.role }} | {% if stakeholder.email %}{{ stakeholder.email }}{% endif %} | {% if stakeholder.phone %}{{ stakeholder.phone }}{% endif %} | {{ (stakeholder.isPublished ? 'mautic.plan.stakeholder.active' : 'mautic.plan.stakeholder.inactive')|trans }} |
{{ 'mautic.plan.target.empty'|trans }}
{% else %} {# Harmonized columns: Pictogram (no label, fixed per target type), Type, Name, then the target's own fields. Filter + click-to-sort (plan.js). #} {{ include('@Plan/Plan/_tab_table_filter.html.twig') }}| {{ 'mautic.plan.target.field.type'|trans }} | {{ 'mautic.plan.target.field.name'|trans }} | {{ 'mautic.plan.target.field.priority'|trans }} | {{ 'mautic.plan.target.field.stages'|trans }} | {{ 'mautic.plan.target.field.estimated_size'|trans }} | {{ 'mautic.plan.target.field.profile_criteria'|trans }} | {{ 'mautic.plan.target.field.pain_points'|trans }} | {{ 'mautic.plan.target.field.value_proposition'|trans }} | {{ 'mautic.plan.target.field.preferred_channels'|trans }} | |
|---|---|---|---|---|---|---|---|---|---|
| {{ target.targetType.labelKey|trans }} | {{ target.name }} | {{ target.priority.labelKey|trans }} | {{ target.stages|map(stage => stage.name)|join(', ') }} | {{ target.estimatedSize }} | {{ target.profileCriteria }} | {{ target.painPoints }} | {{ target.valueProposition }} | {% for channel in target.preferredChannels ?? [] %} {{ plan_target_channel_label(channel)|trans }} {% endfor %} |