- 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.
93 lines
6.0 KiB
Twig
93 lines
6.0 KiB
Twig
{#
|
|
# 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, 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
|
|
# (see TaskController). Opened from Planning > Tasks, the task form goes back to the task list.
|
|
#}
|
|
{% set readOnly = readOnly|default(false) %}
|
|
{% set taskPermissions = taskPermissions|default({}) %}
|
|
{% set canCreate = not readOnly and plan.id and taskPermissions['plan:tasks:create']|default(false) %}
|
|
|
|
{% if canCreate %}
|
|
<div class="mb-md">
|
|
<a class="btn btn-ghost plan-task-add" href="{{ path('plan_task_action', {'objectAction': 'new', 'plan': plan.id, 'returnTo': 'plan'}) }}" data-toggle="ajax">
|
|
<i class="ri-add-line"></i> {{ 'mautic.plan.task.add'|trans }}
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if not plan.id %}
|
|
<p class="text-muted">{{ 'mautic.plan.task.save_plan_first'|trans }}</p>
|
|
{% 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-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="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>
|
|
{% for row in taskTree %}
|
|
{% set task = row.task %}
|
|
{% 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 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>
|
|
{% endif %}
|
|
{% if canEdit %}
|
|
<a href="{{ path('plan_task_action', {'objectAction': 'edit', 'objectId': task.id, 'returnTo': 'plan'}) }}" data-toggle="ajax">{{ task.name }}</a>
|
|
{% else %}
|
|
{{ task.name }}
|
|
{% endif %}
|
|
{% if childCount > 0 %}
|
|
<span class="text-muted small" title="{{ 'mautic.plan.task.subtasks'|trans }}">({{ childCount }})</span>
|
|
{% endif %}
|
|
</span>
|
|
</td>
|
|
<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 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>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|