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
@@ -0,0 +1,164 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}programAudience{% endblock %}
|
||||
|
||||
{% block preHeader %}
|
||||
<div class="pull-right">
|
||||
{{ include('@MauticCore/Helper/page_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': securityHasEntityAccess(permissions['program:audiences:editown'], permissions['program:audiences:editother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['program:audiences:deleteown'], permissions['program:audiences:deleteother'], item.createdBy),
|
||||
},
|
||||
'actionRoute': 'initiative_audience_action',
|
||||
'indexRoute': 'initiative_audience_index',
|
||||
'langVar': 'initiative.audience',
|
||||
}) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ item.name }}{% endblock %}
|
||||
|
||||
{% block publishStatus %}
|
||||
<div class="col-xs-0 col-sm-3 text-right pr-0">
|
||||
<span class="label {{ item.isPublished ? 'label-success' : 'label-gray' }}">
|
||||
{{ (item.isPublished ? 'mautic.program.audience.active' : 'mautic.program.audience.inactive')|trans }}
|
||||
</span>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="pa-md">
|
||||
<table class="table table-hover mb-md initiative-audience-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted" style="width: 30%;">{{ 'mautic.program.audience.field.type'|trans }}</td>
|
||||
<td>
|
||||
<i class="{{ item.audienceType.icon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>
|
||||
{{ item.audienceType.labelKey|trans }}
|
||||
</td>
|
||||
</tr>
|
||||
{% if item.segments is not empty %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.segments'|trans }}</td>
|
||||
<td>
|
||||
{% for segment in item.segments %}
|
||||
<span class="label label-info">{{ segment.name }} ({{ program_audience_segment_count(segment.id) }})</span>{% if not loop.last %} {% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.tagline %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.tagline'|trans }}</td>
|
||||
<td>{{ item.tagline|program_linkify }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.profileCriteria %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.profile_criteria'|trans }}</td>
|
||||
<td style="white-space: pre-wrap;">{{ item.profileCriteria|program_linkify }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.motivations %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.motivations'|trans }}</td>
|
||||
<td style="white-space: pre-wrap;">{{ item.motivations|program_linkify }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.barriers %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.barriers'|trans }}</td>
|
||||
<td style="white-space: pre-wrap;">{{ item.barriers|program_linkify }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.frustrations %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.frustrations'|trans }}</td>
|
||||
<td style="white-space: pre-wrap;">{{ item.frustrations|program_linkify }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.triggers %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.triggers'|trans }}</td>
|
||||
<td style="white-space: pre-wrap;">{{ item.triggers|program_linkify }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.decisionRole %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.decision_role'|trans }}</td>
|
||||
<td>{{ program_audience_decision_role_label(item.decisionRole) ?? item.decisionRole }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.preferredTones is not empty %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.preferred_tones'|trans }}</td>
|
||||
<td>
|
||||
{% for tone in item.preferredTones %}
|
||||
<span class="label label-default">{{ program_audience_tone_label(tone) ?? tone }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.preferredChannels is not empty %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.preferred_channels'|trans }}</td>
|
||||
<td>
|
||||
{% for channel in item.preferredChannels %}
|
||||
<span class="label label-default">{{ program_audience_channel_label(channel)|trans }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.stages is not empty %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.stages'|trans }}</td>
|
||||
<td>{{ item.stages|map(stage => stage.name)|join(', ') }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.estimatedSize %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.audience.field.estimated_size'|trans }}</td>
|
||||
<td>{{ item.estimatedSize }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<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.program.audience.field.plans'|trans }}</h4>
|
||||
{% if item.initiativeLinks is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.audience.no_plans'|trans }}</p>
|
||||
{% else %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-audience-initiatives-view">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'mautic.program.field.name'|trans }}</th>
|
||||
<th>{{ 'mautic.program.audience.field.priority'|trans }}</th>
|
||||
<th>{{ 'mautic.program.audience.field.value_proposition'|trans }}</th>
|
||||
<th>{{ 'mautic.program.field.status'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in item.initiativeLinks %}
|
||||
<tr>
|
||||
<td><a href="{{ path('initiative_action', {'objectAction': 'view', 'objectId': link.initiative.id}) }}" data-toggle="ajax">{{ link.initiative.name }}</a></td>
|
||||
<td><span class="label {{ link.priority.labelClass }}">{{ link.priority.labelKey|trans }}</span></td>
|
||||
<td class="text-muted">{{ link.valueProposition|default('—') }}</td>
|
||||
<td><span class="label {{ link.initiative.status.labelClass }}">{{ link.initiative.status.labelKey|trans }}</span></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,53 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}programAudience{% endblock %}
|
||||
|
||||
{% block headerTitle %}
|
||||
{% if entity.id %}
|
||||
{{ 'mautic.program.audience.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{% else %}
|
||||
{{ 'mautic.program.audience.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, fixed per type; programAudienceOnLoad updates it
|
||||
when the dropdown changes. A new form defaults to Persona. #}
|
||||
<div class="col-xs-1 text-center pt-lg">
|
||||
<i class="{{ (entity.audienceType ?? constant('MauticPlugin\\ProgramBundle\\Entity\\AudienceType::Persona'))|program_audience_type_icon }} initiative-item-type-icon" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-xs-11">
|
||||
{{ form_row(form.audienceType) }}
|
||||
<p class="text-muted small">{{ 'mautic.program.audience.type.fixed_note'|trans }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(form.segments) }}
|
||||
<p class="text-muted small">{{ 'mautic.program.audience.segments.note'|trans }}</p>
|
||||
{% if form.tagline is defined %}{{ form_row(form.tagline) }}{% endif %}
|
||||
{% if form.profileCriteria is defined %}{{ form_row(form.profileCriteria) }}{% endif %}
|
||||
{% if form.motivations is defined %}{{ form_row(form.motivations) }}{% endif %}
|
||||
{% if form.barriers is defined %}{{ form_row(form.barriers) }}{% endif %}
|
||||
{% if form.frustrations is defined %}{{ form_row(form.frustrations) }}{% endif %}
|
||||
{% if form.triggers is defined %}{{ form_row(form.triggers) }}{% endif %}
|
||||
{% if form.decisionRole is defined %}{{ form_row(form.decisionRole) }}{% endif %}
|
||||
{% if form.preferredTones is defined %}{{ form_row(form.preferredTones) }}{% endif %}
|
||||
{% if form.preferredChannels is defined %}{{ form_row(form.preferredChannels) }}{% endif %}
|
||||
{% if form.stages is defined %}{{ form_row(form.stages) }}{% endif %}
|
||||
{% if form.estimatedSize is defined %}{{ form_row(form.estimatedSize) }}{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 height-auto">
|
||||
<div class="pr-lg pl-lg pt-md pb-md">
|
||||
{{ form_row(form.isPublished) }}
|
||||
<p class="text-muted small">{{ 'mautic.program.audience.active.help'|trans }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,165 @@
|
||||
{% set isIndex = 'index' == tmpl ? true : false %}
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}programAudience{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mautic.program.audience.header.index'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set segmentCounts = program_audience_segment_counts(items) %}
|
||||
<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['program:audiences:create'],
|
||||
},
|
||||
'langVar': 'initiative.audience',
|
||||
},
|
||||
'bulk_actions': {
|
||||
'langVar': 'initiative.audience',
|
||||
'templateButtons': {
|
||||
'delete': permissions['program:audiences:deleteown'] or permissions['program:audiences:deleteother'],
|
||||
},
|
||||
},
|
||||
}) -}}
|
||||
<div class="page-list">
|
||||
{% if items is defined and items is not empty %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover" id="programAudienceTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'checkall': 'true',
|
||||
'target': '#programAudienceTable',
|
||||
}) }}
|
||||
{# Columns: ID, Pictogram, Type, Name (+ tagline), Segments (with contact
|
||||
counts), Estimated size, Active, Assigned initiatives. #}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'initiative.audience',
|
||||
'orderBy': 't.id',
|
||||
'text': 'mautic.core.id',
|
||||
'class': 'col-initiative-audience-id',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'initiative.audience',
|
||||
'text': 'mautic.program.audience.field.pictogram',
|
||||
'class': 'col-initiative-audience-pictogram',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'initiative.audience',
|
||||
'orderBy': 't.audienceType',
|
||||
'text': 'mautic.program.audience.field.type',
|
||||
'class': 'col-initiative-audience-type',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'initiative.audience',
|
||||
'orderBy': 't.name',
|
||||
'text': 'mautic.program.audience.field.name',
|
||||
'class': 'col-initiative-audience-name',
|
||||
'default': true,
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'initiative.audience',
|
||||
'text': 'mautic.program.audience.field.segments',
|
||||
'class': 'visible-md visible-lg col-initiative-audience-segments',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'initiative.audience',
|
||||
'text': 'mautic.program.audience.field.estimated_size',
|
||||
'class': 'visible-md visible-lg col-initiative-audience-size',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'initiative.audience',
|
||||
'orderBy': 't.isPublished',
|
||||
'text': 'mautic.program.audience.field.active',
|
||||
'class': 'col-initiative-audience-active',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'initiative.audience',
|
||||
'text': 'mautic.program.audience.field.plans',
|
||||
'class': 'visible-md visible-lg col-initiative-audience-initiatives',
|
||||
}) }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions['program:audiences:editown'], permissions['program:audiences:editother'], item.createdBy) %}
|
||||
<tr>
|
||||
<td>
|
||||
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': canEdit,
|
||||
'delete': securityHasEntityAccess(permissions['program:audiences:deleteown'], permissions['program:audiences:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'initiative.audience',
|
||||
}) -}}
|
||||
</td>
|
||||
<td>{{ item.id }}</td>
|
||||
<td class="text-center">
|
||||
<i class="{{ item.audienceType.icon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>
|
||||
</td>
|
||||
<td>{{ item.audienceType.labelKey|trans }}</td>
|
||||
<td>
|
||||
{% if canEdit %}
|
||||
<a href="{{ path('initiative_audience_action', {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{% if item.tagline %}{{ item.name }} <span class="text-muted small font-lato">— {{ item.tagline }}</span>{% else %}{{ item.name }}{% endif %}</a>
|
||||
{% else %}
|
||||
{{ item.name }}{% if item.tagline %} <span class="text-muted small font-lato">— {{ item.tagline }}</span>{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">
|
||||
{# The segments this audience maps to, purely informational: names with
|
||||
their contact counts next to them. May be none. #}
|
||||
{% set counts = segmentCounts[item.id] ?? [] %}
|
||||
{% for segment in item.segments %}
|
||||
<span class="label label-info">{{ segment.name }} ({{ counts[segment.id] ?? 0 }})</span>{% if not loop.last %} {% endif %}
|
||||
{% else %}
|
||||
<span class="text-muted">—</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td class="visible-md visible-lg text-right text-nowrap">{{ item.estimatedSize }}</td>
|
||||
<td>
|
||||
<span class="label {{ item.isPublished ? 'label-success' : 'label-gray' }}">
|
||||
{{ (item.isPublished ? 'mautic.program.audience.active' : 'mautic.program.audience.inactive')|trans }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="visible-md visible-lg">
|
||||
{# The initiatives this audience is assigned to, through their Audiences tab. #}
|
||||
{% set links = item.initiativeLinks|default([]) %}
|
||||
{% for link in links %}
|
||||
<a href="{{ path('initiative_action', {'objectAction': 'view', 'objectId': link.initiative.id}) }}" data-toggle="ajax">{{ link.initiative.name }}</a>{% if link.valueProposition %} <span class="text-muted small">({{ link.valueProposition }})</span>{% endif %}{% if not loop.last %}, {% endif %}
|
||||
{% else %}
|
||||
<span class="text-muted">{{ 'mautic.program.audience.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('initiative_audience_index'),
|
||||
'sessionVar': 'initiative.audience',
|
||||
}) -}}
|
||||
</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.program.audience.onboarding.heading',
|
||||
'subheading': 'mautic.program.audience.onboarding.subheading',
|
||||
'copy': 'mautic.program.audience.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,110 +0,0 @@
|
||||
{#
|
||||
# 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) %}
|
||||
<div class="panel panel-default plan-config-type">
|
||||
<div class="panel-body">
|
||||
{{ form_widget(type.children.key) }}
|
||||
{{ form_errors(type) }}
|
||||
{% if type.children.icon is defined %}
|
||||
{% set icon = type.children.icon.vars.value %}
|
||||
<div class="row mb-sm">
|
||||
<div class="col-xs-1 text-center pt-lg">
|
||||
<i class="plan-type-icon-preview {{ icon }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-xs-5">{{ form_row(type.children.icon) }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<table class="table table-condensed mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2">{{ 'mautic.plan.config.type.language'|trans }}</th>
|
||||
<th class="col-xs-4">{{ 'mautic.plan.config.type.name'|trans }}</th>
|
||||
<th class="col-xs-6">{{ 'mautic.plan.config.type.description'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for locale, name in type.children.names.children %}
|
||||
<tr>
|
||||
<td class="text-muted" title="{{ name.vars.attr['data-locale'] }}">
|
||||
{{ name.vars.attr['data-language'] }}
|
||||
{% if name.vars.required %}<span class="required">*</span>{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ form_widget(name) }}
|
||||
{{ form_errors(name) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ form_widget(type.children.descriptions.children[locale]) }}
|
||||
{{ form_errors(type.children.descriptions.children[locale]) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="text-right mt-xs">
|
||||
<button type="button" class="btn btn-ghost btn-sm plan-config-type-remove">
|
||||
<i class="ri-delete-bin-line"></i> {{ 'mautic.plan.config.type.remove'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{# One editable list of types (one per kind of plan item). #}
|
||||
{% macro type_section(types, titleKey, helpKey) %}
|
||||
{% import _self as plan %}
|
||||
<h4 class="fw-sb mt-lg mb-xs">{{ titleKey|trans }}</h4>
|
||||
<p class="text-muted small">{{ helpKey|trans }}</p>
|
||||
{{ form_errors(types) }}
|
||||
<div class="plan-config-types" data-prototype="{{ plan.type_row(types.vars.prototype)|e('html_attr') }}">
|
||||
<p class="text-muted plan-config-types-empty{% if types|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.plan.config.types.empty'|trans }}
|
||||
</p>
|
||||
<div class="plan-config-types-list">
|
||||
{% for type in types %}
|
||||
{{ plan.type_row(type) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<button type="button" class="btn btn-ghost plan-config-type-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.plan.config.type.add'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
{% do types.setRendered %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block _config_planconfig_widget %}
|
||||
{% import _self as plan %}
|
||||
<div class="text-muted small pb-md">{{ 'mautic.plan.config.description'|trans }}</div>
|
||||
|
||||
<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>
|
||||
|
||||
{{ plan.type_section(form.children.plan_description_item_types,
|
||||
'mautic.plan.config.section.description_item_types',
|
||||
'mautic.plan.config.section.description_item_types.help') }}
|
||||
|
||||
{{ 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,128 @@
|
||||
{#
|
||||
# Settings > Configuration > Program Settings: the general currency, then one section per kind of initiative
|
||||
# item (insights, allocation, objectives, tasks), each with a pictogram. Adding and removing
|
||||
# types, and the pictogram preview, are handled by Assets/js/program.js (delegated handlers on
|
||||
# .program-config-types).
|
||||
#}
|
||||
|
||||
{% macro type_row(type) %}
|
||||
<div class="panel panel-default program-config-type">
|
||||
<div class="panel-body">
|
||||
{{ form_widget(type.children.key) }}
|
||||
{{ form_errors(type) }}
|
||||
{% if type.children.icon is defined %}
|
||||
{% set icon = type.children.icon.vars.value %}
|
||||
<div class="row mb-sm">
|
||||
<div class="col-xs-1 text-center pt-lg">
|
||||
<i class="initiative-type-icon-preview {{ icon }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-xs-5">{{ form_row(type.children.icon) }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<table class="table table-condensed mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2">{{ 'mautic.program.config.type.language'|trans }}</th>
|
||||
<th class="col-xs-4">{{ 'mautic.program.config.type.name'|trans }}</th>
|
||||
<th class="col-xs-6">{{ 'mautic.program.config.type.description'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for locale, name in type.children.names.children %}
|
||||
<tr>
|
||||
<td class="text-muted" title="{{ name.vars.attr['data-locale'] }}">
|
||||
{{ name.vars.attr['data-language'] }}
|
||||
{% if name.vars.required %}<span class="required">*</span>{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ form_widget(name) }}
|
||||
{{ form_errors(name) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ form_widget(type.children.descriptions.children[locale]) }}
|
||||
{{ form_errors(type.children.descriptions.children[locale]) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="text-right mt-xs">
|
||||
<button type="button" class="btn btn-ghost btn-sm program-config-type-remove">
|
||||
<i class="ri-delete-bin-line"></i> {{ 'mautic.program.config.type.remove'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{# One editable list of types (one per kind of initiative item). #}
|
||||
{% macro type_section(types, titleKey, helpKey) %}
|
||||
{% import _self as cfg %}
|
||||
<h4 class="fw-sb mt-lg mb-xs">{{ titleKey|trans }}</h4>
|
||||
<p class="text-muted small">{{ helpKey|trans }}</p>
|
||||
{{ form_errors(types) }}
|
||||
<div class="program-config-types" data-prototype="{{ cfg.type_row(types.vars.prototype)|e('html_attr') }}">
|
||||
<p class="text-muted program-config-types-empty{% if types|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.program.config.types.empty'|trans }}
|
||||
</p>
|
||||
<div class="program-config-types-list">
|
||||
{% for type in types %}
|
||||
{{ cfg.type_row(type) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<button type="button" class="btn btn-ghost program-config-type-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.config.type.add'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
{% do types.setRendered %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block _config_programconfig_widget %}
|
||||
{% import _self as cfg %}
|
||||
<div class="text-muted small pb-md">{{ 'mautic.program.config.description'|trans }}</div>
|
||||
|
||||
<h4 class="fw-sb mb-xs">{{ 'mautic.program.config.section.general'|trans }}</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-6">{{ form_row(form.children.program_currency) }}</div>
|
||||
<div class="col-md-6">{{ form_row(form.children.program_stakeholder_phone_region) }}</div>
|
||||
</div>
|
||||
<p class="text-muted small">{{ 'mautic.program.config.currency.help'|trans }}</p>
|
||||
|
||||
{{ cfg.type_section(form.children.program_description_item_types,
|
||||
'mautic.program.config.section.description_item_types',
|
||||
'mautic.program.config.section.description_item_types.help') }}
|
||||
|
||||
{{ cfg.type_section(form.children.program_allocation_item_types,
|
||||
'mautic.program.config.section.allocation_item_types',
|
||||
'mautic.program.config.section.allocation_item_types.help') }}
|
||||
|
||||
{{ cfg.type_section(form.children.program_objective_types,
|
||||
'mautic.program.config.section.objective_types',
|
||||
'mautic.program.config.section.objective_types.help') }}
|
||||
|
||||
{{ cfg.type_section(form.children.program_task_types,
|
||||
'mautic.program.config.section.task_types',
|
||||
'mautic.program.config.section.task_types.help') }}
|
||||
|
||||
{{ cfg.type_section(form.children.program_stakeholder_types,
|
||||
'mautic.program.config.section.stakeholder_types',
|
||||
'mautic.program.config.section.stakeholder_types.help') }}
|
||||
|
||||
<h4 class="fw-sb mt-lg mb-xs">{{ 'mautic.program.config.section.audience_values'|trans }}</h4>
|
||||
<p class="text-muted small">{{ 'mautic.program.config.section.audience_values.help'|trans }}</p>
|
||||
{{ cfg.type_section(form.children.program_audience_decision_roles,
|
||||
'mautic.program.config.section.audience_decision_roles',
|
||||
'mautic.program.config.section.audience_decision_roles.help') }}
|
||||
|
||||
{{ cfg.type_section(form.children.program_audience_tones,
|
||||
'mautic.program.config.section.audience_tones',
|
||||
'mautic.program.config.section.audience_tones.help') }}
|
||||
|
||||
<h4 class="fw-sb mt-lg mb-xs">{{ 'mautic.program.config.section.audience_attributes'|trans }}</h4>
|
||||
<p class="text-muted small">{{ 'mautic.program.config.section.audience_attributes.help'|trans }}</p>
|
||||
<div class="program-config-audience-attributes">
|
||||
{% for attribute in program_audience_attributes() %}
|
||||
{{ form_row(form.children[program_audience_attribute_toggle(attribute)]) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
+7
-7
@@ -4,21 +4,21 @@
|
||||
# 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)
|
||||
# text: the text to show (may contain line breaks; URLs in it become links, see 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="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"
|
||||
<div class="initiative-read-more" id="{{ id }}">
|
||||
<div class="initiative-read-more-text" style="display: -webkit-box; -webkit-line-clamp: {{ lines }}; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap;">{{ text|program_linkify }}</div>
|
||||
<button type="button" class="btn btn-link btn-xs p-0 initiative-read-more-toggle"
|
||||
data-target="{{ id }}"
|
||||
data-more-text="{{ 'mautic.plan.read_more.more'|trans }}"
|
||||
data-less-text="{{ 'mautic.plan.read_more.less'|trans }}"
|
||||
data-more-text="{{ 'mautic.program.read_more.more'|trans }}"
|
||||
data-less-text="{{ 'mautic.program.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>
|
||||
{{ 'mautic.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 initiative tab table (Description, Objectives, Allocation, Tasks) and the switch that
|
||||
# shows the "no match" message. Filtering and sorting are handled by Assets/js/program.js
|
||||
# (Mautic.programInitTabTable), on any table with the data-initiative-tab-table attribute.
|
||||
#}
|
||||
<div class="initiative-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 initiative-tab-table-filter-input"
|
||||
placeholder="{{ 'mautic.program.filter.placeholder'|trans }}" aria-label="{{ 'mautic.program.filter.placeholder'|trans }}">
|
||||
</div>
|
||||
<p class="text-muted initiative-tab-table-nomatch hide">{{ 'mautic.program.filter.no_match'|trans }}</p>
|
||||
@@ -0,0 +1,32 @@
|
||||
{#
|
||||
# Tab bar shared by the initiative form and the initiative detail page.
|
||||
#
|
||||
# Parameters:
|
||||
# initiativeId: the initiative's id (null for a new initiative)
|
||||
# counts (optional): tab id => number shown next to the tab name
|
||||
#
|
||||
# The tab panes use the ids initiative-tab-<id>. Assets/js/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 initiativeTabs = {
|
||||
'details': 'mautic.program.tab.details',
|
||||
'description': 'mautic.program.tab.description',
|
||||
'objectives': 'mautic.program.tab.objectives',
|
||||
'allocation': 'mautic.program.tab.allocations',
|
||||
'audiences': 'mautic.program.tab.audiences',
|
||||
'stakeholders': 'mautic.program.tab.stakeholders',
|
||||
'tasks': 'mautic.program.tab.tasks',
|
||||
} %}
|
||||
<ul class="nav nav-tabs nav-tabs-contained tabs-horizontal initiative-tabs" role="tablist" data-initiative-id="{{ initiativeId|default('') }}">
|
||||
{% for id, label in initiativeTabs %}
|
||||
<li class="{{ loop.first ? 'active' : '' }}" data-tab-id="initiative-tab-{{ id }}">
|
||||
<a href="#initiative-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 initiative's tasks, for the Tasks tab of the initiative 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:
|
||||
# initiative: the Initiative
|
||||
# taskTree: rows from TaskModel::getTaskTree(): {task, depth}, in display order
|
||||
# readOnly: true on the initiative form: no links, no filter, so that following one can't drop unsaved changes
|
||||
# taskPermissions: program:tasks:* permissions (create, editown, editother), when not read-only
|
||||
#
|
||||
# Links carry returnTo=initiative, so that Save and Cancel on the task form come back to this initiative 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 initiative.id and taskPermissions['program:tasks:create']|default(false) %}
|
||||
|
||||
{% if canCreate %}
|
||||
<div class="mb-md">
|
||||
<a class="btn btn-ghost initiative-task-add" href="{{ path('initiative_task_action', {'objectAction': 'new', 'initiative': initiative.id, 'returnTo': 'initiative'}) }}" data-toggle="ajax">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.task.add'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not initiative.id %}
|
||||
<p class="text-muted">{{ 'mautic.program.task.save_initiative_first'|trans }}</p>
|
||||
{% elseif taskTree is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.task.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{% if not readOnly %}
|
||||
{# Filter + click-to-sort on the detail page (program.js). The form's read-only copy stays plain. #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
{% endif %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-task-table{% if not readOnly %}" data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}{% endif %}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.task.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.task.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.task.field.name'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.task.field.description'|trans }}</th>
|
||||
<th class="initiative-col-date">{{ 'mautic.program.task.field.start_date'|trans }}</th>
|
||||
<th class="initiative-col-date">{{ 'mautic.program.task.field.end_date'|trans }}</th>
|
||||
<th class="initiative-col-status">{{ 'mautic.program.task.field.status'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in taskTree %}
|
||||
{% set task = row.task %}
|
||||
{% set canEdit = not readOnly and securityHasEntityAccess(taskPermissions['program:tasks:editown']|default(false), taskPermissions['program:tasks:editother']|default(false), task.createdBy) %}
|
||||
<tr class="initiative-task" data-task-id="{{ task.id }}">
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% set taskTypeIcon = program_item_type_icon('task', task.type) %}
|
||||
{% if taskTypeIcon %}<i class="{{ taskTypeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if program_item_type_description('task', task.type) %} title="{{ program_item_type_description('task', task.type) }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ program_item_type_name('task', task.type) ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': task.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-name">
|
||||
{% if canEdit %}
|
||||
<a href="{{ path('initiative_task_action', {'objectAction': 'edit', 'objectId': task.id, 'returnTo': 'initiative'}) }}" data-toggle="ajax">{{ task.name }}</a>
|
||||
{% else %}
|
||||
{{ task.name }}
|
||||
{% endif %}
|
||||
{% if task.taskKind == constant('MauticPlugin\\ProgramBundle\\Entity\\TaskKind::Milestone') %}
|
||||
<span class="label label-success" title="{{ 'mautic.program.task.kind.milestone'|trans }}">{{ 'mautic.program.task.kind.milestone_short'|trans }}</span>
|
||||
{% elseif task.taskKind == constant('MauticPlugin\\ProgramBundle\\Entity\\TaskKind::Phase') %}
|
||||
<span class="label label-primary" title="{{ 'mautic.program.task.kind.phase'|trans }}">{{ 'mautic.program.task.kind.phase_short'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-description text-muted">
|
||||
{# Same 10-line clamp and read-more as the Description tab; URLs become links. #}
|
||||
{{ include('@Program/Initiative/_description_read_more.html.twig', {
|
||||
'text': task.description|default('')|striptags,
|
||||
'id': 'initiative-task-desc-' ~ task.id,
|
||||
}) }}
|
||||
</td>
|
||||
<td class="initiative-col-date">{{ task.startDate ? task.startDate|date('Y-m-d') : '' }}</td>
|
||||
<td class="initiative-col-date">{{ task.endDate ? task.endDate|date('Y-m-d') : '' }}</td>
|
||||
<td class="initiative-col-status">
|
||||
{# A phase has no status of its own — skip the column value. #}
|
||||
{% if task.taskKind != constant('MauticPlugin\\ProgramBundle\\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_program_* route names.
|
||||
# The buttons use actionRoute (initiative_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('initiative_index'),
|
||||
'targetLabel': 'mautic.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': 'initiative-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: 'mautic.program.header.total_planned'|trans({'%amount%': program_money(totals.planned), '%currency%': program_currency()}),
|
||||
attributes: {'class': 'initiative-total-planned', 'title': 'mautic.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: 'mautic.program.header.total_real'|trans({'%amount%': program_money(totals.real), '%currency%': program_currency()}),
|
||||
attributes: {'class': 'initiative-total-real', 'title': (overPlan ? 'mautic.program.header.total_real.over' : 'mautic.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['program:initiatives:editown'], permissions['program:initiatives:editother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['program:initiatives:deleteown'], permissions['program:initiatives:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'initiative',
|
||||
}) -}}
|
||||
{% 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('@Program/Initiative/_tabs.html.twig', {'initiativeId': 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="initiative-tab-details" role="tabpanel">
|
||||
<table class="table table-hover mb-0 initiative-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.program.field.status'|trans }}</td>
|
||||
<td>{{ item.status.labelKey|trans }}</td>
|
||||
</tr>
|
||||
{% if item.completedAt %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.completed_at'|trans }}</td>
|
||||
<td>{{ dateToFull(item.completedAt) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.version'|trans }}</td>
|
||||
<td>{{ item.version }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.owner'|trans }}</td>
|
||||
<td>{{ item.owner ? item.owner.name : 'mautic.program.owner.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.start_date'|trans }}</td>
|
||||
<td>{{ item.startDate ? dateToFull(item.startDate) : 'mautic.program.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.program.field.end_date'|trans }}</td>
|
||||
<td>{{ item.endDate ? dateToFull(item.endDate) : 'mautic.program.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.category'|trans }}</td>
|
||||
<td>{{ item.category ? item.category.title : 'mautic.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="initiative-tab-description" role="tabpanel">
|
||||
{% if descriptionItems is empty %}
|
||||
<p class="text-muted">{{ 'mautic.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 (program.js). #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-description-items-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.description_item.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.description_item.field.type'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.description_item.field.description'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for descriptionItem in descriptionItems %}
|
||||
{% set typeName = program_item_type_name('description', descriptionItem.type) %}
|
||||
{% set typeDescription = program_item_type_description('description', descriptionItem.type) %}
|
||||
{% set typeIcon = program_item_type_icon('description', descriptionItem.type) %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': descriptionItem.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-description">
|
||||
{{ include('@Program/Initiative/_description_read_more.html.twig', {
|
||||
'text': descriptionItem.description,
|
||||
'id': 'initiative-desc-item-' ~ descriptionItem.id,
|
||||
}) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Objectives #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-objectives" role="tabpanel">
|
||||
{% if objectives is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.objective.empty'|trans }}</p>
|
||||
{% else %}
|
||||
<p class="text-muted initiative-objectives-progress">
|
||||
{{ 'mautic.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 (program.js). #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-objectives-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.objective.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.objective.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.objective.field.name'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.objective.field.description'|trans }}</th>
|
||||
<th class="initiative-col-priority">{{ 'mautic.program.objective.field.priority'|trans }}</th>
|
||||
<th class="initiative-col-status">{{ 'mautic.program.objective.field.is_achieved'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for objective in objectives %}
|
||||
{% set typeName = program_item_type_name('objective', objective.type) %}
|
||||
{% set typeDescription = program_item_type_description('objective', objective.type) %}
|
||||
{% set typeIcon = program_item_type_icon('objective', objective.type) %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': objective.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-name">{{ objective.title }}</td>
|
||||
<td class="initiative-col-description text-muted" style="white-space: pre-wrap;">{{ objective.description|program_linkify }}</td>
|
||||
<td class="initiative-col-priority">{{ objective.priority ?? '—' }}</td>
|
||||
<td class="initiative-col-status">
|
||||
{% if objective.achieved %}
|
||||
<span class="label label-success"><i class="ri-checkbox-circle-fill" title="{{ 'mautic.program.objective.achieved'|trans }}"></i> {{ 'mautic.program.objective.achieved'|trans }}</span>
|
||||
{% else %}
|
||||
<span class="label label-default"><i class="ri-checkbox-blank-circle-line" title="{{ 'mautic.program.objective.not_achieved'|trans }}"></i> {{ 'mautic.program.objective.not_achieved'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Allocation: the initiative's budget, then the allocation items (cost lines) with their totals. #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-allocation" role="tabpanel">
|
||||
<table class="table table-hover mb-md initiative-allocation">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.program.field.budget_planned'|trans }}</td>
|
||||
<td>
|
||||
{% if item.budgetPlanned is not null %}
|
||||
{{ program_money(item.budgetPlanned) }} {{ program_currency() }}
|
||||
{% else %}
|
||||
{{ 'mautic.program.value.none'|trans }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 class="mb-sm">{{ 'mautic.program.field.allocation_items'|trans }}</h4>
|
||||
{% if allocationItems is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.allocation_item.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{# Harmonized columns: Pictogram (no label), Type, Name, Description, then the costs.
|
||||
Filter + click-to-sort (program.js). #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-allocation-items-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.allocation_item.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.allocation_item.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.allocation_item.field.name'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.allocation_item.field.description'|trans }}</th>
|
||||
<th class="initiative-col-cost text-right">{{ 'mautic.program.allocation_item.field.planned_cost'|trans }}</th>
|
||||
<th class="initiative-col-cost text-right">{{ 'mautic.program.allocation_item.field.real_cost'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for allocationItem in allocationItems %}
|
||||
{% set typeName = program_item_type_name('allocation', allocationItem.type) %}
|
||||
{% set typeDescription = program_item_type_description('allocation', allocationItem.type) %}
|
||||
{% set typeIcon = program_item_type_icon('allocation', allocationItem.type) %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if typeDescription %} title="{{ typeDescription }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ typeName ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': allocationItem.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-name">{{ allocationItem.name }}</td>
|
||||
<td class="initiative-col-description text-muted" style="white-space: pre-wrap;">{{ allocationItem.description|program_linkify }}</td>
|
||||
<td class="initiative-col-cost text-right text-nowrap">
|
||||
{% if allocationItem.plannedCost is not null %}{{ program_money(allocationItem.plannedCost) }} {{ program_currency() }}{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-cost text-right text-nowrap">
|
||||
{% if allocationItem.realCost is not null %}{{ program_money(allocationItem.realCost) }} {{ program_currency() }}{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="initiative-allocation-total">
|
||||
<th colspan="4">{{ 'mautic.program.allocation.total'|trans }}</th>
|
||||
<th class="initiative-col-cost text-right text-nowrap">
|
||||
{% if allocationTotals.planned is not null %}{{ program_money(allocationTotals.planned) }} {{ program_currency() }}{% endif %}
|
||||
</th>
|
||||
<th class="initiative-col-cost text-right text-nowrap">
|
||||
{% if allocationTotals.real is not null %}{{ program_money(allocationTotals.real) }} {{ program_currency() }}{% endif %}
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Stakeholders: the initiative's links to the global directory, harmonized like the other tabs. #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-stakeholders" role="tabpanel">
|
||||
{% set stakeholders = item.stakeholders %}
|
||||
{% if stakeholders is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.stakeholder.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{# Harmonized columns: Pictogram (no label), Type, Name, then the link's own fields.
|
||||
Filter + click-to-sort (program.js). #}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-stakeholders-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.stakeholder.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.stakeholder.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.stakeholder.field.name'|trans }}</th>
|
||||
<th class="initiative-col-role">{{ 'mautic.program.stakeholder.field.role_in_initiative'|trans }}</th>
|
||||
<th class="initiative-col-role">{{ 'mautic.program.stakeholder.field.role'|trans }}</th>
|
||||
<th class="initiative-col-email">{{ 'mautic.program.stakeholder.field.email'|trans }}</th>
|
||||
<th class="initiative-col-phone">{{ 'mautic.program.stakeholder.field.phone'|trans }}</th>
|
||||
<th class="initiative-col-active">{{ 'mautic.program.stakeholder.field.active'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in stakeholders %}
|
||||
{% set stakeholder = link.stakeholder %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
{% set typeIcon = program_item_type_icon('stakeholder', stakeholder.type) %}
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-type"{% if program_item_type_description('stakeholder', stakeholder.type) %} title="{{ program_item_type_description('stakeholder', stakeholder.type) }}" data-toggle="tooltip"{% endif %}>
|
||||
{{ program_item_type_name('stakeholder', stakeholder.type) ?? 'mautic.program.description_item.type.unknown'|trans({'%key%': stakeholder.type}) }}
|
||||
</td>
|
||||
<td class="initiative-col-name">
|
||||
<a href="{{ path('initiative_stakeholder_action', {'objectAction': 'view', 'objectId': stakeholder.id}) }}" data-toggle="ajax">{{ stakeholder.name }}</a>
|
||||
</td>
|
||||
<td class="initiative-col-role">{{ link.roleInInitiative }}</td>
|
||||
<td class="initiative-col-role text-muted">{{ stakeholder.role }}</td>
|
||||
<td class="initiative-col-email">
|
||||
{% if stakeholder.email %}<a href="mailto:{{ stakeholder.email }}">{{ stakeholder.email }}</a>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-phone text-nowrap">
|
||||
{% if stakeholder.phone %}<a href="tel:{{ stakeholder.phone|replace({' ': ''}) }}">{{ stakeholder.phone }}</a>{% endif %}
|
||||
</td>
|
||||
<td class="initiative-col-active">
|
||||
<span class="label {{ stakeholder.isPublished ? 'label-success' : 'label-gray' }}">
|
||||
{{ (stakeholder.isPublished ? 'mautic.program.stakeholder.active' : 'mautic.program.stakeholder.inactive')|trans }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Audiences: the initiative'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 (program.js). #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-audiences" role="tabpanel">
|
||||
{% set audiences = item.audiences %}
|
||||
{% if audiences is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.audience.empty'|trans }}</p>
|
||||
{% else %}
|
||||
{{ include('@Program/Initiative/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover initiative-tab-table initiative-audiences-view"
|
||||
data-initiative-tab-table data-empty-text="{{ 'mautic.program.filter.no_match'|trans }}" data-sort-hint="{{ 'mautic.program.filter.sort_hint'|trans }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="initiative-col-pictogram" aria-label="{{ 'mautic.program.audience.field.pictogram'|trans }}"></th>
|
||||
<th class="initiative-col-type">{{ 'mautic.program.audience.field.type'|trans }}</th>
|
||||
<th class="initiative-col-name">{{ 'mautic.program.audience.field.name'|trans }}</th>
|
||||
<th class="initiative-col-priority">{{ 'mautic.program.audience.field.priority'|trans }}</th>
|
||||
<th class="initiative-col-stages">{{ 'mautic.program.audience.field.stages'|trans }}</th>
|
||||
<th class="initiative-col-size text-right">{{ 'mautic.program.audience.field.estimated_size'|trans }}</th>
|
||||
<th class="initiative-col-description">{{ 'mautic.program.audience.field.value_proposition'|trans }}</th>
|
||||
<th class="initiative-col-channels">{{ 'mautic.program.audience.field.preferred_channels'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in audiences %}
|
||||
{% set audience = link.audience %}
|
||||
<tr>
|
||||
<td class="initiative-col-pictogram text-center">
|
||||
<i class="{{ audience.audienceType.icon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i>
|
||||
</td>
|
||||
<td class="initiative-col-type">{{ audience.audienceType.labelKey|trans }}</td>
|
||||
<td class="initiative-col-name">
|
||||
<a href="{{ path('initiative_audience_action', {'objectAction': 'view', 'objectId': audience.id}) }}" data-toggle="ajax">{{ audience.name }}</a>
|
||||
</td>
|
||||
<td class="initiative-col-priority">
|
||||
<span class="label {{ link.priority.labelClass }}">{{ link.priority.labelKey|trans }}</span>
|
||||
</td>
|
||||
<td class="initiative-col-stages text-muted">
|
||||
{{ audience.stages|map(stage => stage.name)|join(', ') }}
|
||||
</td>
|
||||
<td class="initiative-col-size text-right text-nowrap">{{ audience.estimatedSize }}</td>
|
||||
<td class="initiative-col-description text-muted" style="white-space: pre-wrap;">{{ link.valueProposition }}</td>
|
||||
<td class="initiative-col-channels">
|
||||
{% for channel in audience.preferredChannels ?? [] %}
|
||||
<span class="label label-default">{{ 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="initiative-tab-tasks" role="tabpanel">
|
||||
{{ include('@Program/Initiative/_task_table.html.twig', {
|
||||
'initiative': item,
|
||||
'taskTree': taskTree,
|
||||
'taskPermissions': taskPermissions,
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,25 +1,25 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}plan{% endblock %}
|
||||
{% block mauticContent %}program{% endblock %}
|
||||
|
||||
{% block headerTitle %}
|
||||
{% if entity.id %}
|
||||
{{ 'mautic.plan.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{{ 'mautic.program.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{% else %}
|
||||
{{ 'mautic.plan.header.new'|trans }}
|
||||
{{ 'mautic.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/plan.js, through the plan-collection-* classes.
|
||||
# Assets/js/program.js, through the initiative-collection-* classes.
|
||||
#}
|
||||
{% macro row_start(dragLabel) %}
|
||||
<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="{{ dragLabel|trans }}" style="cursor: move;">
|
||||
<span class="initiative-collection-handle text-muted" title="{{ dragLabel|trans }}" style="cursor: move;">
|
||||
<i class="ri-draggable ri-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
@@ -29,7 +29,7 @@
|
||||
{% macro row_end(removeLabel) %}
|
||||
</div>
|
||||
<div class="col-xs-1 text-right">
|
||||
<button type="button" class="btn btn-ghost btn-sm plan-collection-remove" title="{{ removeLabel|trans }}">
|
||||
<button type="button" class="btn btn-ghost btn-sm initiative-collection-remove" title="{{ removeLabel|trans }}">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -38,16 +38,16 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro objective_row(objective) %}
|
||||
{{ _self.row_start('mautic.plan.objective.drag') }}
|
||||
{{ _self.row_start('mautic.program.objective.drag') }}
|
||||
<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('objective', objective.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
<i class="initiative-item-type-icon {{ 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 plan.js. #}
|
||||
<p class="help-block plan-item-type-help">{{ plan_item_type_description('objective', objective.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('objective', objective.type.vars.value) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(objective.title) }}
|
||||
@@ -57,67 +57,59 @@
|
||||
</div>
|
||||
{{ form_row(objective.description) }}
|
||||
{{ form_widget(objective.position) }}
|
||||
{{ _self.row_end('mautic.plan.objective.remove') }}
|
||||
{{ _self.row_end('mautic.program.objective.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro description_item_row(item) %}
|
||||
{{ _self.row_start('mautic.plan.description_item.drag') }}
|
||||
{{ _self.row_start('mautic.program.description_item.drag') }}
|
||||
<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('description', item.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
<i class="initiative-item-type-icon {{ 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 plan.js. #}
|
||||
<p class="help-block plan-item-type-help">{{ plan_item_type_description('description', item.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('description', item.type.vars.value) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(item.description) }}
|
||||
{{ form_widget(item.position) }}
|
||||
{{ _self.row_end('mautic.plan.description_item.remove') }}
|
||||
{{ _self.row_end('mautic.program.description_item.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro stakeholder_row(link) %}
|
||||
{{ _self.row_start('mautic.plan.stakeholder.drag') }}
|
||||
{{ _self.row_start('mautic.program.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 class="col-md-6">{{ form_row(link.roleInInitiative) }}</div>
|
||||
</div>
|
||||
{{ form_widget(link.position) }}
|
||||
{{ _self.row_end('mautic.plan.stakeholder.remove') }}
|
||||
{{ _self.row_end('mautic.program.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') }}
|
||||
{% macro audience_row(audience) %}
|
||||
{{ _self.row_start('mautic.program.audience.drag') }}
|
||||
{{ form_row(audience.audience) }}
|
||||
{{ form_row(audience.priority) }}
|
||||
{{ form_row(audience.valueProposition) }}
|
||||
{{ form_widget(audience.position) }}
|
||||
{{ _self.row_end('mautic.program.audience.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro allocation_item_row(item) %}
|
||||
{{ _self.row_start('mautic.plan.allocation_item.drag') }}
|
||||
{{ _self.row_start('mautic.program.allocation_item.drag') }}
|
||||
<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('allocation', item.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
<i class="initiative-item-type-icon {{ 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 plan.js. #}
|
||||
<p class="help-block plan-item-type-help">{{ plan_item_type_description('allocation', item.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('allocation', item.type.vars.value) }}</p>
|
||||
</div>
|
||||
<div class="col-md-6">{{ form_row(item.name) }}</div>
|
||||
</div>
|
||||
@@ -129,7 +121,7 @@
|
||||
<div class="col-md-6">{{ form_row(item.realCost) }}</div>
|
||||
</div>
|
||||
{{ form_widget(item.position) }}
|
||||
{{ _self.row_end('mautic.plan.allocation_item.remove') }}
|
||||
{{ _self.row_end('mautic.program.allocation_item.remove') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
@@ -138,11 +130,11 @@
|
||||
{{ form_row(form.name) }}
|
||||
</div>
|
||||
|
||||
{{ include('@Plan/Plan/_tabs.html.twig', {'planId': entity.id}) }}
|
||||
{{ include('@Program/Initiative/_tabs.html.twig', {'initiativeId': entity.id}) }}
|
||||
|
||||
<div class="tab-content pa-md">
|
||||
{# Details #}
|
||||
<div class="tab-pane active bdr-w-0" id="plan-tab-details" role="tabpanel">
|
||||
<div class="tab-pane active bdr-w-0" id="initiative-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>
|
||||
@@ -150,7 +142,7 @@
|
||||
</div>
|
||||
{% if entity.completedAt %}
|
||||
<div class="form-group">
|
||||
<label class="control-label">{{ 'mautic.plan.field.completed_at'|trans }}</label>
|
||||
<label class="control-label">{{ 'mautic.program.field.completed_at'|trans }}</label>
|
||||
<p class="form-control-static">{{ dateToFull(entity.completedAt) }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -165,26 +157,26 @@
|
||||
</div>
|
||||
|
||||
{# Description: description items. #}
|
||||
<div class="tab-pane bdr-w-0" id="plan-tab-description" role="tabpanel">
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-description" role="tabpanel">
|
||||
{% set hasTypes = form.descriptionItems.vars.prototype.type.vars.choices is not empty %}
|
||||
<div class="plan-collection plan-description-items"
|
||||
<div class="initiative-collection initiative-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">{{ 'mautic.plan.description_item.no_types'|trans }}</div>
|
||||
<div class="alert alert-info">{{ 'mautic.program.description_item.no_types'|trans }}</div>
|
||||
{% endif %}
|
||||
<p class="text-muted plan-collection-empty{% if form.descriptionItems|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.plan.description_item.empty'|trans }}
|
||||
<p class="text-muted initiative-collection-empty{% if form.descriptionItems|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.program.description_item.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group plan-collection-list">
|
||||
<ul class="list-group initiative-collection-list">
|
||||
{% for item in form.descriptionItems %}
|
||||
{{ _self.description_item_row(item) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if hasTypes %}
|
||||
<button type="button" class="btn btn-ghost plan-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.plan.description_item.add'|trans }}
|
||||
<button type="button" class="btn btn-ghost initiative-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.description_item.add'|trans }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -192,113 +184,114 @@
|
||||
</div>
|
||||
|
||||
{# Objectives #}
|
||||
<div class="tab-pane bdr-w-0" id="plan-tab-objectives" role="tabpanel">
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-objectives" role="tabpanel">
|
||||
{% set hasObjectiveTypes = form.objectives.vars.prototype.type.vars.choices is not empty %}
|
||||
<div class="plan-collection plan-objectives"
|
||||
<div class="initiative-collection initiative-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>
|
||||
<div class="alert alert-info">{{ 'mautic.program.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 class="text-muted initiative-collection-empty{% if form.objectives|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.program.objective.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group plan-collection-list">
|
||||
<ul class="list-group initiative-collection-list">
|
||||
{% for objective in form.objectives %}
|
||||
{{ _self.objective_row(objective) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if hasObjectiveTypes %}
|
||||
<button type="button" class="btn btn-ghost plan-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.plan.objective.add'|trans }}
|
||||
<button type="button" class="btn btn-ghost initiative-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.objective.add'|trans }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% do form.objectives.setRendered %}
|
||||
</div>
|
||||
|
||||
{# Allocation: the plan's budget, then the allocation items (cost lines). #}
|
||||
<div class="tab-pane bdr-w-0" id="plan-tab-allocation" role="tabpanel">
|
||||
{# Allocation: the initiative's budget, then the allocation items (cost lines). #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-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="plan-collection plan-allocation-items"
|
||||
<div class="initiative-collection initiative-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">{{ 'mautic.plan.field.allocation_items'|trans }}</h4>
|
||||
<h4 class="mt-lg mb-sm">{{ 'mautic.program.field.allocation_items'|trans }}</h4>
|
||||
{{ form_errors(form.allocationItems) }}
|
||||
{% if not hasAllocationTypes %}
|
||||
<div class="alert alert-info">{{ 'mautic.plan.allocation_item.no_types'|trans }}</div>
|
||||
<div class="alert alert-info">{{ 'mautic.program.allocation_item.no_types'|trans }}</div>
|
||||
{% endif %}
|
||||
<p class="text-muted plan-collection-empty{% if form.allocationItems|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.plan.allocation_item.empty'|trans }}
|
||||
<p class="text-muted initiative-collection-empty{% if form.allocationItems|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.program.allocation_item.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group plan-collection-list">
|
||||
<ul class="list-group initiative-collection-list">
|
||||
{% for item in form.allocationItems %}
|
||||
{{ _self.allocation_item_row(item) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if hasAllocationTypes %}
|
||||
<button type="button" class="btn btn-ghost plan-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.plan.allocation_item.add'|trans }}
|
||||
<button type="button" class="btn btn-ghost initiative-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.allocation_item.add'|trans }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% do form.allocationItems.setRendered %}
|
||||
</div>
|
||||
|
||||
{# 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"
|
||||
{# Stakeholders: links to the global directory (Programs > Stakeholders). #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-stakeholders" role="tabpanel">
|
||||
<div class="initiative-collection initiative-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 class="text-muted initiative-collection-empty{% if form.stakeholders|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.program.stakeholder.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group plan-collection-list">
|
||||
<ul class="list-group initiative-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 type="button" class="btn btn-ghost initiative-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.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">
|
||||
<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 }}
|
||||
{# Audiences: the initiative's links to the global directory (Programs > Audiences). #}
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-audiences" role="tabpanel">
|
||||
<p class="text-muted small">{{ 'mautic.program.audience.link_tab.help'|trans }}</p>
|
||||
<div class="initiative-collection initiative-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 initiative-collection-empty{% if form.audiences|length > 0 %} hide{% endif %}">
|
||||
{{ 'mautic.program.audience.empty'|trans }}
|
||||
</p>
|
||||
<ul class="list-group plan-collection-list">
|
||||
{% for target in form.targets %}
|
||||
{{ _self.target_row(target) }}
|
||||
<ul class="list-group initiative-collection-list">
|
||||
{% for audience in form.audiences %}
|
||||
{{ _self.audience_row(audience) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<button type="button" class="btn btn-ghost plan-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.plan.target.add'|trans }}
|
||||
<button type="button" class="btn btn-ghost initiative-collection-add">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.program.audience.add'|trans }}
|
||||
</button>
|
||||
</div>
|
||||
{% do form.targets.setRendered %}
|
||||
{% 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="plan-tab-tasks" role="tabpanel">
|
||||
<div class="tab-pane bdr-w-0" id="initiative-tab-tasks" role="tabpanel">
|
||||
{% if entity.id %}
|
||||
<p class="text-muted small">{{ 'mautic.plan.task.manage_from_plan_page'|trans }}</p>
|
||||
<p class="text-muted small">{{ 'mautic.program.task.manage_from_initiative_page'|trans }}</p>
|
||||
{% endif %}
|
||||
{{ include('@Plan/Plan/_task_table.html.twig', {
|
||||
'plan': entity,
|
||||
{{ include('@Program/Initiative/_task_table.html.twig', {
|
||||
'initiative': entity,
|
||||
'taskTree': taskTree|default([]),
|
||||
'readOnly': true,
|
||||
}) }}
|
||||
@@ -2,9 +2,9 @@
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}plan{% endblock %}
|
||||
{% block mauticContent %}program{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mautic.plan.header.index'|trans }}{% endblock %}
|
||||
{% block headerTitle %}{{ 'mautic.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">
|
||||
@@ -13,95 +13,95 @@
|
||||
'action': currentRoute,
|
||||
'page_actions': {
|
||||
'templateButtons': {
|
||||
'new': permissions['plan:plans:create'],
|
||||
'new': permissions['program:initiatives:create'],
|
||||
},
|
||||
'routeBase': 'plan',
|
||||
'langVar': 'plan',
|
||||
'routeBase': 'initiative',
|
||||
'langVar': 'initiative',
|
||||
},
|
||||
'bulk_actions': {
|
||||
'langVar': 'plan',
|
||||
'routeBase': 'plan',
|
||||
'langVar': 'initiative',
|
||||
'routeBase': 'initiative',
|
||||
'templateButtons': {
|
||||
'delete': permissions['plan:plans:deleteown'] or permissions['plan:plans:deleteother'],
|
||||
'delete': permissions['program:initiatives:deleteown'] or permissions['program:initiatives:deleteother'],
|
||||
},
|
||||
},
|
||||
}) -}}
|
||||
<div class="page-list">
|
||||
{% if items is defined and items is not empty %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover" id="planTable">
|
||||
<table class="table table-hover" id="initiativeTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'checkall': 'true',
|
||||
'target': '#planTable',
|
||||
'target': '#initiativeTable',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan',
|
||||
'sessionVar': 'initiative',
|
||||
'orderBy': 'p.name',
|
||||
'text': 'mautic.plan.field.name',
|
||||
'class': 'col-plan-name',
|
||||
'text': 'mautic.program.field.name',
|
||||
'class': 'col-initiative-name',
|
||||
'default': true,
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan',
|
||||
'sessionVar': 'initiative',
|
||||
'orderBy': 'p.status',
|
||||
'text': 'mautic.plan.field.status',
|
||||
'class': 'col-plan-status',
|
||||
'text': 'mautic.program.field.status',
|
||||
'class': 'col-initiative-status',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan',
|
||||
'text': 'mautic.plan.field.owner',
|
||||
'class': 'visible-md visible-lg col-plan-owner',
|
||||
'sessionVar': 'initiative',
|
||||
'text': 'mautic.program.field.owner',
|
||||
'class': 'visible-md visible-lg col-initiative-owner',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan',
|
||||
'sessionVar': 'initiative',
|
||||
'orderBy': 'p.startDate',
|
||||
'text': 'mautic.plan.field.start_date',
|
||||
'class': 'visible-md visible-lg col-plan-start',
|
||||
'text': 'mautic.program.field.start_date',
|
||||
'class': 'visible-md visible-lg col-initiative-start',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan',
|
||||
'sessionVar': 'initiative',
|
||||
'orderBy': 'p.endDate',
|
||||
'text': 'mautic.plan.field.end_date',
|
||||
'class': 'visible-md visible-lg col-plan-end',
|
||||
'text': 'mautic.program.field.end_date',
|
||||
'class': 'visible-md visible-lg col-initiative-end',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan',
|
||||
'sessionVar': 'initiative',
|
||||
'orderBy': 'p.budgetPlanned',
|
||||
'text': 'mautic.plan.field.budget_planned',
|
||||
'class': 'visible-md visible-lg col-plan-budget text-right',
|
||||
'text': 'mautic.program.field.budget_planned',
|
||||
'class': 'visible-md visible-lg col-initiative-budget text-right',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan',
|
||||
'sessionVar': 'initiative',
|
||||
'orderBy': 'p.id',
|
||||
'text': 'mautic.core.id',
|
||||
'class': 'visible-md visible-lg col-plan-id',
|
||||
'class': 'visible-md visible-lg col-initiative-id',
|
||||
}) }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions['plan:plans:editown'], permissions['plan:plans:editother'], item.createdBy) %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions['program:initiatives:editown'], permissions['program:initiatives:editother'], item.createdBy) %}
|
||||
<tr>
|
||||
<td>
|
||||
{{- include('@MauticCore/Helper/list_actions.html.twig', {
|
||||
'item': item,
|
||||
'templateButtons': {
|
||||
'edit': canEdit,
|
||||
'delete': securityHasEntityAccess(permissions['plan:plans:deleteown'], permissions['plan:plans:deleteother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['program:initiatives:deleteown'], permissions['program:initiatives:deleteother'], item.createdBy),
|
||||
},
|
||||
'routeBase': 'plan',
|
||||
'langVar': 'plan',
|
||||
'routeBase': 'initiative',
|
||||
'langVar': 'initiative',
|
||||
}) -}}
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
{{- include('@MauticCore/Helper/publishstatus_icon.html.twig', {
|
||||
'item': item,
|
||||
'model': 'plan',
|
||||
'model': 'initiative',
|
||||
}) -}}
|
||||
<a href="{{ path('plan_action', {'objectAction': 'view', 'objectId': item.id}) }}" data-toggle="ajax">
|
||||
<a href="{{ path('initiative_action', {'objectAction': 'view', 'objectId': item.id}) }}" data-toggle="ajax">
|
||||
{{ item.name }}
|
||||
</a>
|
||||
{% if item.category %}
|
||||
@@ -111,13 +111,13 @@
|
||||
</td>
|
||||
<td>{{ item.status.labelKey|trans }}</td>
|
||||
<td class="visible-md visible-lg">
|
||||
{{ item.owner ? item.owner.name : 'mautic.plan.owner.none'|trans }}
|
||||
{{ item.owner ? item.owner.name : 'mautic.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 %}
|
||||
{{ plan_money(item.budgetPlanned) }} {{ plan_currency() }}
|
||||
{{ program_money(item.budgetPlanned) }} {{ program_currency() }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="visible-md visible-lg">{{ item.id }}</td>
|
||||
@@ -130,8 +130,8 @@
|
||||
'totalItems': totalItems,
|
||||
'page': page,
|
||||
'limit': limit,
|
||||
'baseUrl': path('plan_index'),
|
||||
'sessionVar': 'plan',
|
||||
'baseUrl': path('initiative_index'),
|
||||
'sessionVar': 'initiative',
|
||||
}) -}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -140,9 +140,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.onboarding.heading',
|
||||
'subheading': 'mautic.plan.onboarding.subheading',
|
||||
'copy': 'mautic.plan.onboarding.copy',
|
||||
'heading': 'mautic.program.onboarding.heading',
|
||||
'subheading': 'mautic.program.onboarding.subheading',
|
||||
'copy': 'mautic.program.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,11 +0,0 @@
|
||||
{#
|
||||
# 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>
|
||||
@@ -1,32 +0,0 @@
|
||||
{#
|
||||
# Tab bar shared by the plan form and the plan detail page.
|
||||
#
|
||||
# Parameters:
|
||||
# planId: the plan's id (null for a new plan)
|
||||
# counts (optional): tab id => number shown next to the tab name
|
||||
#
|
||||
# The tab panes use the ids plan-tab-<id>. Assets/js/plan.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 planTabs = {
|
||||
'details': 'mautic.plan.tab.details',
|
||||
'description': 'mautic.plan.tab.description',
|
||||
'objectives': 'mautic.plan.tab.objectives',
|
||||
'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('') }}">
|
||||
{% for id, label in planTabs %}
|
||||
<li class="{{ loop.first ? 'active' : '' }}" data-tab-id="plan-tab-{{ id }}">
|
||||
<a href="#plan-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>
|
||||
@@ -1,93 +0,0 @@
|
||||
{#
|
||||
# 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) %}
|
||||
<tr class="plan-task" data-task-id="{{ task.id }}">
|
||||
<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">
|
||||
{% 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 task.taskKind == constant('MauticPlugin\\PlanBundle\\Entity\\TaskKind::Milestone') %}
|
||||
<span class="label label-success" title="{{ 'mautic.plan.task.kind.milestone'|trans }}">{{ 'mautic.plan.task.kind.milestone_short'|trans }}</span>
|
||||
{% elseif task.taskKind == constant('MauticPlugin\\PlanBundle\\Entity\\TaskKind::Phase') %}
|
||||
<span class="label label-primary" title="{{ 'mautic.plan.task.kind.phase'|trans }}">{{ 'mautic.plan.task.kind.phase_short'|trans }}</span>
|
||||
{% endif %}
|
||||
</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 ? task.startDate|date('Y-m-d') : '' }}</td>
|
||||
<td class="plan-col-date">{{ task.endDate ? task.endDate|date('Y-m-d') : '' }}</td>
|
||||
<td class="plan-col-status">
|
||||
{# A phase has no status of its own — skip the column value. #}
|
||||
{% if task.taskKind != constant('MauticPlugin\\PlanBundle\\Entity\\TaskKind::Phase') %}
|
||||
<span class="label {{ task.status.labelClass }}">{{ task.status.labelKey|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,450 +0,0 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}plan{% endblock %}
|
||||
|
||||
{#
|
||||
# No routeBase on the page_actions includes: core would turn it into mautic_plan_* route names.
|
||||
# The buttons use actionRoute (plan_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('plan_index'),
|
||||
'targetLabel': 'mautic.plan.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': 'plan-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: 'mautic.plan.header.total_planned'|trans({'%amount%': plan_money(totals.planned), '%currency%': plan_currency()}),
|
||||
attributes: {'class': 'plan-total-planned', 'title': 'mautic.plan.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: 'mautic.plan.header.total_real'|trans({'%amount%': plan_money(totals.real), '%currency%': plan_currency()}),
|
||||
attributes: {'class': 'plan-total-real', 'title': (overPlan ? 'mautic.plan.header.total_real.over' : 'mautic.plan.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['plan:plans:editown'], permissions['plan:plans:editother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['plan:plans:deleteown'], permissions['plan:plans:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'plan',
|
||||
}) -}}
|
||||
{% 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('@Plan/Plan/_tabs.html.twig', {'planId': item.id, 'counts': {
|
||||
'description': descriptionItems|length,
|
||||
'objectives': objectives|length,
|
||||
'allocation': allocationItems|length,
|
||||
'targets': item.targets|length,
|
||||
'stakeholders': item.stakeholders|length,
|
||||
'tasks': taskTree|length,
|
||||
}}) }}
|
||||
|
||||
<div class="tab-content pa-md">
|
||||
{# Details #}
|
||||
<div class="tab-pane active bdr-w-0" id="plan-tab-details" role="tabpanel">
|
||||
<table class="table table-hover mb-0 plan-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.plan.field.status'|trans }}</td>
|
||||
<td>{{ item.status.labelKey|trans }}</td>
|
||||
</tr>
|
||||
{% if item.completedAt %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.plan.field.completed_at'|trans }}</td>
|
||||
<td>{{ dateToFull(item.completedAt) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.plan.field.version'|trans }}</td>
|
||||
<td>{{ item.version }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.plan.field.owner'|trans }}</td>
|
||||
<td>{{ item.owner ? item.owner.name : 'mautic.plan.owner.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.plan.field.start_date'|trans }}</td>
|
||||
<td>{{ item.startDate ? dateToFull(item.startDate) : 'mautic.plan.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.plan.field.end_date'|trans }}</td>
|
||||
<td>{{ item.endDate ? dateToFull(item.endDate) : 'mautic.plan.value.none'|trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.category'|trans }}</td>
|
||||
<td>{{ item.category ? item.category.title : 'mautic.plan.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="plan-tab-description" role="tabpanel">
|
||||
{% if descriptionItems is empty %}
|
||||
<p class="text-muted">{{ 'mautic.plan.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 (plan.js). #}
|
||||
{{ include('@Plan/Plan/_tab_table_filter.html.twig') }}
|
||||
<div class="table-responsive">
|
||||
<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="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>
|
||||
{% for descriptionItem in descriptionItems %}
|
||||
{% set typeName = plan_item_type_name('description', descriptionItem.type) %}
|
||||
{% set typeDescription = plan_item_type_description('description', descriptionItem.type) %}
|
||||
{% set typeIcon = plan_item_type_icon('description', descriptionItem.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%': 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>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Objectives #}
|
||||
<div class="tab-pane bdr-w-0" id="plan-tab-objectives" role="tabpanel">
|
||||
{% if objectives is empty %}
|
||||
<p class="text-muted">{{ 'mautic.plan.objective.empty'|trans }}</p>
|
||||
{% else %}
|
||||
<p class="text-muted plan-objectives-progress">
|
||||
{{ 'mautic.plan.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 (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>
|
||||
|
||||
{# Allocation: the plan's budget, then the allocation items (cost lines) with their totals. #}
|
||||
<div class="tab-pane bdr-w-0" id="plan-tab-allocation" role="tabpanel">
|
||||
<table class="table table-hover mb-md plan-allocation">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.plan.field.budget_planned'|trans }}</td>
|
||||
<td>
|
||||
{% if item.budgetPlanned is not null %}
|
||||
{{ plan_money(item.budgetPlanned) }} {{ plan_currency() }}
|
||||
{% else %}
|
||||
{{ 'mautic.plan.value.none'|trans }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 class="mb-sm">{{ 'mautic.plan.field.allocation_items'|trans }}</h4>
|
||||
{% 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-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="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>
|
||||
{% for allocationItem in allocationItems %}
|
||||
{% set typeName = plan_item_type_name('allocation', allocationItem.type) %}
|
||||
{% set typeDescription = plan_item_type_description('allocation', allocationItem.type) %}
|
||||
{% set typeIcon = plan_item_type_icon('allocation', allocationItem.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%': allocationItem.type}) }}
|
||||
</td>
|
||||
<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="plan-col-cost text-right text-nowrap">
|
||||
{% if allocationItem.realCost is not null %}{{ plan_money(allocationItem.realCost) }} {{ plan_currency() }}{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="plan-allocation-total">
|
||||
<th colspan="4">{{ 'mautic.plan.allocation.total'|trans }}</th>
|
||||
<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="plan-col-cost text-right text-nowrap">
|
||||
{% if allocationTotals.real is not null %}{{ plan_money(allocationTotals.real) }} {{ plan_currency() }}{% endif %}
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# 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">
|
||||
{% 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. #}
|
||||
<div class="tab-pane bdr-w-0" id="plan-tab-tasks" role="tabpanel">
|
||||
{{ include('@Plan/Plan/_task_table.html.twig', {
|
||||
'plan': item,
|
||||
'taskTree': taskTree,
|
||||
'taskPermissions': taskPermissions,
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}planStakeholder{% endblock %}
|
||||
{% block mauticContent %}programStakeholder{% endblock %}
|
||||
|
||||
{% block preHeader %}
|
||||
{{- include('@MauticCore/Helper/page_actions.html.twig', {
|
||||
@@ -8,8 +8,8 @@
|
||||
'templateButtons': {
|
||||
'close': true,
|
||||
},
|
||||
'closeUrl': path('plan_stakeholder_index'),
|
||||
'targetLabel': 'mautic.plan.stakeholder.header.index'|trans,
|
||||
'closeUrl': path('initiative_stakeholder_index'),
|
||||
'targetLabel': 'mautic.program.stakeholder.header.index'|trans,
|
||||
}) -}}
|
||||
{% endblock %}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
{% 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,
|
||||
label: (item.isPublished ? 'mautic.program.stakeholder.active' : 'mautic.program.stakeholder.inactive')|trans,
|
||||
icon: item.isPublished ? 'ri-checkbox-circle-line' : 'ri-time-line',
|
||||
attributes: {'class': 'plan-stakeholder-status-tag'},
|
||||
attributes: {'class': 'initiative-stakeholder-status-tag'},
|
||||
}] } %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -28,36 +28,36 @@
|
||||
{{- 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),
|
||||
'edit': securityHasEntityAccess(permissions['program:stakeholders:editown'], permissions['program:stakeholders:editother'], item.createdBy),
|
||||
'delete': securityHasEntityAccess(permissions['program:stakeholders:deleteown'], permissions['program:stakeholders:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'plan.stakeholder',
|
||||
'langVar': 'initiative.stakeholder',
|
||||
}) -}}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="pa-md">
|
||||
<table class="table table-hover mb-md plan-stakeholder-details">
|
||||
<table class="table table-hover mb-md initiative-stakeholder-details">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.plan.stakeholder.field.type'|trans }}</td>
|
||||
<td class="col-md-3 text-muted">{{ 'mautic.program.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}) }}
|
||||
{% set typeIcon = program_item_type_icon('stakeholder', item.type) %}
|
||||
{% if typeIcon %}<i class="{{ typeIcon }} initiative-item-type-icon" style="font-size: 24px;" aria-hidden="true"></i> {% endif %}
|
||||
{{ program_item_type_name('stakeholder', item.type) ?? 'mautic.program.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>
|
||||
<td class="text-muted">{{ 'mautic.program.stakeholder.field.role'|trans }}</td>
|
||||
<td>{{ item.role|default('mautic.program.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>
|
||||
<td class="text-muted">{{ 'mautic.program.stakeholder.field.email'|trans }}</td>
|
||||
<td>{% if item.email %}<a href="mailto:{{ item.email }}">{{ item.email }}</a>{% else %}{{ 'mautic.program.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>
|
||||
<td class="text-muted">{{ 'mautic.program.stakeholder.field.phone'|trans }}</td>
|
||||
<td>{% if item.phone %}<a href="tel:{{ item.phone|replace({' ': ''}) }}">{{ item.phone }}</a>{% else %}{{ 'mautic.program.value.none'|trans }}{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">{{ 'mautic.core.created'|trans }}</td>
|
||||
@@ -70,25 +70,25 @@
|
||||
</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>
|
||||
<h4 class="mb-sm">{{ 'mautic.program.stakeholder.field.plans'|trans }}</h4>
|
||||
{% if item.initiativeLinks is empty %}
|
||||
<p class="text-muted">{{ 'mautic.program.stakeholder.no_plans'|trans }}</p>
|
||||
{% else %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover plan-stakeholder-plans-view">
|
||||
<table class="table table-hover initiative-stakeholder-initiatives-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>
|
||||
<th>{{ 'mautic.program.field.name'|trans }}</th>
|
||||
<th>{{ 'mautic.program.stakeholder.field.role_in_initiative'|trans }}</th>
|
||||
<th>{{ 'mautic.program.field.status'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for link in item.planLinks %}
|
||||
{% for link in item.initiativeLinks %}
|
||||
<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>
|
||||
<td><a href="{{ path('initiative_action', {'objectAction': 'view', 'objectId': link.initiative.id}) }}" data-toggle="ajax">{{ link.initiative.name }}</a></td>
|
||||
<td class="text-muted">{{ link.roleInInitiative|default('—') }}</td>
|
||||
<td><span class="label {{ link.initiative.status.labelClass }}">{{ link.initiative.status.labelKey|trans }}</span></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{% extends '@MauticCore/Default/content.html.twig' %}
|
||||
|
||||
{% block mauticContent %}planStakeholder{% endblock %}
|
||||
{% block mauticContent %}programStakeholder{% endblock %}
|
||||
|
||||
{% block headerTitle %}
|
||||
{% if entity.id %}
|
||||
{{ 'mautic.plan.stakeholder.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{{ 'mautic.program.stakeholder.header.edit'|trans({'%name%': entity.name}) }}
|
||||
{% else %}
|
||||
{{ 'mautic.plan.stakeholder.header.new'|trans }}
|
||||
{{ 'mautic.program.stakeholder.header.new'|trans }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -17,14 +17,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('stakeholder', form.type.vars.value) }}" style="font-size: 28px;" aria-hidden="true"></i>
|
||||
<i class="initiative-item-type-icon {{ program_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>
|
||||
{# Filled with the selected type's description by program.js. #}
|
||||
<p class="help-block initiative-item-type-help">{{ program_item_type_description('stakeholder', form.type.vars.value) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_row(form.role) }}
|
||||
@@ -35,7 +35,7 @@
|
||||
{{ form_row(form.isPublished) }}
|
||||
{{ form_row(form.email) }}
|
||||
{{ form_row(form.phone) }}
|
||||
<p class="text-muted small">{{ 'mautic.plan.stakeholder.phone.help'|trans }}</p>
|
||||
<p class="text-muted small">{{ 'mautic.program.stakeholder.phone.help'|trans }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}planStakeholder{% endblock %}
|
||||
{% block mauticContent %}programStakeholder{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mautic.plan.stakeholder.header.index'|trans }}{% endblock %}
|
||||
{% block headerTitle %}{{ 'mautic.program.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">
|
||||
@@ -13,107 +13,107 @@
|
||||
'action': currentRoute,
|
||||
'page_actions': {
|
||||
'templateButtons': {
|
||||
'new': permissions['plan:stakeholders:create'],
|
||||
'new': permissions['program:stakeholders:create'],
|
||||
},
|
||||
'langVar': 'plan.stakeholder',
|
||||
'langVar': 'initiative.stakeholder',
|
||||
},
|
||||
'bulk_actions': {
|
||||
'langVar': 'plan.stakeholder',
|
||||
'langVar': 'initiative.stakeholder',
|
||||
'templateButtons': {
|
||||
'delete': permissions['plan:stakeholders:deleteown'] or permissions['plan:stakeholders:deleteother'],
|
||||
'delete': permissions['program:stakeholders:deleteown'] or permissions['program: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">
|
||||
<table class="table table-hover" id="programStakeholderTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'checkall': 'true',
|
||||
'target': '#planStakeholderTable',
|
||||
'target': '#programStakeholderTable',
|
||||
}) }}
|
||||
{# Columns: ID, Pictogram, Type, Name, Role, Email, Phone, Active, Assigned plans. #}
|
||||
{# Columns: ID, Pictogram, Type, Name, Role, Email, Phone, Active, Assigned initiatives. #}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'orderBy': 's.id',
|
||||
'text': 'mautic.core.id',
|
||||
'class': 'col-plan-stakeholder-id',
|
||||
'class': 'col-initiative-stakeholder-id',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'text': 'mautic.plan.stakeholder.field.pictogram',
|
||||
'class': 'col-plan-stakeholder-pictogram',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'text': 'mautic.program.stakeholder.field.pictogram',
|
||||
'class': 'col-initiative-stakeholder-pictogram',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'orderBy': 's.type',
|
||||
'text': 'mautic.plan.stakeholder.field.type',
|
||||
'class': 'col-plan-stakeholder-type',
|
||||
'text': 'mautic.program.stakeholder.field.type',
|
||||
'class': 'col-initiative-stakeholder-type',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'orderBy': 's.name',
|
||||
'text': 'mautic.plan.stakeholder.field.name',
|
||||
'class': 'col-plan-stakeholder-name',
|
||||
'text': 'mautic.program.stakeholder.field.name',
|
||||
'class': 'col-initiative-stakeholder-name',
|
||||
'default': true,
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'orderBy': 's.role',
|
||||
'text': 'mautic.plan.stakeholder.field.role',
|
||||
'class': 'visible-md visible-lg col-plan-stakeholder-role',
|
||||
'text': 'mautic.program.stakeholder.field.role',
|
||||
'class': 'visible-md visible-lg col-initiative-stakeholder-role',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'orderBy': 's.email',
|
||||
'text': 'mautic.plan.stakeholder.field.email',
|
||||
'class': 'col-plan-stakeholder-email',
|
||||
'text': 'mautic.program.stakeholder.field.email',
|
||||
'class': 'col-initiative-stakeholder-email',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'text': 'mautic.plan.stakeholder.field.phone',
|
||||
'class': 'col-plan-stakeholder-phone',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'text': 'mautic.program.stakeholder.field.phone',
|
||||
'class': 'col-initiative-stakeholder-phone',
|
||||
}) }}
|
||||
{{ include('@MauticCore/Helper/tableheader.html.twig', {
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'orderBy': 's.isPublished',
|
||||
'text': 'mautic.plan.stakeholder.field.active',
|
||||
'class': 'col-plan-stakeholder-active',
|
||||
'text': 'mautic.program.stakeholder.field.active',
|
||||
'class': 'col-initiative-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',
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
'text': 'mautic.program.stakeholder.field.plans',
|
||||
'class': 'visible-md visible-lg col-initiative-stakeholder-initiatives',
|
||||
}) }}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions['plan:stakeholders:editown'], permissions['plan:stakeholders:editother'], item.createdBy) %}
|
||||
{% set canEdit = securityHasEntityAccess(permissions['program:stakeholders:editown'], permissions['program: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),
|
||||
'delete': securityHasEntityAccess(permissions['program:stakeholders:deleteown'], permissions['program:stakeholders:deleteother'], item.createdBy),
|
||||
},
|
||||
'langVar': 'plan.stakeholder',
|
||||
'langVar': 'initiative.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 %}
|
||||
{% set typeIcon = program_item_type_icon('stakeholder', 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('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{% if program_item_type_description('stakeholder', item.type) %} title="{{ program_item_type_description('stakeholder', item.type) }}"{% endif %}>
|
||||
{{ program_item_type_name('stakeholder', item.type) ?? 'mautic.program.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>
|
||||
<a href="{{ path('initiative_stakeholder_action', {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">{{ item.name }}</a>
|
||||
{% else %}
|
||||
{{ item.name }}
|
||||
{% endif %}
|
||||
@@ -127,16 +127,16 @@
|
||||
</td>
|
||||
<td>
|
||||
<span class="label {{ item.isPublished ? 'label-success' : 'label-gray' }}">
|
||||
{{ (item.isPublished ? 'mautic.plan.stakeholder.active' : 'mautic.plan.stakeholder.inactive')|trans }}
|
||||
{{ (item.isPublished ? 'mautic.program.stakeholder.active' : 'mautic.program.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 %}
|
||||
{# The initiatives this stakeholder is assigned to, through their Stakeholders tab. #}
|
||||
{% set initiatives = item.initiativeLinks|default([]) %}
|
||||
{% for link in initiatives %}
|
||||
<a href="{{ path('initiative_action', {'objectAction': 'view', 'objectId': link.initiative.id}) }}" data-toggle="ajax">{{ link.initiative.name }}</a>{% if link.roleInInitiative %} <span class="text-muted small">({{ link.roleInInitiative }})</span>{% endif %}{% if not loop.last %}, {% endif %}
|
||||
{% else %}
|
||||
<span class="text-muted">{{ 'mautic.plan.stakeholder.no_plans'|trans }}</span>
|
||||
<span class="text-muted">{{ 'mautic.program.stakeholder.no_plans'|trans }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -148,8 +148,8 @@
|
||||
'totalItems': totalItems,
|
||||
'page': page,
|
||||
'limit': limit,
|
||||
'baseUrl': path('plan_stakeholder_index'),
|
||||
'sessionVar': 'plan.stakeholder',
|
||||
'baseUrl': path('initiative_stakeholder_index'),
|
||||
'sessionVar': 'initiative.stakeholder',
|
||||
}) -}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -158,9 +158,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.stakeholder.onboarding.heading',
|
||||
'subheading': 'mautic.plan.stakeholder.onboarding.subheading',
|
||||
'copy': 'mautic.plan.stakeholder.onboarding.copy',
|
||||
'heading': 'mautic.program.stakeholder.onboarding.heading',
|
||||
'subheading': 'mautic.program.stakeholder.onboarding.subheading',
|
||||
'copy': 'mautic.program.stakeholder.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{% set isIndex = 'index' == tmpl ? true : false %}
|
||||
{% set tmpl = 'list' %}
|
||||
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
|
||||
|
||||
{% block mauticContent %}programUtmTaxonomy{% endblock %}
|
||||
|
||||
{% block headerTitle %}{{ 'mautic.program.utm_taxonomy.header.index'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-list">
|
||||
<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.program.utm_taxonomy.onboarding.heading',
|
||||
'subheading': 'mautic.program.utm_taxonomy.onboarding.subheading',
|
||||
'copy': 'mautic.program.utm_taxonomy.onboarding.copy',
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user