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.
302 lines
15 KiB
Twig
302 lines
15 KiB
Twig
{% extends '@MauticCore/Default/content.html.twig' %}
|
|
|
|
{% block mauticContent %}program{% endblock %}
|
|
|
|
{% block headerTitle %}
|
|
{% if entity.id %}
|
|
{{ 'mautic.program.header.edit'|trans({'%name%': entity.name}) }}
|
|
{% else %}
|
|
{{ '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/program.js, through the initiative-collection-* classes.
|
|
#}
|
|
{% macro row_start(dragLabel) %}
|
|
<li class="initiative-collection-row list-group-item">
|
|
<div class="row">
|
|
<div class="col-xs-1 text-center">
|
|
<span class="initiative-collection-handle text-muted" title="{{ dragLabel|trans }}" style="cursor: move;">
|
|
<i class="ri-draggable ri-lg"></i>
|
|
</span>
|
|
</div>
|
|
<div class="col-xs-10">
|
|
{% endmacro %}
|
|
|
|
{% macro row_end(removeLabel) %}
|
|
</div>
|
|
<div class="col-xs-1 text-right">
|
|
<button type="button" class="btn btn-ghost btn-sm initiative-collection-remove" title="{{ removeLabel|trans }}">
|
|
<i class="ri-delete-bin-line"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
{% endmacro %}
|
|
|
|
{% macro objective_row(objective) %}
|
|
{{ _self.row_start('mautic.program.objective.drag') }}
|
|
<div class="row">
|
|
{# The selected type's pictogram; updated by program.js when the type changes. #}
|
|
<div class="col-xs-1 text-center pt-lg">
|
|
<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 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) }}
|
|
<div class="row">
|
|
<div class="col-md-6">{{ form_row(objective.priority) }}</div>
|
|
<div class="col-md-6">{{ form_row(objective.isAchieved) }}</div>
|
|
</div>
|
|
{{ form_row(objective.description) }}
|
|
{{ form_widget(objective.position) }}
|
|
{{ _self.row_end('mautic.program.objective.remove') }}
|
|
{% endmacro %}
|
|
|
|
{% macro description_item_row(item) %}
|
|
{{ _self.row_start('mautic.program.description_item.drag') }}
|
|
<div class="row">
|
|
{# The selected type's pictogram; updated by program.js when the type changes. #}
|
|
<div class="col-xs-1 text-center pt-lg">
|
|
<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 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.program.description_item.remove') }}
|
|
{% endmacro %}
|
|
|
|
{% macro stakeholder_row(link) %}
|
|
{{ _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.roleInInitiative) }}</div>
|
|
</div>
|
|
{{ form_widget(link.position) }}
|
|
{{ _self.row_end('mautic.program.stakeholder.remove') }}
|
|
{% endmacro %}
|
|
|
|
{% 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.program.allocation_item.drag') }}
|
|
<div class="row">
|
|
{# The selected type's pictogram; updated by program.js when the type changes. #}
|
|
<div class="col-xs-1 text-center pt-lg">
|
|
<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 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>
|
|
</div>
|
|
</div>
|
|
{{ form_row(item.description) }}
|
|
<div class="row">
|
|
<div class="col-md-6">{{ form_row(item.plannedCost) }}</div>
|
|
<div class="col-md-6">{{ form_row(item.realCost) }}</div>
|
|
</div>
|
|
{{ form_widget(item.position) }}
|
|
{{ _self.row_end('mautic.program.allocation_item.remove') }}
|
|
{% endmacro %}
|
|
|
|
{% block content %}
|
|
{{ form_start(form) }}
|
|
<div class="pa-md pb-0">
|
|
{{ form_row(form.name) }}
|
|
</div>
|
|
|
|
{{ 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="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>
|
|
<div class="col-md-4">{{ form_row(form.owner) }}</div>
|
|
</div>
|
|
{% if entity.completedAt %}
|
|
<div class="form-group">
|
|
<label class="control-label">{{ 'mautic.program.field.completed_at'|trans }}</label>
|
|
<p class="form-control-static">{{ dateToFull(entity.completedAt) }}</p>
|
|
</div>
|
|
{% endif %}
|
|
<div class="row">
|
|
<div class="col-md-6">{{ form_row(form.startDate) }}</div>
|
|
<div class="col-md-6">{{ form_row(form.endDate) }}</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-6">{{ form_row(form.category) }}</div>
|
|
<div class="col-md-6">{{ form_row(form.isPublished) }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
{# Description: description items. #}
|
|
<div class="tab-pane bdr-w-0" id="initiative-tab-description" role="tabpanel">
|
|
{% set hasTypes = form.descriptionItems.vars.prototype.type.vars.choices is not empty %}
|
|
<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.program.description_item.no_types'|trans }}</div>
|
|
{% endif %}
|
|
<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 initiative-collection-list">
|
|
{% for item in form.descriptionItems %}
|
|
{{ _self.description_item_row(item) }}
|
|
{% endfor %}
|
|
</ul>
|
|
{% if hasTypes %}
|
|
<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>
|
|
{% do form.descriptionItems.setRendered %}
|
|
</div>
|
|
|
|
{# Objectives #}
|
|
<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="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.program.objective.no_types'|trans }}</div>
|
|
{% endif %}
|
|
<p class="text-muted initiative-collection-empty{% if form.objectives|length > 0 %} hide{% endif %}">
|
|
{{ 'mautic.program.objective.empty'|trans }}
|
|
</p>
|
|
<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 initiative-collection-add">
|
|
<i class="ri-add-line"></i> {{ 'mautic.program.objective.add'|trans }}
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
{% do form.objectives.setRendered %}
|
|
</div>
|
|
|
|
{# 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="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.program.field.allocation_items'|trans }}</h4>
|
|
{{ form_errors(form.allocationItems) }}
|
|
{% if not hasAllocationTypes %}
|
|
<div class="alert alert-info">{{ 'mautic.program.allocation_item.no_types'|trans }}</div>
|
|
{% endif %}
|
|
<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 initiative-collection-list">
|
|
{% for item in form.allocationItems %}
|
|
{{ _self.allocation_item_row(item) }}
|
|
{% endfor %}
|
|
</ul>
|
|
{% if hasAllocationTypes %}
|
|
<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 (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 initiative-collection-empty{% if form.stakeholders|length > 0 %} hide{% endif %}">
|
|
{{ 'mautic.program.stakeholder.empty'|trans }}
|
|
</p>
|
|
<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 initiative-collection-add">
|
|
<i class="ri-add-line"></i> {{ 'mautic.program.stakeholder.add'|trans }}
|
|
</button>
|
|
</div>
|
|
{% do form.stakeholders.setRendered %}
|
|
</div>
|
|
|
|
{# 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 initiative-collection-list">
|
|
{% for audience in form.audiences %}
|
|
{{ _self.audience_row(audience) }}
|
|
{% endfor %}
|
|
</ul>
|
|
<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.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="initiative-tab-tasks" role="tabpanel">
|
|
{% if entity.id %}
|
|
<p class="text-muted small">{{ 'mautic.program.task.manage_from_initiative_page'|trans }}</p>
|
|
{% endif %}
|
|
{{ include('@Program/Initiative/_task_table.html.twig', {
|
|
'initiative': entity,
|
|
'taskTree': taskTree|default([]),
|
|
'readOnly': true,
|
|
}) }}
|
|
</div>
|
|
</div>
|
|
{{ form_end(form) }}
|
|
{% endblock %}
|