{% extends '@MauticCore/Default/content.html.twig' %} {% block mauticContent %}program{% endblock %} {# # No routeBase on the page_actions includes: core would turn it into mautic_program_* route names. # The buttons use actionRoute (initiative_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('initiative_index'), 'targetLabel': 'mautic.program.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': 'initiative-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.program.header.total_planned'|trans({'%amount%': program_money(totals.planned), '%currency%': program_currency()}), attributes: {'class': 'initiative-total-planned', 'title': 'mautic.program.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.program.header.total_real'|trans({'%amount%': program_money(totals.real), '%currency%': program_currency()}), attributes: {'class': 'initiative-total-real', 'title': (overPlan ? 'mautic.program.header.total_real.over' : 'mautic.program.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['program:initiatives:editown'], permissions['program:initiatives:editother'], item.createdBy), 'delete': securityHasEntityAccess(permissions['program:initiatives:deleteown'], permissions['program:initiatives:deleteother'], item.createdBy), }, 'langVar': 'initiative', }) -}} {% 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('@Program/Initiative/_tabs.html.twig', {'initiativeId': item.id, 'counts': { 'description': descriptionItems|length, 'objectives': objectives|length, 'allocation': allocationItems|length, 'audiences': item.audiences|length, 'stakeholders': item.stakeholders|length, 'tasks': taskTree|length, }}) }}| {{ 'mautic.program.field.status'|trans }} | {{ item.status.labelKey|trans }} |
| {{ 'mautic.program.field.completed_at'|trans }} | {{ dateToFull(item.completedAt) }} |
| {{ 'mautic.program.field.version'|trans }} | {{ item.version }} |
| {{ 'mautic.program.field.owner'|trans }} | {{ item.owner ? item.owner.name : 'mautic.program.owner.none'|trans }} |
| {{ 'mautic.program.field.start_date'|trans }} | {{ item.startDate ? dateToFull(item.startDate) : 'mautic.program.value.none'|trans }} |
| {{ 'mautic.program.field.end_date'|trans }} | {{ item.endDate ? dateToFull(item.endDate) : 'mautic.program.value.none'|trans }} |
| {{ 'mautic.core.category'|trans }} | {{ item.category ? item.category.title : 'mautic.program.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.program.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 (program.js). #} {{ include('@Program/Initiative/_tab_table_filter.html.twig') }}| {{ 'mautic.program.description_item.field.type'|trans }} | {{ 'mautic.program.description_item.field.description'|trans }} | |
|---|---|---|
| {% if typeIcon %}{% endif %} | {{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': descriptionItem.type}) }} | {{ include('@Program/Initiative/_description_read_more.html.twig', { 'text': descriptionItem.description, 'id': 'initiative-desc-item-' ~ descriptionItem.id, }) }} |
{{ 'mautic.program.objective.empty'|trans }}
{% else %}{{ 'mautic.program.objective.progress'|trans({'%achieved%': achievedCount, '%total%': objectives|length}) }}
{# Harmonized columns: Pictogram (no label), Type, Name (title), Description, Priority, Status (achieved). Filter + click-to-sort (program.js). #} {{ include('@Program/Initiative/_tab_table_filter.html.twig') }}| {{ 'mautic.program.objective.field.type'|trans }} | {{ 'mautic.program.objective.field.name'|trans }} | {{ 'mautic.program.objective.field.description'|trans }} | {{ 'mautic.program.objective.field.priority'|trans }} | {{ 'mautic.program.objective.field.is_achieved'|trans }} | |
|---|---|---|---|---|---|
| {% if typeIcon %}{% endif %} | {{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': objective.type}) }} | {{ objective.title }} | {{ objective.description|program_linkify }} | {{ objective.priority ?? '—' }} | {% if objective.achieved %} {{ 'mautic.program.objective.achieved'|trans }} {% else %} {{ 'mautic.program.objective.not_achieved'|trans }} {% endif %} |
| {{ 'mautic.program.field.budget_planned'|trans }} | {% if item.budgetPlanned is not null %} {{ program_money(item.budgetPlanned) }} {{ program_currency() }} {% else %} {{ 'mautic.program.value.none'|trans }} {% endif %} |
{{ 'mautic.program.allocation_item.empty'|trans }}
{% else %} {# Harmonized columns: Pictogram (no label), Type, Name, Description, then the costs. Filter + click-to-sort (program.js). #} {{ include('@Program/Initiative/_tab_table_filter.html.twig') }}| {{ 'mautic.program.allocation_item.field.type'|trans }} | {{ 'mautic.program.allocation_item.field.name'|trans }} | {{ 'mautic.program.allocation_item.field.description'|trans }} | {{ 'mautic.program.allocation_item.field.planned_cost'|trans }} | {{ 'mautic.program.allocation_item.field.real_cost'|trans }} | |
|---|---|---|---|---|---|
| {% if typeIcon %}{% endif %} | {{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': allocationItem.type}) }} | {{ allocationItem.name }} | {{ allocationItem.description|program_linkify }} | {% if allocationItem.plannedCost is not null %}{{ program_money(allocationItem.plannedCost) }} {{ program_currency() }}{% endif %} | {% if allocationItem.realCost is not null %}{{ program_money(allocationItem.realCost) }} {{ program_currency() }}{% endif %} |
| {{ 'mautic.program.allocation.total'|trans }} | {% if allocationTotals.planned is not null %}{{ program_money(allocationTotals.planned) }} {{ program_currency() }}{% endif %} | {% if allocationTotals.real is not null %}{{ program_money(allocationTotals.real) }} {{ program_currency() }}{% endif %} | |||
{{ 'mautic.program.stakeholder.empty'|trans }}
{% else %} {# Harmonized columns: Pictogram (no label), Type, Name, then the link's own fields. Filter + click-to-sort (program.js). #} {{ include('@Program/Initiative/_tab_table_filter.html.twig') }}| {{ 'mautic.program.stakeholder.field.type'|trans }} | {{ 'mautic.program.stakeholder.field.name'|trans }} | {{ 'mautic.program.stakeholder.field.role_in_initiative'|trans }} | {{ 'mautic.program.stakeholder.field.role'|trans }} | {{ 'mautic.program.stakeholder.field.email'|trans }} | {{ 'mautic.program.stakeholder.field.phone'|trans }} | {{ 'mautic.program.stakeholder.field.active'|trans }} | |
|---|---|---|---|---|---|---|---|
| {% set typeIcon = program_item_type_icon('stakeholder', stakeholder.type) %} {% if typeIcon %}{% endif %} | {{ program_item_type_name('stakeholder', stakeholder.type) ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': stakeholder.type}) }} | {{ stakeholder.name }} | {{ link.roleInInitiative }} | {{ stakeholder.role }} | {% if stakeholder.email %}{{ stakeholder.email }}{% endif %} | {% if stakeholder.phone %}{{ stakeholder.phone }}{% endif %} | {{ (stakeholder.isPublished ? 'mautic.program.stakeholder.active' : 'mautic.program.stakeholder.inactive')|trans }} |
{{ 'mautic.program.audience.empty'|trans }}
{% else %} {{ include('@Program/Initiative/_tab_table_filter.html.twig') }}| {{ 'mautic.program.audience.field.type'|trans }} | {{ 'mautic.program.audience.field.name'|trans }} | {{ 'mautic.program.audience.field.priority'|trans }} | {{ 'mautic.program.audience.field.stages'|trans }} | {{ 'mautic.program.audience.field.estimated_size'|trans }} | {{ 'mautic.program.audience.field.value_proposition'|trans }} | {{ 'mautic.program.audience.field.preferred_channels'|trans }} | |
|---|---|---|---|---|---|---|---|
| {{ audience.audienceType.labelKey|trans }} | {{ audience.name }} | {{ link.priority.labelKey|trans }} | {{ audience.stages|map(stage => stage.name)|join(', ') }} | {{ audience.estimatedSize }} | {{ link.valueProposition }} | {% for channel in audience.preferredChannels ?? [] %} {{ program_audience_channel_label(channel)|trans }} {% endfor %} |