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

+169
View File
@@ -0,0 +1,169 @@
{% set isIndex = 'index' == tmpl ? true : false %}
{% set tmpl = 'list' %}
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
{% block mauticContent %}planStakeholder{% endblock %}
{% block headerTitle %}{{ 'mautic.plan.stakeholder.header.index'|trans }}{% endblock %}
{% block content %}
<div id="page-list-wrapper" class="{% if items|length > 0 or searchValue is not empty %}panel {% endif %}panel-default">
{{- include('@MauticCore/Helper/list_toolbar.html.twig', {
'searchValue': searchValue,
'action': currentRoute,
'page_actions': {
'templateButtons': {
'new': permissions['plan:stakeholders:create'],
},
'langVar': 'plan.stakeholder',
},
'bulk_actions': {
'langVar': 'plan.stakeholder',
'templateButtons': {
'delete': permissions['plan:stakeholders:deleteown'] or permissions['plan:stakeholders:deleteother'],
},
},
}) -}}
<div class="page-list">
{% if items is defined and items is not empty %}
<div class="table-responsive">
<table class="table table-hover" id="planStakeholderTable">
<thead>
<tr>
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'checkall': 'true',
'target': '#planStakeholderTable',
}) }}
{# Columns: ID, Pictogram, Type, Name, Role, Email, Phone, Active, Assigned plans. #}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'orderBy': 's.id',
'text': 'mautic.core.id',
'class': 'col-plan-stakeholder-id',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'text': 'mautic.plan.stakeholder.field.pictogram',
'class': 'col-plan-stakeholder-pictogram',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'orderBy': 's.type',
'text': 'mautic.plan.stakeholder.field.type',
'class': 'col-plan-stakeholder-type',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'orderBy': 's.name',
'text': 'mautic.plan.stakeholder.field.name',
'class': 'col-plan-stakeholder-name',
'default': true,
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'orderBy': 's.role',
'text': 'mautic.plan.stakeholder.field.role',
'class': 'visible-md visible-lg col-plan-stakeholder-role',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'orderBy': 's.email',
'text': 'mautic.plan.stakeholder.field.email',
'class': 'col-plan-stakeholder-email',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'text': 'mautic.plan.stakeholder.field.phone',
'class': 'col-plan-stakeholder-phone',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'orderBy': 's.isPublished',
'text': 'mautic.plan.stakeholder.field.active',
'class': 'col-plan-stakeholder-active',
}) }}
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'sessionVar': 'plan.stakeholder',
'text': 'mautic.plan.stakeholder.field.plans',
'class': 'visible-md visible-lg col-plan-stakeholder-plans',
}) }}
</tr>
</thead>
<tbody>
{% for item in items %}
{% set canEdit = securityHasEntityAccess(permissions['plan:stakeholders:editown'], permissions['plan:stakeholders:editother'], item.createdBy) %}
<tr>
<td>
{{- include('@MauticCore/Helper/list_actions.html.twig', {
'item': item,
'templateButtons': {
'edit': canEdit,
'delete': securityHasEntityAccess(permissions['plan:stakeholders:deleteown'], permissions['plan:stakeholders:deleteother'], item.createdBy),
},
'langVar': 'plan.stakeholder',
}) -}}
</td>
<td>{{ item.id }}</td>
<td class="text-center">
{% set typeIcon = plan_item_type_icon('stakeholder', item.type) %}
{% if typeIcon %}<i class="{{ typeIcon }} plan-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
</td>
<td{% if plan_item_type_description('stakeholder', item.type) %} title="{{ plan_item_type_description('stakeholder', item.type) }}"{% endif %}>
{{ plan_item_type_name('stakeholder', item.type) ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': item.type}) }}
</td>
<td>
{% if canEdit %}
<a href="{{ path('plan_stakeholder_action', {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{{ item.name }}</a>
{% else %}
{{ item.name }}
{% endif %}
</td>
<td class="visible-md visible-lg text-muted">{{ item.role }}</td>
<td>
{% if item.email %}<a href="mailto:{{ item.email }}">{{ item.email }}</a>{% endif %}
</td>
<td class="text-nowrap">
{% if item.phone %}<a href="tel:{{ item.phone|replace({' ': ''}) }}">{{ item.phone }}</a>{% endif %}
</td>
<td>
<span class="label {{ item.isPublished ? 'label-success' : 'label-gray' }}">
{{ (item.isPublished ? 'mautic.plan.stakeholder.active' : 'mautic.plan.stakeholder.inactive')|trans }}
</span>
</td>
<td class="visible-md visible-lg">
{# The plans this stakeholder is assigned to, through their Stakeholders tab. #}
{% set plans = item.planLinks|default([]) %}
{% for link in plans %}
<a href="{{ path('plan_action', {'objectAction': 'view', 'objectId': link.plan.id}) }}" data-toggle="ajax">{{ link.plan.name }}</a>{% if link.roleInPlan %} <span class="text-muted small">({{ link.roleInPlan }})</span>{% endif %}{% if not loop.last %}, {% endif %}
{% else %}
<span class="text-muted">{{ 'mautic.plan.stakeholder.no_plans'|trans }}</span>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="panel-footer">
{{- include('@MauticCore/Helper/pagination.html.twig', {
'totalItems': totalItems,
'page': page,
'limit': limit,
'baseUrl': path('plan_stakeholder_index'),
'sessionVar': 'plan.stakeholder',
}) -}}
</div>
</div>
{% elseif searchValue is not empty %}
{{ include('@MauticCore/Helper/noresults.html.twig') }}
{% else %}
<div class="mt-80 col-md-offset-2 col-lg-offset-3 col-md-8 col-lg-5 height-auto">
{{ include('@MauticCore/Components/content-block.html.twig', {
'heading': 'mautic.plan.stakeholder.onboarding.heading',
'subheading': 'mautic.plan.stakeholder.onboarding.subheading',
'copy': 'mautic.plan.stakeholder.onboarding.copy',
}) }}
</div>
{% endif %}
</div>
</div>
{% endblock %}