refactor(plugin): rebrand as MT3SMarketingProgram, release 0.17.0
Rename the plugin's vendor/namespace from experiential/Program to mt3s/MT3SMarketingProgram (composer: mt3s/mautic-marketing-program-bundle): - ProgramBundle -> MT3SMarketingProgramBundle; extension, integration, config support, permissions, events and twig extension renamed likewise - Initiative* -> Program*: controller (InitiativeController -> ProgramController), model, entities, repositories, form types and views (new _tabs/_task_table/_tab_table_filter partials, details page) - Settings config form theme -> _config_mt3smarketingprogramconfig_widget; routes and translations re-prefixed (mt3s_marketing_program_*) - Assets: icon.svg -> mt3s-mp-icon.svg; program.js -> mt3s-mp-program.js (OnLoad hooks renamed mt3sMpProgram*) - Add Command/RefreshStatsCommand; Migrations/Version_0_17_0.php renames the tables to mt3s_mp_program_*
This commit is contained in:
1 parent
687d33d30c
commit
ea88b7a772
131 files changed
+3238
-2836
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 mt3s_marketing_program_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="program-read-more" id="{{ id }}">
|
||||
<div class="program-read-more-text" style="display: -webkit-box; -webkit-line-clamp: {{ lines }}; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap;">{{ text|mt3s_marketing_program_linkify }}</div>
|
||||
<button type="button" class="btn btn-link btn-xs p-0 program-read-more-toggle"
|
||||
data-target="{{ id }}"
|
||||
data-more-text="{{ 'mt3s.marketing_program.read_more.more'|trans }}"
|
||||
data-less-text="{{ 'mt3s.marketing_program.read_more.less'|trans }}"
|
||||
style="display: none; padding-left: 0;"
|
||||
aria-expanded="false">
|
||||
{{ 'mt3s.marketing_program.read_more.more'|trans }} <i class="ri-arrow-down-s-line"></i>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{#
|
||||
# The filter box of an program tab table (Description, Objectives, Allocation, Tasks) and the switch that
|
||||
# shows the "no match" message. Filtering and sorting are handled by Assets/js/mt3s-mp-program.js
|
||||
# (Mautic.mt3sMpProgramInitTabTable), on any table with the data-program-tab-table attribute.
|
||||
#}
|
||||
<div class="program-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 program-tab-table-filter-input"
|
||||
placeholder="{{ 'mt3s.marketing_program.filter.placeholder'|trans }}" aria-label="{{ 'mt3s.marketing_program.filter.placeholder'|trans }}">
|
||||
</div>
|
||||
<p class="text-muted program-tab-table-nomatch hide">{{ 'mt3s.marketing_program.filter.no_match'|trans }}</p>
|
||||
@@ -0,0 +1,32 @@
|
||||
{#
|
||||
# Tab bar shared by the program form and the program detail page.
|
||||
#
|
||||
# Parameters:
|
||||
# programId: the program's id (null for a new program)
|
||||
# counts (optional): tab id => number shown next to the tab name
|
||||
#
|
||||
# The tab panes use the ids program-tab-<id>. Assets/js/mt3s-mp-program.js reopens the tab last used for this plan
|
||||
# (so Edit, Save and Cancel keep the same tab), and on the form marks the tabs whose pane contains a
|
||||
# validation error and opens the first of them.
|
||||
#}
|
||||
{% set programTabs = {
|
||||
'details': 'mt3s.marketing_program.tab.details',
|
||||
'description': 'mt3s.marketing_program.tab.description',
|
||||
'objectives': 'mt3s.marketing_program.tab.objectives',
|
||||
'allocation': 'mt3s.marketing_program.tab.allocations',
|
||||
'audiences': 'mt3s.marketing_program.tab.audiences',
|
||||
'stakeholders': 'mt3s.marketing_program.tab.stakeholders',
|
||||
'tasks': 'mt3s.marketing_program.tab.tasks',
|
||||
} %}
|
||||
<ul class="nav nav-tabs nav-tabs-contained tabs-horizontal program-tabs" role="tablist" data-program-id="{{ programId|default('') }}">
|
||||
{% for id, label in programTabs %}
|
||||
<li class="{{ loop.first ? 'active' : '' }}" data-tab-id="program-tab-{{ id }}">
|
||||
<a href="#program-tab-{{ id }}" role="tab" data-toggle="tab">
|
||||
<span>{{ label|trans }}</span>
|
||||
{% if counts is defined and counts[id] is defined %}
|
||||
<span class="badge">{{ counts[id] }}</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -0,0 +1,93 @@
|
||||
{#
|
||||
# The program's tasks, for the Tasks tab of the program 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:
|
||||
# program: the Program
|
||||
# taskTree: rows from TaskModel::getTaskTree(): {task, depth}, in display order
|
||||
# readOnly: true on the program form: no links, no filter, so that following one can't drop unsaved changes
|
||||
# taskPermissions: mt3smarketingprogram:tasks:* permissions (create, editown, editother), when not read-only
|
||||
#
|
||||
# Links carry returnTo=program, so that Save and Cancel on the task form come back to this program page
|
||||
# (see TaskController). Opened from Programs > Tasks, the task form goes back to the task list.
|
||||
#}
|
||||
{% set readOnly = readOnly|default(false) %}
|
||||
{% set taskPermissions = taskPermissions|default({}) %}
|
||||
{% set canCreate = not readOnly and program.id and taskPermissions['mt3smarketingprogram:tasks:create']|default(false) %}
|
||||
|
||||
{% if canCreate %}
|
||||
<div class="mb-md">
|
||||
<a class="btn btn-ghost program-task-add" href="{{ path('mt3s_marketing_program_task_action', {'objectAction': 'new', 'program': program.id, 'returnTo': 'program'}) }}" data-toggle="ajax">
|
||||
<i class="ri-add-line"></i> {{ 'mt3s.marketing_program.task.add'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not program.id %}
|
||||
<p class="text-muted">{{ 'mt3s.marketing_program.task.save_program_first'|trans }}</p>
|
||||
{% elseif taskTree is empty %}
|
||||
<p class="text-muted">{{ 'mt3s.marketing_program.task.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{% if not readOnly %}
|
||||
{# Filter + click-to-sort on the detail page (mt3s-mp-program.js). The form's read-only copy stays plain. #}
|
||||
{{ include('@MT3SMarketingProgram/Program/_tab_table_filter.html.twig') }}
|
||||
{% endif %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover program-tab-table program-task-table{% if not readOnly %}" data-program-tab-table data-empty-text="{{ 'mt3s.marketing_program.filter.no_match'|trans }}" data-sort-hint="{{ 'mt3s.marketing_program.filter.sort_hint'|trans }}{% endif %}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="program-col-pictogram" aria-label="{{ 'mt3s.marketing_program.task.field.pictogram'|trans }}"></th>
|
||||
<th class="program-col-type">{{ 'mt3s.marketing_program.task.field.type'|trans }}</th>
|
||||
<th class="program-col-name">{{ 'mt3s.marketing_program.task.field.name'|trans }}</th>
|
||||
<th class="program-col-description">{{ 'mt3s.marketing_program.task.field.description'|trans }}</th>
|
||||
<th class="program-col-date">{{ 'mt3s.marketing_program.task.field.start_date'|trans }}</th>
|
||||
<th class="program-col-date">{{ 'mt3s.marketing_program.task.field.end_date'|trans }}</th>
|
||||
<th class="program-col-status">{{ 'mt3s.marketing_program.task.field.status'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in taskTree %}
|
||||
{% set task = row.task %}
|
||||
{% set canEdit = not readOnly and securityHasEntityAccess(taskPermissions['mt3smarketingprogram:tasks:editown']|default(false), taskPermissions['mt3smarketingprogram:tasks:editother']|default(false), task.createdBy) %}
|
||||
<tr class="program-task" data-task-id="{{ task.id }}">
|
||||
<td class="program-col-pictogram text-center">
|
||||
{% set taskTypeIcon = mt3s_marketing_program_item_type_icon('task', task.type) %}
|
||||
{% if taskTypeIcon %}<i class="{{ taskTypeIcon }} program-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="program-col-type"{% if mt3s_marketing_program_item_type_description('task', task.type) %} title="{{ mt3s_marketing_program_item_type_description('task', task.type) }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ mt3s_marketing_program_item_type_name('task', task.type) ?? 'mt3s.marketing_program.description_item.type.unknown'|trans({'%key%': task.type}) }}
|
||||
</td>
|
||||
<td class="program-col-name">
|
||||
{% if canEdit %}
|
||||
<a href="{{ path('mt3s_marketing_program_task_action', {'objectAction': 'edit', 'objectId': task.id, 'returnTo': 'program'}) }}" data-toggle="ajax">{{ task.name }}</a>
|
||||
{% else %}
|
||||
{{ task.name }}
|
||||
{% endif %}
|
||||
{% if task.taskKind == constant('MauticPlugin\\MT3SMarketingProgramBundle\\Entity\\TaskKind::Milestone') %}
|
||||
<span class="label label-success" title="{{ 'mt3s.marketing_program.task.kind.milestone'|trans }}">{{ 'mt3s.marketing_program.task.kind.milestone_short'|trans }}</span>
|
||||
{% elseif task.taskKind == constant('MauticPlugin\\MT3SMarketingProgramBundle\\Entity\\TaskKind::Phase') %}
|
||||
<span class="label label-primary" title="{{ 'mt3s.marketing_program.task.kind.phase'|trans }}">{{ 'mt3s.marketing_program.task.kind.phase_short'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="program-col-description text-muted">
|
||||
{# Same 10-line clamp and read-more as the Description tab; URLs become links. #}
|
||||
{{ include('@MT3SMarketingProgram/Program/_description_read_more.html.twig', {
|
||||
'text': task.description|default('')|striptags,
|
||||
'id': 'program-task-desc-' ~ task.id,
|
||||
}) }}
|
||||
</td>
|
||||
<td class="program-col-date">{{ task.startDate ? task.startDate|date('Y-m-d') : '' }}</td>
|
||||
<td class="program-col-date">{{ task.endDate ? task.endDate|date('Y-m-d') : '' }}</td>
|
||||
<td class="program-col-status">
|
||||
{# A phase has no status of its own — skip the column value. #}
|
||||
{% if task.taskKind != constant('MauticPlugin\\MT3SMarketingProgramBundle\\Entity\\TaskKind::Phase') %}
|
||||
<span class="label {{ task.status.labelClass }}">{{ task.status.labelKey|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,449 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}program{% endblock %}
|
||||
|
||||
{#
|
||||
# No routeBase on the page_actions includes: core would turn it into mautic_mt3s_marketing_program_* route names.
|
||||
# The buttons use actionRoute (mt3s_marketing_program_action) from the controller, and the close button gets its URL here.
|
||||
#}
|
||||
{% block preHeader %}
|
||||
{{- include('@MauticCore/Helper/page_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'close': true,
|
||||
},
|
||||
'closeUrl': path('mt3s_marketing_program_index'),
|
||||
'targetLabel': 'mt3s.marketing_program.header.index'|trans,
|
||||
}) -}}
|
||||
{# Core's helper renders an empty pill when there is no category. #}
|
||||
{% if item.category %}
|
||||
{{ include('@MauticCore/Modules/category--inline.html.twig', {'category': item.category}) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ item.name }}{% endblock %}
|
||||
|
||||
{#
|
||||
# Under the title, as on an email's page: the plan status, then the total planned and real costs of the
|
||||
# allocation items, in the general currency. A real total above the planned total is red, otherwise green.
|
||||
#}
|
||||
{% block publishStatus %}
|
||||
{% set statusColors = {
|
||||
'draft': 'warm-gray', 'planned': 'blue', 'active': 'green',
|
||||
'paused': 'warning', 'completed': 'teal', 'archived': 'cool-gray',
|
||||
} %}
|
||||
{% include '@MauticCore/Helper/_tag.html.twig' with { tags: [{
|
||||
color: statusColors[item.status.value]|default('gray'),
|
||||
label: item.status.labelKey,
|
||||
icon: 'ri-flag-line',
|
||||
attributes: {'class': 'program-status-tag'},
|
||||
}] } %}
|
||||
|
||||
{% set totals = item.allocationTotals %}
|
||||
{% if totals.planned is not null or totals.real is not null %}
|
||||
<div class="label__divider"></div>
|
||||
{% set totalTags = [] %}
|
||||
{% if totals.planned is not null %}
|
||||
{% set totalTags = totalTags|merge([{
|
||||
color: 'high-contrast',
|
||||
icon: 'ri-wallet-3-line',
|
||||
label: 'mt3s.marketing_program.header.total_planned'|trans({'%amount%': mt3s_marketing_program_money(totals.planned), '%currency%': mt3s_marketing_program_currency()}),
|
||||
attributes: {'class': 'program-total-planned', 'title': 'mt3s.marketing_program.header.total_planned.tooltip'|trans, 'data-toggle': 'tooltip'},
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% if totals.real is not null %}
|
||||
{% set overPlan = totals.planned is not null and (totals.real + 0) > (totals.planned + 0) %}
|
||||
{% set totalTags = totalTags|merge([{
|
||||
color: overPlan ? 'red' : 'green',
|
||||
icon: overPlan ? 'ri-error-warning-line' : 'ri-checkbox-circle-line',
|
||||
label: 'mt3s.marketing_program.header.total_real'|trans({'%amount%': mt3s_marketing_program_money(totals.real), '%currency%': mt3s_marketing_program_currency()}),
|
||||
attributes: {'class': 'program-total-real', 'title': (overPlan ? 'mt3s.marketing_program.header.total_real.over' : 'mt3s.marketing_program.header.total_real.tooltip')|trans, 'data-toggle': 'tooltip'},
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% include '@MauticCore/Helper/_tag.html.twig' with { tags: totalTags } %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions %}
|
||||
{{- include('@MauticCore/Helper/page_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': securityHasEntityAccess(permissions['mt3smarketingprogram:programs:editown'], permissions['mt3smarketingprogram:programs:editother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['mt3smarketingprogram:programs:deleteown'], permissions['mt3smarketingprogram:programs:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'program',
|
||||
}) -}}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set objectives = item.objectives %}
|
||||
{% set achievedCount = objectives|filter(o => o.achieved)|length %}
|
||||
{% set descriptionItems = item.descriptionItems %}
|
||||
{% set allocationItems = item.allocationItems %}
|
||||
{% set allocationTotals = item.allocationTotals %}
|
||||
|
||||
{{ include('@MT3SMarketingProgram/Program/_tabs.html.twig', {'programId': item.id, 'counts': {
|
||||
'description': descriptionItems|length,
|
||||
'objectives': objectives|length,
|
||||
'allocation': allocationItems|length,
|
||||
'audiences': item.audiences|length,
|
||||
'stakeholders': item.stakeholders|length,
|
||||
'tasks': taskTree|length,
|
||||
}}) }}
|
||||
|
||||
<div class="tab-content pa-md">
|
||||
{# Details #}
|
||||
<div class="tab-pane active bdr-w-0" id="program-tab-details" role="tabpanel">
|
||||
<table class="table table-hover mb-0 program-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mt3s.marketing_program.field.status'|trans }}</td>
|
||||
<td>{{ item.status.labelKey|trans }}</td>
|
||||
</tr>
|
||||
{% if item.completedAt %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mt3s.marketing_program.field.completed_at'|trans }}</td>
|
||||
<td>{{ dateToFull(item.completedAt) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mt3s.marketing_program.field.version'|trans }}</td>
|
||||
<td>{{ item.version }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mt3s.marketing_program.field.owner'|trans }}</td>
|
||||
<td>{{ item.owner ? item.owner.name : 'mt3s.marketing_program.owner.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mt3s.marketing_program.field.start_date'|trans }}</td>
|
||||
<td>{{ item.startDate ? dateToFull(item.startDate) : 'mt3s.marketing_program.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mt3s.marketing_program.field.end_date'|trans }}</td>
|
||||
<td>{{ item.endDate ? dateToFull(item.endDate) : 'mt3s.marketing_program.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.category'|trans }}</td>
|
||||
<td>{{ item.category ? item.category.title : 'mt3s.marketing_program.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.form.available'|trans }}</td>
|
||||
<td>{{ (item.isPublished ? 'mautic.core.form.yes' : 'mautic.core.form.no')|trans }}</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>
|
||||
{% if item.dateModified %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.modified'|trans }}</td>
|
||||
<td>{{ dateToFull(item.dateModified) }}{% if item.modifiedByUser %} ({{ item.modifiedByUser }}){% endif %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.id'|trans }}</td>
|
||||
<td>{{ item.id }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{# Description #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-description" role="tabpanel">
|
||||
{% if descriptionItems is empty %}
|
||||
<p class="text-muted">{{ 'mt3s.marketing_program.description_item.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{# Harmonized columns: Pictogram (no label), Type, Description. Description items have no
|
||||
name of their own, so the Name column is left out here. Filter + click-to-sort (mt3s-mp-program.js). #}
|
||||
{{ include('@MT3SMarketingProgram/Program/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover program-tab-table program-description-items-view"
|
||||
data-program-tab-table data-empty-text="{{ 'mt3s.marketing_program.filter.no_match'|trans }}" data-sort-hint="{{ 'mt3s.marketing_program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="program-col-pictogram" aria-label="{{ 'mt3s.marketing_program.description_item.field.pictogram'|trans }}"></th>
|
||||
<th class="program-col-type">{{ 'mt3s.marketing_program.description_item.field.type'|trans }}</th>
|
||||
<th class="program-col-description">{{ 'mt3s.marketing_program.description_item.field.description'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for descriptionItem in descriptionItems %}
|
||||
{% set typeName = mt3s_marketing_program_item_type_name('description', descriptionItem.type) %}
|
||||
{% set typeDescription = mt3s_marketing_program_item_type_description('description', descriptionItem.type) %}
|
||||
{% set typeIcon = mt3s_marketing_program_item_type_icon('description', descriptionItem.type) %}
|
||||
<tr>
|
||||
<td class="program-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} program-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="program-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mt3s.marketing_program.description_item.type.unknown'|trans({'%key%': descriptionItem.type}) }}
|
||||
</td>
|
||||
<td class="program-col-description">
|
||||
{{ include('@MT3SMarketingProgram/Program/_description_read_more.html.twig', {
|
||||
'text': descriptionItem.description,
|
||||
'id': 'program-desc-item-' ~ descriptionItem.id,
|
||||
}) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Objectives #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-objectives" role="tabpanel">
|
||||
{% if objectives is empty %}
|
||||
<p class="text-muted">{{ 'mt3s.marketing_program.objective.empty'|trans }}</p>
|
||||
{% else %}
|
||||
<p class="text-muted program-objectives-progress">
|
||||
{{ 'mt3s.marketing_program.objective.progress'|trans({'%achieved%': achievedCount, '%total%': objectives|length}) }}
|
||||
</p>
|
||||
{# Harmonized columns: Pictogram (no label), Type, Name (title), Description, Priority,
|
||||
Status (achieved). Filter + click-to-sort (mt3s-mp-program.js). #}
|
||||
{{ include('@MT3SMarketingProgram/Program/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover program-tab-table program-objectives-view"
|
||||
data-program-tab-table data-empty-text="{{ 'mt3s.marketing_program.filter.no_match'|trans }}" data-sort-hint="{{ 'mt3s.marketing_program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="program-col-pictogram" aria-label="{{ 'mt3s.marketing_program.objective.field.pictogram'|trans }}"></th>
|
||||
<th class="program-col-type">{{ 'mt3s.marketing_program.objective.field.type'|trans }}</th>
|
||||
<th class="program-col-name">{{ 'mt3s.marketing_program.objective.field.name'|trans }}</th>
|
||||
<th class="program-col-description">{{ 'mt3s.marketing_program.objective.field.description'|trans }}</th>
|
||||
<th class="program-col-priority">{{ 'mt3s.marketing_program.objective.field.priority'|trans }}</th>
|
||||
<th class="program-col-status">{{ 'mt3s.marketing_program.objective.field.is_achieved'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for objective in objectives %}
|
||||
{% set typeName = mt3s_marketing_program_item_type_name('objective', objective.type) %}
|
||||
{% set typeDescription = mt3s_marketing_program_item_type_description('objective', objective.type) %}
|
||||
{% set typeIcon = mt3s_marketing_program_item_type_icon('objective', objective.type) %}
|
||||
<tr>
|
||||
<td class="program-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} program-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="program-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mt3s.marketing_program.description_item.type.unknown'|trans({'%key%': objective.type}) }}
|
||||
</td>
|
||||
<td class="program-col-name">{{ objective.title }}</td>
|
||||
<td class="program-col-description text-muted" style="white-space: pre-wrap;">{{ objective.description|mt3s_marketing_program_linkify }}</td>
|
||||
<td class="program-col-priority">{{ objective.priority ?? '—' }}</td>
|
||||
<td class="program-col-status">
|
||||
{% if objective.achieved %}
|
||||
<span class="label label-success"><i class="ri-checkbox-circle-fill" title="{{ 'mt3s.marketing_program.objective.achieved'|trans }}"></i> {{ 'mt3s.marketing_program.objective.achieved'|trans }}</span>
|
||||
{% else %}
|
||||
<span class="label label-default"><i class="ri-checkbox-blank-circle-line" title="{{ 'mt3s.marketing_program.objective.not_achieved'|trans }}"></i> {{ 'mt3s.marketing_program.objective.not_achieved'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Allocation: the program's budget, then the allocation items (cost lines) with their totals. #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-allocation" role="tabpanel">
|
||||
<table class="table table-hover mb-md program-allocation">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mt3s.marketing_program.field.budget_planned'|trans }}</td>
|
||||
<td>
|
||||
{% if item.budgetPlanned is not null %}
|
||||
{{ mt3s_marketing_program_money(item.budgetPlanned) }} {{ mt3s_marketing_program_currency() }}
|
||||
{% else %}
|
||||
{{ 'mt3s.marketing_program.value.none'|trans }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 class="mb-sm">{{ 'mt3s.marketing_program.field.allocation_items'|trans }}</h4>
|
||||
{% if allocationItems is empty %}
|
||||
<p class="text-muted">{{ 'mt3s.marketing_program.allocation_item.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{# Harmonized columns: Pictogram (no label), Type, Name, Description, then the costs.
|
||||
Filter + click-to-sort (mt3s-mp-program.js). #}
|
||||
{{ include('@MT3SMarketingProgram/Program/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover program-tab-table program-allocation-items-view"
|
||||
data-program-tab-table data-empty-text="{{ 'mt3s.marketing_program.filter.no_match'|trans }}" data-sort-hint="{{ 'mt3s.marketing_program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="program-col-pictogram" aria-label="{{ 'mt3s.marketing_program.allocation_item.field.pictogram'|trans }}"></th>
|
||||
<th class="program-col-type">{{ 'mt3s.marketing_program.allocation_item.field.type'|trans }}</th>
|
||||
<th class="program-col-name">{{ 'mt3s.marketing_program.allocation_item.field.name'|trans }}</th>
|
||||
<th class="program-col-description">{{ 'mt3s.marketing_program.allocation_item.field.description'|trans }}</th>
|
||||
<th class="program-col-cost text-right">{{ 'mt3s.marketing_program.allocation_item.field.planned_cost'|trans }}</th>
|
||||
<th class="program-col-cost text-right">{{ 'mt3s.marketing_program.allocation_item.field.real_cost'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for allocationItem in allocationItems %}
|
||||
{% set typeName = mt3s_marketing_program_item_type_name('allocation', allocationItem.type) %}
|
||||
{% set typeDescription = mt3s_marketing_program_item_type_description('allocation', allocationItem.type) %}
|
||||
{% set typeIcon = mt3s_marketing_program_item_type_icon('allocation', allocationItem.type) %}
|
||||
<tr>
|
||||
<td class="program-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} program-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="program-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mt3s.marketing_program.description_item.type.unknown'|trans({'%key%': allocationItem.type}) }}
|
||||
</td>
|
||||
<td class="program-col-name">{{ allocationItem.name }}</td>
|
||||
<td class="program-col-description text-muted" style="white-space: pre-wrap;">{{ allocationItem.description|mt3s_marketing_program_linkify }}</td>
|
||||
<td class="program-col-cost text-right text-nowrap">
|
||||
{% if allocationItem.plannedCost is not null %}{{ mt3s_marketing_program_money(allocationItem.plannedCost) }} {{ mt3s_marketing_program_currency() }}{% endif %}
|
||||
</td>
|
||||
<td class="program-col-cost text-right text-nowrap">
|
||||
{% if allocationItem.realCost is not null %}{{ mt3s_marketing_program_money(allocationItem.realCost) }} {{ mt3s_marketing_program_currency() }}{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="program-allocation-total">
|
||||
<th colspan="4">{{ 'mt3s.marketing_program.allocation.total'|trans }}</th>
|
||||
<th class="program-col-cost text-right text-nowrap">
|
||||
{% if allocationTotals.planned is not null %}{{ mt3s_marketing_program_money(allocationTotals.planned) }} {{ mt3s_marketing_program_currency() }}{% endif %}
|
||||
</th>
|
||||
<th class="program-col-cost text-right text-nowrap">
|
||||
{% if allocationTotals.real is not null %}{{ mt3s_marketing_program_money(allocationTotals.real) }} {{ mt3s_marketing_program_currency() }}{% endif %}
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Stakeholders: the program's links to the global directory, harmonized like the other tabs. #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-stakeholders" role="tabpanel">
|
||||
{% set stakeholders = item.stakeholders %}
|
||||
{% if stakeholders is empty %}
|
||||
<p class="text-muted">{{ 'mt3s.marketing_program.stakeholder.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{# Harmonized columns: Pictogram (no label), Type, Name, then the link's own fields.
|
||||
Filter + click-to-sort (mt3s-mp-program.js). #}
|
||||
{{ include('@MT3SMarketingProgram/Program/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover program-tab-table marketing-program-stakeholders-view"
|
||||
data-program-tab-table data-empty-text="{{ 'mt3s.marketing_program.filter.no_match'|trans }}" data-sort-hint="{{ 'mt3s.marketing_program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="program-col-pictogram" aria-label="{{ 'mt3s.marketing_program.stakeholder.field.pictogram'|trans }}"></th>
|
||||
<th class="program-col-type">{{ 'mt3s.marketing_program.stakeholder.field.type'|trans }}</th>
|
||||
<th class="program-col-name">{{ 'mt3s.marketing_program.stakeholder.field.name'|trans }}</th>
|
||||
<th class="program-col-role">{{ 'mt3s.marketing_program.stakeholder.field.role_in_program'|trans }}</th>
|
||||
<th class="program-col-role">{{ 'mt3s.marketing_program.stakeholder.field.role'|trans }}</th>
|
||||
<th class="program-col-email">{{ 'mt3s.marketing_program.stakeholder.field.email'|trans }}</th>
|
||||
<th class="program-col-phone">{{ 'mt3s.marketing_program.stakeholder.field.phone'|trans }}</th>
|
||||
<th class="program-col-active">{{ 'mt3s.marketing_program.stakeholder.field.active'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in stakeholders %}
|
||||
{% set stakeholder = link.stakeholder %}
|
||||
<tr>
|
||||
<td class="program-col-pictogram text-center">
|
||||
{% set typeIcon = mt3s_marketing_program_item_type_icon('stakeholder', stakeholder.type) %}
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} program-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="program-col-type"{% if mt3s_marketing_program_item_type_description('stakeholder', stakeholder.type) %} title="{{ mt3s_marketing_program_item_type_description('stakeholder', stakeholder.type) }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ mt3s_marketing_program_item_type_name('stakeholder', stakeholder.type) ?? 'mt3s.marketing_program.description_item.type.unknown'|trans({'%key%': stakeholder.type}) }}
|
||||
</td>
|
||||
<td class="program-col-name">
|
||||
<a href="{{ path('mt3s_marketing_program_stakeholder_action', {'objectAction': 'view', 'objectId': stakeholder.id}) }}" data-toggle="ajax">{{ stakeholder.name }}</a>
|
||||
</td>
|
||||
<td class="program-col-role">{{ link.roleInProgram }}</td>
|
||||
<td class="program-col-role text-muted">{{ stakeholder.role }}</td>
|
||||
<td class="program-col-email">
|
||||
{% if stakeholder.email %}<a href="mailto:{{ stakeholder.email }}">{{ stakeholder.email }}</a>{% endif %}
|
||||
</td>
|
||||
<td class="program-col-phone text-nowrap">
|
||||
{% if stakeholder.phone %}<a href="tel:{{ stakeholder.phone|replace({' ': ''}) }}">{{ stakeholder.phone }}</a>{% endif %}
|
||||
</td>
|
||||
<td class="program-col-active">
|
||||
<span class="label {{ stakeholder.isPublished ? 'label-success' : 'label-gray' }}">
|
||||
{{ (stakeholder.isPublished ? 'mt3s.marketing_program.stakeholder.active' : 'mt3s.marketing_program.stakeholder.inactive')|trans }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Audiences: the program's links to the global directory (Programs > Audiences), harmonized like
|
||||
the other tabs: pictogram, Type, Name (link to the audience's page), priority in this plan,
|
||||
then the audience's own attributes. Filter + click-to-sort (mt3s-mp-program.js). #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-audiences" role="tabpanel">
|
||||
{% set audiences = item.audiences %}
|
||||
{% if audiences is empty %}
|
||||
<p class="text-muted">{{ 'mt3s.marketing_program.audience.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{{ include('@MT3SMarketingProgram/Program/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover program-tab-table marketing-program-audiences-view"
|
||||
data-program-tab-table data-empty-text="{{ 'mt3s.marketing_program.filter.no_match'|trans }}" data-sort-hint="{{ 'mt3s.marketing_program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="program-col-pictogram" aria-label="{{ 'mt3s.marketing_program.audience.field.pictogram'|trans }}"></th>
|
||||
<th class="program-col-type">{{ 'mt3s.marketing_program.audience.field.type'|trans }}</th>
|
||||
<th class="program-col-name">{{ 'mt3s.marketing_program.audience.field.name'|trans }}</th>
|
||||
<th class="program-col-priority">{{ 'mt3s.marketing_program.audience.field.priority'|trans }}</th>
|
||||
<th class="program-col-stages">{{ 'mt3s.marketing_program.audience.field.stages'|trans }}</th>
|
||||
<th class="program-col-size text-right">{{ 'mt3s.marketing_program.audience.field.estimated_size'|trans }}</th>
|
||||
<th class="program-col-description">{{ 'mt3s.marketing_program.audience.field.value_proposition'|trans }}</th>
|
||||
<th class="program-col-channels">{{ 'mt3s.marketing_program.audience.field.preferred_channels'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in audiences %}
|
||||
{% set audience = link.audience %}
|
||||
<tr>
|
||||
<td class="program-col-pictogram text-center">
|
||||
<i class="{{ audience.audienceType.icon }} program-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>
|
||||
</td>
|
||||
<td class="program-col-type">{{ audience.audienceType.labelKey|trans }}</td>
|
||||
<td class="program-col-name">
|
||||
<a href="{{ path('mt3s_marketing_program_audience_action', {'objectAction': 'view', 'objectId': audience.id}) }}" data-toggle="ajax">{{ audience.name }}</a>
|
||||
</td>
|
||||
<td class="program-col-priority">
|
||||
<span class="label {{ link.priority.labelClass }}">{{ link.priority.labelKey|trans }}</span>
|
||||
</td>
|
||||
<td class="program-col-stages text-muted">
|
||||
{{ audience.stages|map(stage => stage.name)|join(', ') }}
|
||||
</td>
|
||||
<td class="program-col-size text-right text-nowrap">{{ audience.estimatedSize }}</td>
|
||||
<td class="program-col-description text-muted" style="white-space: pre-wrap;">{{ link.valueProposition }}</td>
|
||||
<td class="program-col-channels">
|
||||
{% for channel in audience.preferredChannels ?? [] %}
|
||||
<span class="label label-default">{{ mt3s_marketing_program_audience_channel_label(channel)|trans }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Tasks: same columns as Programs > Tasks, in tree order. #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-tasks" role="tabpanel">
|
||||
{{ include('@MT3SMarketingProgram/Program/_task_table.html.twig', {
|
||||
'program': item,
|
||||
'taskTree': taskTree,
|
||||
'taskPermissions': taskPermissions,
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,301 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}program{% endblock %}
|
||||
|
||||
{% block headerTitle %}
|
||||
{% if entity.id %}
|
||||
{{ 'mt3s.marketing_program.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{% else %}
|
||||
{{ 'mt3s.marketing_program.header.new'|trans }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{#
|
||||
# Editable, sortable rows (objectives, description items). Each macro renders one row, for existing
|
||||
# rows and, through data-prototype, for new ones. Adding, removing and reordering rows is handled by
|
||||
# Assets/js/mt3s-mp-program.js, through the program-collection-* classes.
|
||||
#}
|
||||
{% macro row_start(dragLabel) %}
|
||||
<li class="program-collection-row list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-1 text-center">
|
||||
<span class="program-collection-handle text-muted" title="{{ dragLabel|trans }}" style="cursor: move;">
|
||||
<i class="ri-draggable ri-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-xs-10">
|
||||
{% endmacro %}
|
||||
|
||||
{% macro row_end(removeLabel) %}
|
||||
</div>
|
||||
<div class="col-xs-1 text-right">
|
||||
<button type="button" class="btn btn-ghost btn-sm program-collection-remove" title="{{ removeLabel|trans }}">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro objective_row(objective) %}
|
||||
{{ _self.row_start('mt3s.marketing_program.objective.drag') }}
|
||||
<div class="row">
|
||||
{# The selected type's pictogram; updated by mt3s-mp-program.js when the type changes. #}
|
||||
<div class="col-xs-1 text-center pt-lg">
|
||||
<i class="program-item-type-icon {{ mt3s_marketing_program_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 mt3s-mp-program.js. #}
|
||||
<p class="help-block program-item-type-help">{{ mt3s_marketing_program_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_widget(objective.position) }}
|
||||
{{ _self.row_end('mt3s.marketing_program.objective.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro description_item_row(item) %}
|
||||
{{ _self.row_start('mt3s.marketing_program.description_item.drag') }}
|
||||
<div class="row">
|
||||
{# The selected type's pictogram; updated by mt3s-mp-program.js when the type changes. #}
|
||||
<div class="col-xs-1 text-center pt-lg">
|
||||
<i class="program-item-type-icon {{ mt3s_marketing_program_item_type_icon('description', item.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-xs-11">
|
||||
{{ form_row(item.type) }}
|
||||
{# Filled with the selected type's description by mt3s-mp-program.js. #}
|
||||
<p class="help-block program-item-type-help">{{ mt3s_marketing_program_item_type_description('description', item.type.vars.value) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(item.description) }}
|
||||
{{ form_widget(item.position) }}
|
||||
{{ _self.row_end('mt3s.marketing_program.description_item.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro stakeholder_row(link) %}
|
||||
{{ _self.row_start('mt3s.marketing_program.stakeholder.drag') }}
|
||||
<div class="row">
|
||||
<div class="col-md-6">{{ form_row(link.stakeholder) }}</div>
|
||||
<div class="col-md-6">{{ form_row(link.roleInProgram) }}</div>
|
||||
</div>
|
||||
{{ form_widget(link.position) }}
|
||||
{{ _self.row_end('mt3s.marketing_program.stakeholder.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro audience_row(audience) %}
|
||||
{{ _self.row_start('mt3s.marketing_program.audience.drag') }}
|
||||
{{ form_row(audience.audience) }}
|
||||
{{ form_row(audience.priority) }}
|
||||
{{ form_row(audience.valueProposition) }}
|
||||
{{ form_widget(audience.position) }}
|
||||
{{ _self.row_end('mt3s.marketing_program.audience.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro allocation_item_row(item) %}
|
||||
{{ _self.row_start('mt3s.marketing_program.allocation_item.drag') }}
|
||||
<div class="row">
|
||||
{# The selected type's pictogram; updated by mt3s-mp-program.js when the type changes. #}
|
||||
<div class="col-xs-1 text-center pt-lg">
|
||||
<i class="program-item-type-icon {{ mt3s_marketing_program_item_type_icon('allocation', item.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-xs-11">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{{ form_row(item.type) }}
|
||||
{# Filled with the selected type's description by mt3s-mp-program.js. #}
|
||||
<p class="help-block program-item-type-help">{{ mt3s_marketing_program_item_type_description('allocation', item.type.vars.value) }}</p>
|
||||
</div>
|
||||
<div class="col-md-6">{{ form_row(item.name) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(item.description) }}
|
||||
<div class="row">
|
||||
<div class="col-md-6">{{ form_row(item.plannedCost) }}</div>
|
||||
<div class="col-md-6">{{ form_row(item.realCost) }}</div>
|
||||
</div>
|
||||
{{ form_widget(item.position) }}
|
||||
{{ _self.row_end('mt3s.marketing_program.allocation_item.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
{{ form_start(form) }}
|
||||
<div class="pa-md pb-0">
|
||||
{{ form_row(form.name) }}
|
||||
</div>
|
||||
|
||||
{{ include('@MT3SMarketingProgram/Program/_tabs.html.twig', {'programId': entity.id}) }}
|
||||
|
||||
<div class="tab-content pa-md">
|
||||
{# Details #}
|
||||
<div class="tab-pane active bdr-w-0" id="program-tab-details" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-4">{{ form_row(form.status) }}</div>
|
||||
<div class="col-md-4">{{ form_row(form.version) }}</div>
|
||||
<div class="col-md-4">{{ form_row(form.owner) }}</div>
|
||||
</div>
|
||||
{% if entity.completedAt %}
|
||||
<div class="form-group">
|
||||
<label class="control-label">{{ 'mt3s.marketing_program.field.completed_at'|trans }}</label>
|
||||
<p class="form-control-static">{{ dateToFull(entity.completedAt) }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-md-6">{{ form_row(form.startDate) }}</div>
|
||||
<div class="col-md-6">{{ form_row(form.endDate) }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">{{ form_row(form.category) }}</div>
|
||||
<div class="col-md-6">{{ form_row(form.isPublished) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Description: description items. #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-description" role="tabpanel">
|
||||
{% set hasTypes = form.descriptionItems.vars.prototype.type.vars.choices is not empty %}
|
||||
<div class="program-collection program-description-items"
|
||||
data-prototype="{{ _self.description_item_row(form.descriptionItems.vars.prototype)|e('html_attr') }}"
|
||||
data-prototype-name="__descitem__">
|
||||
{{ form_errors(form.descriptionItems) }}
|
||||
{% if not hasTypes %}
|
||||
<div class="alert alert-info">{{ 'mt3s.marketing_program.description_item.no_types'|trans }}</div>
|
||||
{% endif %}
|
||||
<p class="text-muted program-collection-empty{% if form.descriptionItems|length > 0 %} hide{% endif %}">
|
||||
{{ 'mt3s.marketing_program.description_item.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group program-collection-list">
|
||||
{% for item in form.descriptionItems %}
|
||||
{{ _self.description_item_row(item) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if hasTypes %}
|
||||
<button type="button" class="btn btn-ghost program-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mt3s.marketing_program.description_item.add'|trans }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% do form.descriptionItems.setRendered %}
|
||||
</div>
|
||||
|
||||
{# Objectives #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-objectives" role="tabpanel">
|
||||
{% set hasObjectiveTypes = form.objectives.vars.prototype.type.vars.choices is not empty %}
|
||||
<div class="program-collection program-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">{{ 'mt3s.marketing_program.objective.no_types'|trans }}</div>
|
||||
{% endif %}
|
||||
<p class="text-muted program-collection-empty{% if form.objectives|length > 0 %} hide{% endif %}">
|
||||
{{ 'mt3s.marketing_program.objective.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group program-collection-list">
|
||||
{% for objective in form.objectives %}
|
||||
{{ _self.objective_row(objective) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if hasObjectiveTypes %}
|
||||
<button type="button" class="btn btn-ghost program-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mt3s.marketing_program.objective.add'|trans }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% do form.objectives.setRendered %}
|
||||
</div>
|
||||
|
||||
{# Allocation: the program's budget, then the allocation items (cost lines). #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-allocation" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-6">{{ form_row(form.budgetPlanned) }}</div>
|
||||
</div>
|
||||
|
||||
{% set hasAllocationTypes = form.allocationItems.vars.prototype.type.vars.choices is not empty %}
|
||||
<div class="program-collection program-allocation-items"
|
||||
data-prototype="{{ _self.allocation_item_row(form.allocationItems.vars.prototype)|e('html_attr') }}"
|
||||
data-prototype-name="__allocitem__">
|
||||
<h4 class="mt-lg mb-sm">{{ 'mt3s.marketing_program.field.allocation_items'|trans }}</h4>
|
||||
{{ form_errors(form.allocationItems) }}
|
||||
{% if not hasAllocationTypes %}
|
||||
<div class="alert alert-info">{{ 'mt3s.marketing_program.allocation_item.no_types'|trans }}</div>
|
||||
{% endif %}
|
||||
<p class="text-muted program-collection-empty{% if form.allocationItems|length > 0 %} hide{% endif %}">
|
||||
{{ 'mt3s.marketing_program.allocation_item.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group program-collection-list">
|
||||
{% for item in form.allocationItems %}
|
||||
{{ _self.allocation_item_row(item) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if hasAllocationTypes %}
|
||||
<button type="button" class="btn btn-ghost program-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mt3s.marketing_program.allocation_item.add'|trans }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% do form.allocationItems.setRendered %}
|
||||
</div>
|
||||
|
||||
{# Stakeholders: links to the global directory (Programs > Stakeholders). #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-stakeholders" role="tabpanel">
|
||||
<div class="program-collection marketing-program-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 program-collection-empty{% if form.stakeholders|length > 0 %} hide{% endif %}">
|
||||
{{ 'mt3s.marketing_program.stakeholder.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group program-collection-list">
|
||||
{% for link in form.stakeholders %}
|
||||
{{ _self.stakeholder_row(link) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<button type="button" class="btn btn-ghost program-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mt3s.marketing_program.stakeholder.add'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
{% do form.stakeholders.setRendered %}
|
||||
</div>
|
||||
|
||||
{# Audiences: the program's links to the global directory (Programs > Audiences). #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-audiences" role="tabpanel">
|
||||
<p class="text-muted small">{{ 'mt3s.marketing_program.audience.link_tab.help'|trans }}</p>
|
||||
<div class="program-collection marketing-program-audiences"
|
||||
data-prototype="{{ _self.audience_row(form.audiences.vars.prototype)|e('html_attr') }}"
|
||||
data-prototype-name="__audience__">
|
||||
{{ form_errors(form.audiences) }}
|
||||
<p class="text-muted program-collection-empty{% if form.audiences|length > 0 %} hide{% endif %}">
|
||||
{{ 'mt3s.marketing_program.audience.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group program-collection-list">
|
||||
{% for audience in form.audiences %}
|
||||
{{ _self.audience_row(audience) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<button type="button" class="btn btn-ghost program-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mt3s.marketing_program.audience.add'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
{% do form.audiences.setRendered %}
|
||||
</div>
|
||||
|
||||
{# Tasks: read-only here, so that following a link doesn't drop unsaved changes to the plan. #}
|
||||
<div class="tab-pane bdr-w-0" id="program-tab-tasks" role="tabpanel">
|
||||
{% if entity.id %}
|
||||
<p class="text-muted small">{{ 'mt3s.marketing_program.task.manage_from_program_page'|trans }}</p>
|
||||
{% endif %}
|
||||
{{ include('@MT3SMarketingProgram/Program/_task_table.html.twig', {
|
||||
'program': entity,
|
||||
'taskTree': taskTree|default([]),
|
||||
'readOnly': true,
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,151 @@
|
||||
{% set isIndex = 'index' == tmpl ? true : false %}
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}program{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mt3s.marketing_program.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['mt3smarketingprogram:programs:create'],
|
||||
},
|
||||
'routeBase': 'program',
|
||||
'langVar': 'program',
|
||||
},
|
||||
'bulk_actions': {
|
||||
'langVar': 'program',
|
||||
'routeBase': 'program',
|
||||
'templateButtons': {
|
||||
'delete': permissions['mt3smarketingprogram:programs:deleteown'] or permissions['mt3smarketingprogram:programs:deleteother'],
|
||||
},
|
||||
},
|
||||
}) -}}
|
||||
<div class="page-list">
|
||||
{% if items is defined and items is not empty %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover" id="programTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'checkall': 'true',
|
||||
'target': '#programTable',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'program',
|
||||
'orderBy': 'p.name',
|
||||
'text': 'mt3s.marketing_program.field.name',
|
||||
'class': 'col-program-name',
|
||||
'default': true,
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'program',
|
||||
'orderBy': 'p.status',
|
||||
'text': 'mt3s.marketing_program.field.status',
|
||||
'class': 'col-program-status',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'program',
|
||||
'text': 'mt3s.marketing_program.field.owner',
|
||||
'class': 'visible-md visible-lg col-program-owner',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'program',
|
||||
'orderBy': 'p.startDate',
|
||||
'text': 'mt3s.marketing_program.field.start_date',
|
||||
'class': 'visible-md visible-lg col-program-start',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'program',
|
||||
'orderBy': 'p.endDate',
|
||||
'text': 'mt3s.marketing_program.field.end_date',
|
||||
'class': 'visible-md visible-lg col-program-end',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'program',
|
||||
'orderBy': 'p.budgetPlanned',
|
||||
'text': 'mt3s.marketing_program.field.budget_planned',
|
||||
'class': 'visible-md visible-lg col-program-budget text-right',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'program',
|
||||
'orderBy': 'p.id',
|
||||
'text': 'mautic.core.id',
|
||||
'class': 'visible-md visible-lg col-program-id',
|
||||
}) }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions['mt3smarketingprogram:programs:editown'], permissions['mt3smarketingprogram:programs:editother'], item.createdBy) %}
|
||||
<tr>
|
||||
<td>
|
||||
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': canEdit,
|
||||
'delete': securityHasEntityAccess(permissions['mt3smarketingprogram:programs:deleteown'], permissions['mt3smarketingprogram:programs:deleteother'], item.createdBy),
|
||||
},
|
||||
'routeBase': 'program',
|
||||
'langVar': 'program',
|
||||
}) -}}
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
{{- include('@MauticCore/Helper/publishstatus_icon.html.twig', {
|
||||
'item': item,
|
||||
'model': 'program',
|
||||
}) -}}
|
||||
<a href="{{ path('mt3s_marketing_program_action', {'objectAction': 'view', 'objectId': item.id}) }}" data-toggle="ajax">
|
||||
{{ item.name }}
|
||||
</a>
|
||||
{% if item.category %}
|
||||
<span class="label label-default">{{ item.category.title }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ item.status.labelKey|trans }}</td>
|
||||
<td class="visible-md visible-lg">
|
||||
{{ item.owner ? item.owner.name : 'mt3s.marketing_program.owner.none'|trans }}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">{{ item.startDate ? dateToDate(item.startDate) : '' }}</td>
|
||||
<td class="visible-md visible-lg">{{ item.endDate ? dateToDate(item.endDate) : '' }}</td>
|
||||
<td class="visible-md visible-lg text-right">
|
||||
{% if item.budgetPlanned is not null %}
|
||||
{{ mt3s_marketing_program_money(item.budgetPlanned) }} {{ mt3s_marketing_program_currency() }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">{{ item.id }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="panel-footer">
|
||||
{{- include('@MauticCore/Helper/pagination.html.twig', {
|
||||
'totalItems': totalItems,
|
||||
'page': page,
|
||||
'limit': limit,
|
||||
'baseUrl': path('mt3s_marketing_program_index'),
|
||||
'sessionVar': 'program',
|
||||
}) -}}
|
||||
</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': 'mt3s.marketing_program.onboarding.heading',
|
||||
'subheading': 'mt3s.marketing_program.onboarding.subheading',
|
||||
'copy': 'mt3s.marketing_program.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user