refactor(plugin): rename Plan to Program and add audience/UTM routes
Rename the Plan bundle to Program across config, routes, menus, and controllers (Plan -> Initiative), bump version to 0.16.0, and introduce new audience and UTM taxonomy routes and permissions to support the expanded Programs feature set.
This commit is contained in:
1 parent
8268fad886
commit
71ff11390b
121 files changed
+5011
-2874
No files matched your search
@@ -1,23 +1,23 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}planTask{% endblock %}
|
||||
{% block mauticContent %}programTask{% endblock %}
|
||||
|
||||
{% block headerTitle %}
|
||||
{% if entity.id %}
|
||||
{{ 'mautic.plan.task.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{{ 'mautic.program.task.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{% else %}
|
||||
{{ 'mautic.plan.task.header.new'|trans }}
|
||||
{{ 'mautic.program.task.header.new'|trans }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{# The dependencies and the RACI rows: the same editable, sortable rows as the plan form's
|
||||
collections. Adding, removing and reordering is handled by Assets/js/plan.js through the
|
||||
plan-collection-* classes. #}
|
||||
{# The dependencies and the RACI rows: the same editable, sortable rows as the initiative form's
|
||||
collections. Adding, removing and reordering is handled by Assets/js/program.js through the
|
||||
initiative-collection-* classes. #}
|
||||
{% macro dependency_row(dependency) %}
|
||||
<li class="plan-collection-row list-group-item">
|
||||
<li class="initiative-collection-row list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-1 text-center">
|
||||
<span class="plan-collection-handle text-muted" title="{{ 'mautic.plan.task.dependency.drag'|trans }}" style="cursor: move;">
|
||||
<span class="initiative-collection-handle text-muted" title="{{ 'mautic.program.task.dependency.drag'|trans }}" style="cursor: move;">
|
||||
<i class="ri-draggable ri-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
@@ -29,7 +29,7 @@
|
||||
{{ form_widget(dependency.position) }}
|
||||
</div>
|
||||
<div class="col-xs-1 text-right">
|
||||
<button type="button" class="btn btn-ghost btn-sm plan-collection-remove" title="{{ 'mautic.plan.task.dependency.remove'|trans }}">
|
||||
<button type="button" class="btn btn-ghost btn-sm initiative-collection-remove" title="{{ 'mautic.program.task.dependency.remove'|trans }}">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -38,10 +38,10 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro raci_row(raci) %}
|
||||
<li class="plan-collection-row list-group-item">
|
||||
<li class="initiative-collection-row list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-xs-1 text-center">
|
||||
<span class="plan-collection-handle text-muted" title="{{ 'mautic.plan.task.raci.drag'|trans }}" style="cursor: move;">
|
||||
<span class="initiative-collection-handle text-muted" title="{{ 'mautic.program.task.raci.drag'|trans }}" style="cursor: move;">
|
||||
<i class="ri-draggable ri-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
@@ -53,7 +53,7 @@
|
||||
{{ form_widget(raci.position) }}
|
||||
</div>
|
||||
<div class="col-xs-1 text-right">
|
||||
<button type="button" class="btn btn-ghost btn-sm plan-collection-remove" title="{{ 'mautic.plan.task.raci.remove'|trans }}">
|
||||
<button type="button" class="btn btn-ghost btn-sm initiative-collection-remove" title="{{ 'mautic.program.task.raci.remove'|trans }}">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -68,14 +68,14 @@
|
||||
<div class="pa-md">
|
||||
{{ form_row(form.name) }}
|
||||
<div class="row">
|
||||
{# The selected type's pictogram; updated by plan.js when the type changes. #}
|
||||
{# The selected type's pictogram; updated by program.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>
|
||||
<i class="initiative-item-type-icon {{ program_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>
|
||||
{# Filled with the selected type's description by program.js. #}
|
||||
<p class="help-block initiative-item-type-help">{{ program_item_type_description('task', form.type.vars.value) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(form.description) }}
|
||||
@@ -84,7 +84,7 @@
|
||||
</div>
|
||||
<div class="col-md-3 height-auto">
|
||||
<div class="pr-lg pl-lg pt-md pb-md">
|
||||
{{ form_row(form.plan) }}
|
||||
{{ form_row(form.initiative) }}
|
||||
{{ form_row(form.taskKind) }}
|
||||
{{ form_row(form.startDate) }}
|
||||
{{ form_row(form.endDate) }}
|
||||
@@ -92,7 +92,7 @@
|
||||
{{ form_row(form.status) }}
|
||||
{% else %}
|
||||
{# A phase has no status of its own: its state comes from its tasks. #}
|
||||
<p class="text-muted small">{{ 'mautic.plan.task.kind.phase_status_note'|trans }}</p>
|
||||
<p class="text-muted small">{{ 'mautic.program.task.kind.phase_status_note'|trans }}</p>
|
||||
{% endif %}
|
||||
{{ form_row(form.plannedWork) }}
|
||||
</div>
|
||||
@@ -100,42 +100,42 @@
|
||||
</div>
|
||||
<div class="pa-md">
|
||||
<div class="col-md-12">
|
||||
{# Dependencies: several edges, each another task of the plan with the relation type. #}
|
||||
<div class="plan-collection plan-task-dependencies"
|
||||
{# Dependencies: several edges, each another task of the initiative with the relation type. #}
|
||||
<div class="initiative-collection initiative-task-dependencies"
|
||||
data-prototype="{{ _self.dependency_row(form.dependencies.vars.prototype)|e('html_attr') }}"
|
||||
data-prototype-name="__dependency__">
|
||||
<h4 class="mt-lg mb-sm">{{ 'mautic.plan.task.field.dependencies'|trans }}</h4>
|
||||
<h4 class="mt-lg mb-sm">{{ 'mautic.program.task.field.dependencies'|trans }}</h4>
|
||||
{{ form_errors(form.dependencies) }}
|
||||
<p class="text-muted plan-collection-empty{% if form.dependencies|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.plan.task.dependency.empty'|trans }}
|
||||
<p class="text-muted initiative-collection-empty{% if form.dependencies|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.program.task.dependency.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group plan-collection-list">
|
||||
<ul class="list-group initiative-collection-list">
|
||||
{% for dependency in form.dependencies %}
|
||||
{{ _self.dependency_row(dependency) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<button type="button" class="btn btn-ghost plan-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.plan.task.dependency.add'|trans }}
|
||||
<button type="button" class="btn btn-ghost initiative-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.task.dependency.add'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
{% do form.dependencies.setRendered %}
|
||||
|
||||
{# RACI: one row per role, several stakeholders per role, picked from the plan's. #}
|
||||
<div class="plan-collection plan-task-raci"
|
||||
{# RACI: one row per role, several stakeholders per role, picked from the initiative's. #}
|
||||
<div class="initiative-collection initiative-task-raci"
|
||||
data-prototype="{{ _self.raci_row(form.raci.vars.prototype)|e('html_attr') }}"
|
||||
data-prototype-name="__raci__">
|
||||
<h4 class="mt-lg mb-sm">{{ 'mautic.plan.task.field.raci'|trans }}</h4>
|
||||
<h4 class="mt-lg mb-sm">{{ 'mautic.program.task.field.raci'|trans }}</h4>
|
||||
{{ form_errors(form.raci) }}
|
||||
<p class="text-muted plan-collection-empty{% if form.raci|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.plan.task.raci.empty'|trans }}
|
||||
<p class="text-muted initiative-collection-empty{% if form.raci|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.program.task.raci.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group plan-collection-list">
|
||||
<ul class="list-group initiative-collection-list">
|
||||
{% for raci in form.raci %}
|
||||
{{ _self.raci_row(raci) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<button type="button" class="btn btn-ghost plan-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.plan.task.raci.add'|trans }}
|
||||
<button type="button" class="btn btn-ghost initiative-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.task.raci.add'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
{% do form.raci.setRendered %}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}planTask{% endblock %}
|
||||
{% block mauticContent %}programTask{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mautic.plan.task.header.index'|trans }}{% endblock %}
|
||||
{% block headerTitle %}{{ 'mautic.program.task.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">
|
||||
@@ -13,118 +13,118 @@
|
||||
'action': currentRoute,
|
||||
'page_actions': {
|
||||
'templateButtons': {
|
||||
'new': permissions['plan:tasks:create'],
|
||||
'new': permissions['program:tasks:create'],
|
||||
},
|
||||
'langVar': 'plan.task',
|
||||
'langVar': 'initiative.task',
|
||||
},
|
||||
'bulk_actions': {
|
||||
'langVar': 'plan.task',
|
||||
'langVar': 'initiative.task',
|
||||
'templateButtons': {
|
||||
'delete': permissions['plan:tasks:deleteown'] or permissions['plan:tasks:deleteother'],
|
||||
'delete': permissions['program:tasks:deleteown'] or permissions['program:tasks:deleteother'],
|
||||
},
|
||||
},
|
||||
}) -}}
|
||||
<div class="page-list">
|
||||
{% if items is defined and items is not empty %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover" id="planTaskTable">
|
||||
<table class="table table-hover" id="programTaskTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'checkall': 'true',
|
||||
'target': '#planTaskTable',
|
||||
'target': '#programTaskTable',
|
||||
}) }}
|
||||
{# Columns: ID, Pictogram, Type, Name, Description, Start date, End date, Status. #}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'sessionVar': 'initiative.task',
|
||||
'orderBy': 't.id',
|
||||
'text': 'mautic.core.id',
|
||||
'class': 'col-plan-task-id',
|
||||
'class': 'col-initiative-task-id',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'text': 'mautic.plan.task.field.pictogram',
|
||||
'class': 'col-plan-task-pictogram',
|
||||
'sessionVar': 'initiative.task',
|
||||
'text': 'mautic.program.task.field.pictogram',
|
||||
'class': 'col-initiative-task-pictogram',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'sessionVar': 'initiative.task',
|
||||
'orderBy': 't.type',
|
||||
'text': 'mautic.plan.task.field.type',
|
||||
'class': 'col-plan-task-type',
|
||||
'text': 'mautic.program.task.field.type',
|
||||
'class': 'col-initiative-task-type',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'sessionVar': 'initiative.task',
|
||||
'orderBy': 't.name',
|
||||
'text': 'mautic.plan.task.field.name',
|
||||
'class': 'col-plan-task-name',
|
||||
'text': 'mautic.program.task.field.name',
|
||||
'class': 'col-initiative-task-name',
|
||||
'default': true,
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'text': 'mautic.plan.task.field.description',
|
||||
'class': 'visible-md visible-lg col-plan-task-description',
|
||||
'sessionVar': 'initiative.task',
|
||||
'text': 'mautic.program.task.field.description',
|
||||
'class': 'visible-md visible-lg col-initiative-task-description',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'sessionVar': 'initiative.task',
|
||||
'orderBy': 't.startDate',
|
||||
'text': 'mautic.plan.task.field.start_date',
|
||||
'class': 'col-plan-task-start',
|
||||
'text': 'mautic.program.task.field.start_date',
|
||||
'class': 'col-initiative-task-start',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'sessionVar': 'initiative.task',
|
||||
'orderBy': 't.endDate',
|
||||
'text': 'mautic.plan.task.field.end_date',
|
||||
'class': 'col-plan-task-end',
|
||||
'text': 'mautic.program.task.field.end_date',
|
||||
'class': 'col-initiative-task-end',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.task',
|
||||
'sessionVar': 'initiative.task',
|
||||
'orderBy': 't.status',
|
||||
'text': 'mautic.plan.task.field.status',
|
||||
'class': 'col-plan-task-status',
|
||||
'text': 'mautic.program.task.field.status',
|
||||
'class': 'col-initiative-task-status',
|
||||
}) }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions['plan:tasks:editown'], permissions['plan:tasks:editother'], item.createdBy) %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions['program:tasks:editown'], permissions['program:tasks:editother'], item.createdBy) %}
|
||||
<tr>
|
||||
<td>
|
||||
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': canEdit,
|
||||
'delete': securityHasEntityAccess(permissions['plan:tasks:deleteown'], permissions['plan:tasks:deleteother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['program:tasks:deleteown'], permissions['program:tasks:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'plan.task',
|
||||
'langVar': 'initiative.task',
|
||||
}) -}}
|
||||
</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 %}
|
||||
{% set typeIcon = program_item_type_icon('task', item.type) %}
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-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{% if program_item_type_description('task', item.type) %} title="{{ program_item_type_description('task', item.type) }}"{% endif %}>
|
||||
{{ program_item_type_name('task', item.type) ?? 'mautic.program.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>
|
||||
<a href="{{ path('initiative_task_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">
|
||||
{% set description = item.description|default('')|striptags|trim %}
|
||||
{{ (description|length > 120 ? description|slice(0, 120) ~ '…' : description)|plan_linkify }}
|
||||
{{ (description|length > 120 ? description|slice(0, 120) ~ '…' : description)|program_linkify }}
|
||||
</td>
|
||||
<td>{{ item.startDate ? item.startDate|date('Y-m-d') : '' }}</td>
|
||||
<td>{{ item.endDate ? item.endDate|date('Y-m-d') : '' }}</td>
|
||||
<td>
|
||||
{# A phase has no status of its own: its state comes from its tasks. #}
|
||||
{% if item.taskKind != constant('MauticPlugin\\PlanBundle\\Entity\\TaskKind::Phase') %}
|
||||
{% if item.taskKind != constant('MauticPlugin\\ProgramBundle\\Entity\\TaskKind::Phase') %}
|
||||
<span class="label {{ item.status.labelClass }}">{{ item.status.labelKey|trans }}</span>
|
||||
{% else %}
|
||||
<span class="label label-primary">{{ 'mautic.plan.task.kind.phase_short'|trans }}</span>
|
||||
<span class="label label-primary">{{ 'mautic.program.task.kind.phase_short'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -136,8 +136,8 @@
|
||||
'totalItems': totalItems,
|
||||
'page': page,
|
||||
'limit': limit,
|
||||
'baseUrl': path('plan_task_index'),
|
||||
'sessionVar': 'plan.task',
|
||||
'baseUrl': path('initiative_task_index'),
|
||||
'sessionVar': 'initiative.task',
|
||||
}) -}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,9 +146,9 @@
|
||||
{% 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.task.onboarding.heading',
|
||||
'subheading': 'mautic.plan.task.onboarding.subheading',
|
||||
'copy': 'mautic.plan.task.onboarding.copy',
|
||||
'heading': 'mautic.program.task.onboarding.heading',
|
||||
'subheading': 'mautic.program.task.onboarding.subheading',
|
||||
'copy': 'mautic.program.task.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in new issue
Block a user