feat: Add TargetType form and migration for plan targets

- Implemented TargetType form for managing target details including name, type, priority, stages, estimated size, profile criteria, pain points, value proposition, and preferred channels.
- Created migration scripts for adding type and priority columns to plan objectives and tasks.
- Added migration for creating plan targets and plan target stages tables, including foreign key constraints.
- Introduced stakeholder management with forms and views for creating, editing, and listing stakeholders.
- Enhanced UI with read more functionality for long text descriptions and filtering options in plan tab tables.
This commit is contained in:
Alexandre Gain committed 2026-11-08 11:54:25 +01:00
1 parent 8c8d7a6f95
commit 8696acd01c
52 files changed
+3178 -125

No files matched your search

@@ -0,0 +1,24 @@
{#
# A long text clamped to 10 lines with a "Read more" toggle: the first rows of a tab table stay
# readable at a glance, and nothing is lost. Pure CSS does the clamping (line-clamp works on <p> with
# display:-webkit-box); the button only toggles the class, so it also works without JS.
#
# Parameters:
# text: the text to show (may contain line breaks; URLs in it become links, see plan_linkify)
# id: unique element id for this instance
# lines: number of lines to clamp to (default 10)
#}
{% set lines = lines|default(10) %}
{% if text|trim is not empty %}
<div class="plan-read-more" id="{{ id }}">
<div class="plan-read-more-text" style="display: -webkit-box; -webkit-line-clamp: {{ lines }}; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap;">{{ text|plan_linkify }}</div>
<button type="button" class="btn btn-link btn-xs p-0 plan-read-more-toggle"
data-target="{{ id }}"
data-more-text="{{ 'mautic.plan.read_more.more'|trans }}"
data-less-text="{{ 'mautic.plan.read_more.less'|trans }}"
style="display: none; padding-left: 0;"
aria-expanded="false">
{{ 'mautic.plan.read_more.more'|trans }} <i class="ri-arrow-down-s-line"></i>
</button>
</div>
{% endif %}
@@ -0,0 +1,11 @@
{#
# The filter box of a plan tab table (Description, Objectives, Allocation, Tasks) and the switch that
# shows the "no match" message. Filtering and sorting are handled by Assets/js/plan.js
# (Mautic.planInitTabTable), on any table with the data-plan-tab-table attribute.
#}
<div class="plan-tab-table-filter input-group input-group-sm mb-xs" style="max-width: 300px;">
<span class="input-group-addon"><i class="ri-search-line"></i></span>
<input type="text" class="form-control plan-tab-table-filter-input"
placeholder="{{ 'mautic.plan.filter.placeholder'|trans }}" aria-label="{{ 'mautic.plan.filter.placeholder'|trans }}">
</div>
<p class="text-muted plan-tab-table-nomatch hide">{{ 'mautic.plan.filter.no_match'|trans }}</p>
+2 -1
View File
@@ -13,8 +13,9 @@
'details': 'mautic.plan.tab.details',
'description': 'mautic.plan.tab.description',
'objectives': 'mautic.plan.tab.objectives',
'allocation': 'mautic.plan.tab.allocation',
'allocation': 'mautic.plan.tab.allocations',
'targets': 'mautic.plan.tab.targets',
'stakeholders': 'mautic.plan.tab.stakeholders',
'tasks': 'mautic.plan.tab.tasks',
} %}
<ul class="nav nav-tabs nav-tabs-contained tabs-horizontal plan-tabs" role="tablist" data-plan-id="{{ planId|default('') }}">
+33 -19
View File
@@ -1,12 +1,12 @@
{#
# The plan's tasks, for the Tasks tab of the plan detail page and form. Same columns as the task list
# (Planning > Tasks): ID, Name, Description, Start date, End date, Status. Rows are in tree order:
# each task is followed by its sub-tasks, indented under it.
# The plan's tasks, for the Tasks tab of the plan detail page and form. Same harmonized columns as the
# other tabs: Pictogram (no label), Type, Name, Description, Start date, End date, Status (last). No ID
# column. Rows are in tree order: each task is followed by its sub-tasks, indented under it.
#
# Parameters:
# plan: the Plan
# taskTree: rows from TaskModel::getTaskTree(): {task, depth}, in display order
# readOnly: true on the plan form: no links, so that following one can't drop unsaved changes
# readOnly: true on the plan form: no links, no filter, so that following one can't drop unsaved changes
# taskPermissions: plan:tasks:* permissions (create, editown, editother), when not read-only
#
# Links carry returnTo=plan, so that Save and Cancel on the task form come back to this plan
@@ -29,16 +29,21 @@
{% elseif taskTree is empty %}
<p class="text-muted">{{ 'mautic.plan.task.empty'|trans }}</p>
{% else %}
{% if not readOnly %}
{# Filter + click-to-sort on the detail page (plan.js). The form's read-only copy stays plain. #}
{{ include('@Plan/Plan/_tab_table_filter.html.twig') }}
{% endif %}
<div class="table-responsive">
<table class="table table-hover plan-task-table">
<table class="table table-hover plan-tab-table plan-task-table{% if not readOnly %}" data-plan-tab-table data-empty-text="{{ 'mautic.plan.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.plan.filter.sort_hint'|trans }}{% endif %}">
<thead>
<tr>
<th class="col-plan-task-id">{{ 'mautic.core.id'|trans }}</th>
<th class="col-plan-task-name">{{ 'mautic.plan.task.field.name'|trans }}</th>
<th class="visible-md visible-lg col-plan-task-description">{{ 'mautic.plan.task.field.description'|trans }}</th>
<th class="col-plan-task-start">{{ 'mautic.plan.task.field.start_date'|trans }}</th>
<th class="col-plan-task-end">{{ 'mautic.plan.task.field.end_date'|trans }}</th>
<th class="col-plan-task-status">{{ 'mautic.plan.task.field.status'|trans }}</th>
<th class="plan-col-pictogram" aria-label="{{ 'mautic.plan.task.field.pictogram'|trans }}"></th>
<th class="plan-col-type">{{ 'mautic.plan.task.field.type'|trans }}</th>
<th class="plan-col-name">{{ 'mautic.plan.task.field.name'|trans }}</th>
<th class="plan-col-description">{{ 'mautic.plan.task.field.description'|trans }}</th>
<th class="plan-col-date">{{ 'mautic.plan.task.field.start_date'|trans }}</th>
<th class="plan-col-date">{{ 'mautic.plan.task.field.end_date'|trans }}</th>
<th class="plan-col-status">{{ 'mautic.plan.task.field.status'|trans }}</th>
</tr>
</thead>
<tbody>
@@ -47,8 +52,14 @@
{% set canEdit = not readOnly and securityHasEntityAccess(taskPermissions['plan:tasks:editown']|default(false), taskPermissions['plan:tasks:editother']|default(false), task.createdBy) %}
{% set childCount = taskTree|filter(r => r.task.parent and r.task.parent.id == task.id)|length %}
<tr class="plan-task" data-task-id="{{ task.id }}" data-depth="{{ row.depth }}">
<td>{{ task.id }}</td>
<td>
<td class="plan-col-pictogram text-center">
{% set taskTypeIcon = plan_item_type_icon('task', task.type) %}
{% if taskTypeIcon %}<i class="{{ taskTypeIcon }} plan-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
</td>
<td class="plan-col-type"{% if plan_item_type_description('task', task.type) %} title="{{ plan_item_type_description('task', task.type) }}" data-toggle="tooltip"{% endif %}>
{{ plan_item_type_name('task', task.type) ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': task.type}) }}
</td>
<td class="plan-col-name">
<span style="display: inline-block; padding-left: {{ row.depth * 24 }}px;">
{% if row.depth > 0 %}
<i class="ri-corner-down-right-line text-muted" title="{{ 'mautic.plan.task.subtask_of'|trans({'%parent%': task.parent.name}) }}"></i>
@@ -63,13 +74,16 @@
{% endif %}
</span>
</td>
<td class="visible-md visible-lg text-muted">
{% set description = task.description|default('')|striptags|trim %}
{{ description|length > 120 ? description|slice(0, 120) ~ '…' : description }}
<td class="plan-col-description text-muted">
{# Same 10-line clamp and read-more as the Description tab; URLs become links. #}
{{ include('@Plan/Plan/_description_read_more.html.twig', {
'text': task.description|default('')|striptags,
'id': 'plan-task-desc-' ~ task.id,
}) }}
</td>
<td>{{ task.startDate ? dateToFull(task.startDate) : '' }}</td>
<td>{{ task.endDate ? dateToFull(task.endDate) : '' }}</td>
<td><span class="label {{ task.status.labelClass }}">{{ task.status.labelKey|trans }}</span></td>
<td class="plan-col-date">{{ task.startDate ? dateToFull(task.startDate) : '' }}</td>
<td class="plan-col-date">{{ task.endDate ? dateToFull(task.endDate) : '' }}</td>
<td class="plan-col-status"><span class="label {{ task.status.labelClass }}">{{ task.status.labelKey|trans }}</span></td>
</tr>
{% endfor %}
</tbody>
+194 -43
View File
@@ -86,6 +86,8 @@
'description': descriptionItems|length,
'objectives': objectives|length,
'allocation': allocationItems|length,
'targets': item.targets|length,
'stakeholders': item.stakeholders|length,
'tasks': taskTree|length,
}}) }}
@@ -151,14 +153,17 @@
{% if descriptionItems is empty %}
<p class="text-muted">{{ 'mautic.plan.description_item.empty'|trans }}</p>
{% else %}
{# Three columns: the type's pictogram, the type, the description. #}
{# 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') }}
<div class="table-responsive">
<table class="table table-hover plan-description-items-view">
<table class="table table-hover plan-tab-table plan-description-items-view"
data-plan-tab-table data-empty-text="{{ 'mautic.plan.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.plan.filter.sort_hint'|trans }}">
<thead>
<tr>
<th class="text-center" style="width: 1%;">{{ 'mautic.plan.description_item.field.pictogram'|trans }}</th>
<th class="col-md-3">{{ 'mautic.plan.description_item.field.type'|trans }}</th>
<th>{{ 'mautic.plan.description_item.field.description'|trans }}</th>
<th class="plan-col-pictogram" aria-label="{{ 'mautic.plan.description_item.field.pictogram'|trans }}"></th>
<th class="plan-col-type">{{ 'mautic.plan.description_item.field.type'|trans }}</th>
<th class="plan-col-description">{{ 'mautic.plan.description_item.field.description'|trans }}</th>
</tr>
</thead>
<tbody>
@@ -167,15 +172,18 @@
{% set typeDescription = plan_item_type_description('description', descriptionItem.type) %}
{% set typeIcon = plan_item_type_icon('description', descriptionItem.type) %}
<tr>
<td class="text-center">
<td class="plan-col-pictogram text-center">
{% if typeIcon %}<i class="{{ typeIcon }} plan-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
</td>
<td>
<strong{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
{{ typeName ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': descriptionItem.type}) }}
</strong>
<td class="plan-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
{{ typeName ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': descriptionItem.type}) }}
</td>
<td class="plan-col-description">
{{ include('@Plan/Plan/_description_read_more.html.twig', {
'text': descriptionItem.description,
'id': 'plan-desc-item-' ~ descriptionItem.id,
}) }}
</td>
<td style="white-space: pre-wrap;">{{ descriptionItem.description }}</td>
</tr>
{% endfor %}
</tbody>
@@ -192,21 +200,49 @@
<p class="text-muted plan-objectives-progress">
{{ 'mautic.plan.objective.progress'|trans({'%achieved%': achievedCount, '%total%': objectives|length}) }}
</p>
<ol class="list-group plan-objectives-view">
{% for objective in objectives %}
<li class="list-group-item">
{% if objective.achieved %}
<i class="ri-checkbox-circle-fill text-success" title="{{ 'mautic.plan.objective.achieved'|trans }}"></i>
{% else %}
<i class="ri-checkbox-blank-circle-line text-muted" title="{{ 'mautic.plan.objective.not_achieved'|trans }}"></i>
{% endif %}
<strong>{{ objective.title }}</strong>
{% if objective.description is not empty %}
<div class="text-muted mt-xs" style="white-space: pre-wrap;">{{ objective.description }}</div>
{% endif %}
</li>
{% endfor %}
</ol>
{# 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') }}
<div class="table-responsive">
<table class="table table-hover plan-tab-table plan-objectives-view"
data-plan-tab-table data-empty-text="{{ 'mautic.plan.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.plan.filter.sort_hint'|trans }}">
<thead>
<tr>
<th class="plan-col-pictogram" aria-label="{{ 'mautic.plan.objective.field.pictogram'|trans }}"></th>
<th class="plan-col-type">{{ 'mautic.plan.objective.field.type'|trans }}</th>
<th class="plan-col-name">{{ 'mautic.plan.objective.field.name'|trans }}</th>
<th class="plan-col-description">{{ 'mautic.plan.objective.field.description'|trans }}</th>
<th class="plan-col-priority">{{ 'mautic.plan.objective.field.priority'|trans }}</th>
<th class="plan-col-status">{{ 'mautic.plan.objective.field.is_achieved'|trans }}</th>
</tr>
</thead>
<tbody>
{% for objective in objectives %}
{% set typeName = plan_item_type_name('objective', objective.type) %}
{% set typeDescription = plan_item_type_description('objective', objective.type) %}
{% set typeIcon = plan_item_type_icon('objective', objective.type) %}
<tr>
<td class="plan-col-pictogram text-center">
{% if typeIcon %}<i class="{{ typeIcon }} plan-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
</td>
<td class="plan-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
{{ typeName ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': objective.type}) }}
</td>
<td class="plan-col-name">{{ objective.title }}</td>
<td class="plan-col-description text-muted" style="white-space: pre-wrap;">{{ objective.description|plan_linkify }}</td>
<td class="plan-col-priority">{{ objective.priority ?? '—' }}</td>
<td class="plan-col-status">
{% if objective.achieved %}
<span class="label label-success"><i class="ri-checkbox-circle-fill" title="{{ 'mautic.plan.objective.achieved'|trans }}"></i> {{ 'mautic.plan.objective.achieved'|trans }}</span>
{% else %}
<span class="label label-default"><i class="ri-checkbox-blank-circle-line" title="{{ 'mautic.plan.objective.not_achieved'|trans }}"></i> {{ 'mautic.plan.objective.not_achieved'|trans }}</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
@@ -231,16 +267,20 @@
{% if allocationItems is empty %}
<p class="text-muted">{{ 'mautic.plan.allocation_item.empty'|trans }}</p>
{% 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') }}
<div class="table-responsive">
<table class="table table-hover plan-allocation-items-view">
<table class="table table-hover plan-tab-table plan-allocation-items-view"
data-plan-tab-table data-empty-text="{{ 'mautic.plan.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.plan.filter.sort_hint'|trans }}">
<thead>
<tr>
<th class="text-center" style="width: 1%;">{{ 'mautic.plan.allocation_item.field.pictogram'|trans }}</th>
<th>{{ 'mautic.plan.allocation_item.field.type'|trans }}</th>
<th>{{ 'mautic.plan.allocation_item.field.name'|trans }}</th>
<th class="visible-md visible-lg">{{ 'mautic.plan.allocation_item.field.description'|trans }}</th>
<th class="text-right">{{ 'mautic.plan.allocation_item.field.planned_cost'|trans }}</th>
<th class="text-right">{{ 'mautic.plan.allocation_item.field.real_cost'|trans }}</th>
<th class="plan-col-pictogram" aria-label="{{ 'mautic.plan.allocation_item.field.pictogram'|trans }}"></th>
<th class="plan-col-type">{{ 'mautic.plan.allocation_item.field.type'|trans }}</th>
<th class="plan-col-name">{{ 'mautic.plan.allocation_item.field.name'|trans }}</th>
<th class="plan-col-description">{{ 'mautic.plan.allocation_item.field.description'|trans }}</th>
<th class="plan-col-cost text-right">{{ 'mautic.plan.allocation_item.field.planned_cost'|trans }}</th>
<th class="plan-col-cost text-right">{{ 'mautic.plan.allocation_item.field.real_cost'|trans }}</th>
</tr>
</thead>
<tbody>
@@ -249,18 +289,18 @@
{% set typeDescription = plan_item_type_description('allocation', allocationItem.type) %}
{% set typeIcon = plan_item_type_icon('allocation', allocationItem.type) %}
<tr>
<td class="text-center">
<td class="plan-col-pictogram text-center">
{% if typeIcon %}<i class="{{ typeIcon }} plan-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
</td>
<td{% if typeDescription %} title="{{ typeDescription }}"{% endif %}>
<td class="plan-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
{{ typeName ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': allocationItem.type}) }}
</td>
<td>{{ allocationItem.name }}</td>
<td class="visible-md visible-lg text-muted" style="white-space: pre-wrap;">{{ allocationItem.description }}</td>
<td class="text-right text-nowrap">
<td class="plan-col-name">{{ allocationItem.name }}</td>
<td class="plan-col-description text-muted" style="white-space: pre-wrap;">{{ allocationItem.description|plan_linkify }}</td>
<td class="plan-col-cost text-right text-nowrap">
{% if allocationItem.plannedCost is not null %}{{ plan_money(allocationItem.plannedCost) }} {{ plan_currency() }}{% endif %}
</td>
<td class="text-right text-nowrap">
<td class="plan-col-cost text-right text-nowrap">
{% if allocationItem.realCost is not null %}{{ plan_money(allocationItem.realCost) }} {{ plan_currency() }}{% endif %}
</td>
</tr>
@@ -269,10 +309,10 @@
<tfoot>
<tr class="plan-allocation-total">
<th colspan="4">{{ 'mautic.plan.allocation.total'|trans }}</th>
<th class="text-right text-nowrap">
<th class="plan-col-cost text-right text-nowrap">
{% if allocationTotals.planned is not null %}{{ plan_money(allocationTotals.planned) }} {{ plan_currency() }}{% endif %}
</th>
<th class="text-right text-nowrap">
<th class="plan-col-cost text-right text-nowrap">
{% if allocationTotals.real is not null %}{{ plan_money(allocationTotals.real) }} {{ plan_currency() }}{% endif %}
</th>
</tr>
@@ -282,9 +322,120 @@
{% endif %}
</div>
{# Targets #}
{# Stakeholders: the plan's links to the global directory, harmonized like the other tabs. #}
<div class="tab-pane bdr-w-0" id="plan-tab-stakeholders" role="tabpanel">
{% set stakeholders = item.stakeholders %}
{% if stakeholders is empty %}
<p class="text-muted">{{ 'mautic.plan.stakeholder.empty'|trans }}</p>
{% 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') }}
<div class="table-responsive">
<table class="table table-hover plan-tab-table plan-stakeholders-view"
data-plan-tab-table data-empty-text="{{ 'mautic.plan.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.plan.filter.sort_hint'|trans }}">
<thead>
<tr>
<th class="plan-col-pictogram" aria-label="{{ 'mautic.plan.stakeholder.field.pictogram'|trans }}"></th>
<th class="plan-col-type">{{ 'mautic.plan.stakeholder.field.type'|trans }}</th>
<th class="plan-col-name">{{ 'mautic.plan.stakeholder.field.name'|trans }}</th>
<th class="plan-col-role">{{ 'mautic.plan.stakeholder.field.role_in_plan'|trans }}</th>
<th class="plan-col-role">{{ 'mautic.plan.stakeholder.field.role'|trans }}</th>
<th class="plan-col-email">{{ 'mautic.plan.stakeholder.field.email'|trans }}</th>
<th class="plan-col-phone">{{ 'mautic.plan.stakeholder.field.phone'|trans }}</th>
<th class="plan-col-active">{{ 'mautic.plan.stakeholder.field.active'|trans }}</th>
</tr>
</thead>
<tbody>
{% for link in stakeholders %}
{% set stakeholder = link.stakeholder %}
<tr>
<td class="plan-col-pictogram text-center">
{% set typeIcon = plan_item_type_icon('stakeholder', stakeholder.type) %}
{% if typeIcon %}<i class="{{ typeIcon }} plan-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
</td>
<td class="plan-col-type"{% if plan_item_type_description('stakeholder', stakeholder.type) %} title="{{ plan_item_type_description('stakeholder', stakeholder.type) }}" data-toggle="tooltip"{% endif %}>
{{ plan_item_type_name('stakeholder', stakeholder.type) ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': stakeholder.type}) }}
</td>
<td class="plan-col-name">
<a href="{{ path('plan_stakeholder_action', {'objectAction': 'view', 'objectId': stakeholder.id}) }}" data-toggle="ajax">{{ stakeholder.name }}</a>
</td>
<td class="plan-col-role">{{ link.roleInPlan }}</td>
<td class="plan-col-role text-muted">{{ stakeholder.role }}</td>
<td class="plan-col-email">
{% if stakeholder.email %}<a href="mailto:{{ stakeholder.email }}">{{ stakeholder.email }}</a>{% endif %}
</td>
<td class="plan-col-phone text-nowrap">
{% if stakeholder.phone %}<a href="tel:{{ stakeholder.phone|replace({' ': ''}) }}">{{ stakeholder.phone }}</a>{% endif %}
</td>
<td class="plan-col-active">
<span class="label {{ stakeholder.isPublished ? 'label-success' : 'label-gray' }}">
{{ (stakeholder.isPublished ? 'mautic.plan.stakeholder.active' : 'mautic.plan.stakeholder.inactive')|trans }}
</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
{# Targets: the plan's audiences, harmonized like the other tabs. #}
<div class="tab-pane bdr-w-0" id="plan-tab-targets" role="tabpanel">
<p class="text-muted">{{ 'mautic.plan.target.empty'|trans }}</p>
{% set targets = item.targets %}
{% if targets is empty %}
<p class="text-muted">{{ 'mautic.plan.target.empty'|trans }}</p>
{% 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') }}
<div class="table-responsive">
<table class="table table-hover plan-tab-table plan-targets-view"
data-plan-tab-table data-empty-text="{{ 'mautic.plan.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.plan.filter.sort_hint'|trans }}">
<thead>
<tr>
<th class="plan-col-pictogram" aria-label="{{ 'mautic.plan.target.field.pictogram'|trans }}"></th>
<th class="plan-col-type">{{ 'mautic.plan.target.field.type'|trans }}</th>
<th class="plan-col-name">{{ 'mautic.plan.target.field.name'|trans }}</th>
<th class="plan-col-priority">{{ 'mautic.plan.target.field.priority'|trans }}</th>
<th class="plan-col-stages">{{ 'mautic.plan.target.field.stages'|trans }}</th>
<th class="plan-col-size text-right">{{ 'mautic.plan.target.field.estimated_size'|trans }}</th>
<th class="plan-col-description">{{ 'mautic.plan.target.field.profile_criteria'|trans }}</th>
<th class="plan-col-description">{{ 'mautic.plan.target.field.pain_points'|trans }}</th>
<th class="plan-col-description">{{ 'mautic.plan.target.field.value_proposition'|trans }}</th>
<th class="plan-col-channels">{{ 'mautic.plan.target.field.preferred_channels'|trans }}</th>
</tr>
</thead>
<tbody>
{% for target in targets %}
<tr>
<td class="plan-col-pictogram text-center">
<i class="{{ target.targetType.icon }} plan-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>
</td>
<td class="plan-col-type">{{ target.targetType.labelKey|trans }}</td>
<td class="plan-col-name">{{ target.name }}</td>
<td class="plan-col-priority">
<span class="label {{ target.priority.labelClass }}">{{ target.priority.labelKey|trans }}</span>
</td>
<td class="plan-col-stages text-muted">
{{ target.stages|map(stage => stage.name)|join(', ') }}
</td>
<td class="plan-col-size text-right text-nowrap">{{ target.estimatedSize }}</td>
<td class="plan-col-description text-muted" style="white-space: pre-wrap;">{{ target.profileCriteria }}</td>
<td class="plan-col-description text-muted" style="white-space: pre-wrap;">{{ target.painPoints }}</td>
<td class="plan-col-description text-muted" style="white-space: pre-wrap;">{{ target.valueProposition }}</td>
<td class="plan-col-channels">
{% for channel in target.preferredChannels ?? [] %}
<span class="label label-default">{{ plan_target_channel_label(channel)|trans }}</span>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
{# Tasks: same columns as Planning > Tasks, in tree order. #}
+90 -6
View File
@@ -39,9 +39,23 @@
{% macro objective_row(objective) %}
{{ _self.row_start('mautic.plan.objective.drag') }}
<div class="row">
{# The selected type's pictogram; updated by plan.js when the type changes. #}
<div class="col-xs-1 text-center pt-lg">
<i class="plan-item-type-icon {{ plan_item_type_icon('objective', objective.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
</div>
<div class="col-xs-11">
{{ form_row(objective.type) }}
{# Filled with the selected type's description by plan.js. #}
<p class="help-block plan-item-type-help">{{ plan_item_type_description('objective', objective.type.vars.value) }}</p>
</div>
</div>
{{ form_row(objective.title) }}
<div class="row">
<div class="col-md-6">{{ form_row(objective.priority) }}</div>
<div class="col-md-6">{{ form_row(objective.isAchieved) }}</div>
</div>
{{ form_row(objective.description) }}
{{ form_row(objective.isAchieved) }}
{{ form_widget(objective.position) }}
{{ _self.row_end('mautic.plan.objective.remove') }}
{% endmacro %}
@@ -64,6 +78,33 @@
{{ _self.row_end('mautic.plan.description_item.remove') }}
{% endmacro %}
{% macro stakeholder_row(link) %}
{{ _self.row_start('mautic.plan.stakeholder.drag') }}
<div class="row">
<div class="col-md-6">{{ form_row(link.stakeholder) }}</div>
<div class="col-md-6">{{ form_row(link.roleInPlan) }}</div>
</div>
{{ form_widget(link.position) }}
{{ _self.row_end('mautic.plan.stakeholder.remove') }}
{% endmacro %}
{% macro target_row(target) %}
{{ _self.row_start('mautic.plan.target.drag') }}
{{ form_row(target.name) }}
<div class="row">
<div class="col-md-4">{{ form_row(target.targetType) }}</div>
<div class="col-md-4">{{ form_row(target.priority) }}</div>
<div class="col-md-4">{{ form_row(target.estimatedSize) }}</div>
</div>
{{ form_row(target.stages) }}
{{ form_row(target.profileCriteria) }}
{{ form_row(target.painPoints) }}
{{ form_row(target.valueProposition) }}
{{ form_row(target.preferredChannels) }}
{{ form_widget(target.position) }}
{{ _self.row_end('mautic.plan.target.remove') }}
{% endmacro %}
{% macro allocation_item_row(item) %}
{{ _self.row_start('mautic.plan.allocation_item.drag') }}
<div class="row">
@@ -152,10 +193,14 @@
{# Objectives #}
<div class="tab-pane bdr-w-0" id="plan-tab-objectives" role="tabpanel">
{% set hasObjectiveTypes = form.objectives.vars.prototype.type.vars.choices is not empty %}
<div class="plan-collection plan-objectives"
data-prototype="{{ _self.objective_row(form.objectives.vars.prototype)|e('html_attr') }}"
data-prototype-name="__objective__">
{{ form_errors(form.objectives) }}
{% if not hasObjectiveTypes %}
<div class="alert alert-info">{{ 'mautic.plan.objective.no_types'|trans }}</div>
{% endif %}
<p class="text-muted plan-collection-empty{% if form.objectives|length > 0 %} hide{% endif %}">
{{ 'mautic.plan.objective.empty'|trans }}
</p>
@@ -164,9 +209,11 @@
{{ _self.objective_row(objective) }}
{% endfor %}
</ul>
<button type="button" class="btn btn-ghost plan-collection-add">
<i class="ri-add-line"></i> {{ 'mautic.plan.objective.add'|trans }}
</button>
{% if hasObjectiveTypes %}
<button type="button" class="btn btn-ghost plan-collection-add">
<i class="ri-add-line"></i> {{ 'mautic.plan.objective.add'|trans }}
</button>
{% endif %}
</div>
{% do form.objectives.setRendered %}
</div>
@@ -203,9 +250,46 @@
{% do form.allocationItems.setRendered %}
</div>
{# Targets #}
{# Stakeholders: links to the global directory (Planning > Stakeholders). #}
<div class="tab-pane bdr-w-0" id="plan-tab-stakeholders" role="tabpanel">
<div class="plan-collection plan-stakeholders"
data-prototype="{{ _self.stakeholder_row(form.stakeholders.vars.prototype)|e('html_attr') }}"
data-prototype-name="__stakeholder__">
{{ form_errors(form.stakeholders) }}
<p class="text-muted plan-collection-empty{% if form.stakeholders|length > 0 %} hide{% endif %}">
{{ 'mautic.plan.stakeholder.empty'|trans }}
</p>
<ul class="list-group plan-collection-list">
{% for link in form.stakeholders %}
{{ _self.stakeholder_row(link) }}
{% endfor %}
</ul>
<button type="button" class="btn btn-ghost plan-collection-add">
<i class="ri-add-line"></i> {{ 'mautic.plan.stakeholder.add'|trans }}
</button>
</div>
{% do form.stakeholders.setRendered %}
</div>
{# Targets: the plan's audiences. #}
<div class="tab-pane bdr-w-0" id="plan-tab-targets" role="tabpanel">
<p class="text-muted">{{ 'mautic.plan.target.empty'|trans }}</p>
<div class="plan-collection plan-targets"
data-prototype="{{ _self.target_row(form.targets.vars.prototype)|e('html_attr') }}"
data-prototype-name="__target__">
{{ form_errors(form.targets) }}
<p class="text-muted plan-collection-empty{% if form.targets|length > 0 %} hide{% endif %}">
{{ 'mautic.plan.target.empty'|trans }}
</p>
<ul class="list-group plan-collection-list">
{% for target in form.targets %}
{{ _self.target_row(target) }}
{% endfor %}
</ul>
<button type="button" class="btn btn-ghost plan-collection-add">
<i class="ri-add-line"></i> {{ 'mautic.plan.target.add'|trans }}
</button>
</div>
{% do form.targets.setRendered %}
</div>
{# Tasks: read-only here, so that following a link doesn't drop unsaved changes to the plan. #}