Files
mautic-marketing-program-bu…/Resources/views/Task/form.html.twig
T
Alexandre Gain 71ff11390b 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.
2026-11-13 22:01:32 +01:00

149 lines
7.1 KiB
Twig

{% extends '@MauticCore/Default/content.html.twig' %}
{% block mauticContent %}programTask{% endblock %}
{% block headerTitle %}
{% if entity.id %}
{{ 'mautic.program.task.header.edit'|trans({'%name%': entity.name}) }}
{% else %}
{{ 'mautic.program.task.header.new'|trans }}
{% endif %}
{% endblock %}
{# 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="initiative-collection-row list-group-item">
<div class="row">
<div class="col-xs-1 text-center">
<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>
<div class="col-xs-10">
<div class="row">
<div class="col-md-7">{{ form_row(dependency.dependsOn) }}</div>
<div class="col-md-5">{{ form_row(dependency.dependencyType) }}</div>
</div>
{{ form_widget(dependency.position) }}
</div>
<div class="col-xs-1 text-right">
<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>
</div>
</li>
{% endmacro %}
{% macro raci_row(raci) %}
<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="{{ 'mautic.program.task.raci.drag'|trans }}" style="cursor: move;">
<i class="ri-draggable ri-lg"></i>
</span>
</div>
<div class="col-xs-10">
<div class="row">
<div class="col-md-4">{{ form_row(raci.role) }}</div>
<div class="col-md-8">{{ form_row(raci.stakeholders) }}</div>
</div>
{{ form_widget(raci.position) }}
</div>
<div class="col-xs-1 text-right">
<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>
</div>
</li>
{% endmacro %}
{% 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; 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('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 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) }}
{{ form_row(form.definitionOfDone) }}
</div>
</div>
<div class="col-md-3 height-auto">
<div class="pr-lg pl-lg pt-md pb-md">
{{ form_row(form.initiative) }}
{{ form_row(form.taskKind) }}
{{ form_row(form.startDate) }}
{{ form_row(form.endDate) }}
{% if form.status is defined %}
{{ 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.program.task.kind.phase_status_note'|trans }}</p>
{% endif %}
{{ form_row(form.plannedWork) }}
</div>
</div>
</div>
<div class="pa-md">
<div class="col-md-12">
{# 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.program.task.field.dependencies'|trans }}</h4>
{{ form_errors(form.dependencies) }}
<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 initiative-collection-list">
{% for dependency in form.dependencies %}
{{ _self.dependency_row(dependency) }}
{% endfor %}
</ul>
<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 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.program.task.field.raci'|trans }}</h4>
{{ form_errors(form.raci) }}
<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 initiative-collection-list">
{% for raci in form.raci %}
{{ _self.raci_row(raci) }}
{% endfor %}
</ul>
<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 %}
</div>
</div>
{{ form_row(form.buttons) }}
{# render_rest is false, so the hidden CSRF token must be rendered explicitly. #}
{{ form_widget(form._token) }}
{{ form_end(form, {'render_rest': false}) }}
{% endblock %}