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:
1 parent
8c8d7a6f95
commit
8696acd01c
52 files changed
+3178
-125
No files matched your search
@@ -1,7 +1,8 @@
|
||||
{#
|
||||
# Settings > Configuration > Plan Settings: the general currency, the description item types and the
|
||||
# allocation item types, each with a pictogram. Adding and removing types, and the pictogram preview,
|
||||
# are handled by Assets/js/plan.js (delegated handlers on .plan-config-types).
|
||||
# Settings > Configuration > Plan Settings: the general currency, then one section per kind of plan
|
||||
# item (description, allocation, objectives, tasks), each with a pictogram. Adding and removing
|
||||
# types, and the pictogram preview, are handled by Assets/js/plan.js (delegated handlers on
|
||||
# .plan-config-types).
|
||||
#}
|
||||
|
||||
{% macro type_row(type) %}
|
||||
@@ -83,6 +84,7 @@
|
||||
<h4 class="fw-sb mb-xs">{{ 'mautic.plan.config.section.general'|trans }}</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-6">{{ form_row(form.children.plan_currency) }}</div>
|
||||
<div class="col-md-6">{{ form_row(form.children.plan_stakeholder_phone_region) }}</div>
|
||||
</div>
|
||||
<p class="text-muted small">{{ 'mautic.plan.config.currency.help'|trans }}</p>
|
||||
|
||||
@@ -93,4 +95,16 @@
|
||||
{{ plan.type_section(form.children.plan_allocation_item_types,
|
||||
'mautic.plan.config.section.allocation_item_types',
|
||||
'mautic.plan.config.section.allocation_item_types.help') }}
|
||||
|
||||
{{ plan.type_section(form.children.plan_objective_types,
|
||||
'mautic.plan.config.section.objective_types',
|
||||
'mautic.plan.config.section.objective_types.help') }}
|
||||
|
||||
{{ plan.type_section(form.children.plan_task_types,
|
||||
'mautic.plan.config.section.task_types',
|
||||
'mautic.plan.config.section.task_types.help') }}
|
||||
|
||||
{{ plan.type_section(form.children.plan_stakeholder_types,
|
||||
'mautic.plan.config.section.stakeholder_types',
|
||||
'mautic.plan.config.section.stakeholder_types.help') }}
|
||||
{% endblock %}
|
||||
@@ -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>
|
||||
@@ -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('') }}">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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. #}
|
||||
|
||||
@@ -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. #}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}planStakeholder{% endblock %}
|
||||
|
||||
{% block preHeader %}
|
||||
{{- include('@MauticCore/Helper/page_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'close': true,
|
||||
},
|
||||
'closeUrl': path('plan_stakeholder_index'),
|
||||
'targetLabel': 'mautic.plan.stakeholder.header.index'|trans,
|
||||
}) -}}
|
||||
{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ item.name }}{% endblock %}
|
||||
|
||||
{% block publishStatus %}
|
||||
{% include '@MauticCore/Helper/_tag.html.twig' with { tags: [{
|
||||
color: item.isPublished ? 'green' : 'cool-gray',
|
||||
label: (item.isPublished ? 'mautic.plan.stakeholder.active' : 'mautic.plan.stakeholder.inactive')|trans,
|
||||
icon: item.isPublished ? 'ri-checkbox-circle-line' : 'ri-time-line',
|
||||
attributes: {'class': 'plan-stakeholder-status-tag'},
|
||||
}] } %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions %}
|
||||
{{- include('@MauticCore/Helper/page_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': securityHasEntityAccess(permissions['plan:stakeholders:editown'], permissions['plan:stakeholders:editother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['plan:stakeholders:deleteown'], permissions['plan:stakeholders:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'plan.stakeholder',
|
||||
}) -}}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="pa-md">
|
||||
<table class="table table-hover mb-md plan-stakeholder-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.plan.stakeholder.field.type'|trans }}</td>
|
||||
<td>
|
||||
{% 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 %}
|
||||
{{ plan_item_type_name('stakeholder', item.type) ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': item.type}) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.plan.stakeholder.field.role'|trans }}</td>
|
||||
<td>{{ item.role|default('mautic.plan.value.none'|trans) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.plan.stakeholder.field.email'|trans }}</td>
|
||||
<td>{% if item.email %}<a href="mailto:{{ item.email }}">{{ item.email }}</a>{% else %}{{ 'mautic.plan.value.none'|trans }}{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.plan.stakeholder.field.phone'|trans }}</td>
|
||||
<td>{% if item.phone %}<a href="tel:{{ item.phone|replace({' ': ''}) }}">{{ item.phone }}</a>{% else %}{{ 'mautic.plan.value.none'|trans }}{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.created'|trans }}</td>
|
||||
<td>{{ item.dateAdded ? dateToFull(item.dateAdded) : '' }}{% if item.createdByUser %} ({{ item.createdByUser }}){% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.id'|trans }}</td>
|
||||
<td>{{ item.id }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 class="mb-sm">{{ 'mautic.plan.stakeholder.field.plans'|trans }}</h4>
|
||||
{% if item.planLinks is empty %}
|
||||
<p class="text-muted">{{ 'mautic.plan.stakeholder.no_plans'|trans }}</p>
|
||||
{% else %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover plan-stakeholder-plans-view">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'mautic.plan.field.name'|trans }}</th>
|
||||
<th>{{ 'mautic.plan.stakeholder.field.role_in_plan'|trans }}</th>
|
||||
<th>{{ 'mautic.plan.field.status'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in item.planLinks %}
|
||||
<tr>
|
||||
<td><a href="{{ path('plan_action', {'objectAction': 'view', 'objectId': link.plan.id}) }}" data-toggle="ajax">{{ link.plan.name }}</a></td>
|
||||
<td class="text-muted">{{ link.roleInPlan|default('—') }}</td>
|
||||
<td><span class="label {{ link.plan.status.labelClass }}">{{ link.plan.status.labelKey|trans }}</span></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,43 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}planStakeholder{% endblock %}
|
||||
|
||||
{% block headerTitle %}
|
||||
{% if entity.id %}
|
||||
{{ 'mautic.plan.stakeholder.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{% else %}
|
||||
{{ 'mautic.plan.stakeholder.header.new'|trans }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ form_start(form) }}
|
||||
<div class="box-layout">
|
||||
<div class="col-md-9 height-auto bdr-r">
|
||||
<div class="pa-md">
|
||||
{{ form_row(form.name) }}
|
||||
<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('stakeholder', form.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-xs-11">
|
||||
{{ form_row(form.type) }}
|
||||
{# Filled with the selected type's description by plan.js. #}
|
||||
<p class="help-block plan-item-type-help">{{ plan_item_type_description('stakeholder', form.type.vars.value) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(form.role) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 height-auto">
|
||||
<div class="pr-lg pl-lg pt-md pb-md">
|
||||
{{ form_row(form.isPublished) }}
|
||||
{{ form_row(form.email) }}
|
||||
{{ form_row(form.phone) }}
|
||||
<p class="text-muted small">{{ 'mautic.plan.stakeholder.phone.help'|trans }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -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 %}
|
||||
@@ -16,6 +16,17 @@
|
||||
<div class="col-md-9 height-auto bdr-r">
|
||||
<div class="pa-md">
|
||||
{{ form_row(form.name) }}
|
||||
<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('task', form.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-xs-11">
|
||||
{{ form_row(form.type) }}
|
||||
{# Filled with the selected type's description by plan.js. #}
|
||||
<p class="help-block plan-item-type-help">{{ plan_item_type_description('task', form.type.vars.value) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(form.description) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,13 +34,24 @@
|
||||
'checkall': 'true',
|
||||
'target': '#planTaskTable',
|
||||
}) }}
|
||||
{# Columns: ID, Name, Description, Start date, End date, Status. #}
|
||||
{# Columns: ID, Pictogram, Type, Name, Description, Start date, End date, Status. #}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'orderBy': 't.id',
|
||||
'text': 'mautic.core.id',
|
||||
'class': 'col-plan-task-id',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'text': 'mautic.plan.task.field.pictogram',
|
||||
'class': 'col-plan-task-pictogram',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'orderBy': 't.type',
|
||||
'text': 'mautic.plan.task.field.type',
|
||||
'class': 'col-plan-task-type',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'orderBy': 't.name',
|
||||
@@ -88,6 +99,13 @@
|
||||
}) -}}
|
||||
</td>
|
||||
<td>{{ item.id }}</td>
|
||||
<td class="text-center">
|
||||
{% set typeIcon = plan_item_type_icon('task', 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('task', item.type) %} title="{{ plan_item_type_description('task', item.type) }}"{% endif %}>
|
||||
{{ plan_item_type_name('task', item.type) ?? 'mautic.plan.description_item.type.unknown'|trans({'%key%': item.type}) }}
|
||||
</td>
|
||||
<td>
|
||||
{% if canEdit %}
|
||||
<a href="{{ path('plan_task_action', {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{{ item.name }}</a>
|
||||
@@ -97,7 +115,7 @@
|
||||
</td>
|
||||
<td class="visible-md visible-lg text-muted">
|
||||
{% set description = item.description|default('')|striptags|trim %}
|
||||
{{ description|length > 120 ? description|slice(0, 120) ~ '…' : description }}
|
||||
{{ (description|length > 120 ? description|slice(0, 120) ~ '…' : description)|plan_linkify }}
|
||||
</td>
|
||||
<td>{{ item.startDate ? dateToFull(item.startDate) : '' }}</td>
|
||||
<td>{{ item.endDate ? dateToFull(item.endDate) : '' }}</td>
|
||||
|
||||
Reference in new issue
Block a user