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:
Alexandre Gain committed 2026-11-13 22:01:32 +01:00
1 parent 8268fad886
commit 71ff11390b
121 files changed
+5011 -2874

No files matched your search

+15 -25
View File
@@ -2,21 +2,21 @@
declare(strict_types=1);
namespace MauticPlugin\PlanBundle\Migrations;
namespace MauticPlugin\ProgramBundle\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\ORM\Tools\SchemaTool;
use Mautic\IntegrationsBundle\Migration\AbstractMigration;
use MauticPlugin\PlanBundle\Entity\Task;
use MauticPlugin\PlanBundle\Entity\TaskDependency;
use MauticPlugin\PlanBundle\Entity\TaskRaci;
use MauticPlugin\ProgramBundle\Entity\Task;
use MauticPlugin\ProgramBundle\Entity\TaskDependency;
use MauticPlugin\ProgramBundle\Entity\TaskRaci;
/**
* Since 0.13.0 tasks are reworked:
* - start_date and end_date become DATE (no time); existing values are truncated to the date;
* - new columns task_kind (default 'task'), definition_of_done, planned_work;
* - new tables plan_task_dependencies (dependency graph) and plan_task_raci with its
* plan_task_raci_stakeholders join table;
* - new tables initiative_task_dependencies (dependency graph) and initiative_task_raci with its
* initiative_task_raci_stakeholders join table;
* - the parent/child tree is dropped: parent_id and its index are removed, replaced by the
* dependency graph.
*
@@ -26,21 +26,11 @@ class Version_0_13_0 extends AbstractMigration
{
protected function isApplicable(Schema $schema): bool
{
$tasks = $this->concatPrefix(Task::TABLE_NAME);
if (!$schema->hasTable($tasks)) {
return false;
}
$table = $schema->getTable($tasks);
return !$table->hasColumn('task_kind')
|| !$table->hasColumn('definition_of_done')
|| !$table->hasColumn('planned_work')
|| $table->hasColumn('parent_id')
|| !$schema->hasTable($this->concatPrefix(TaskDependency::TABLE_NAME))
|| !$schema->hasTable($this->concatPrefix(TaskRaci::TABLE_NAME))
|| !$schema->hasTable($this->concatPrefix(TaskRaci::JOIN_TABLE_NAME));
// Historical migration: its changes were applied on every install that ran
// it before 0.16.0 (this plugin renamed Plan→Program/Initiative in 0.16.0), and
// a fresh install creates the current tables from the entity mapping. Never
// applicable anymore.
return false;
}
protected function up(): void
@@ -53,7 +43,7 @@ class Version_0_13_0 extends AbstractMigration
$this->addSql(sprintf(
"ALTER TABLE %s ADD task_kind VARCHAR(20) NOT NULL DEFAULT '%s'",
$tasks,
\MauticPlugin\PlanBundle\Entity\TaskKind::Task->value
\MauticPlugin\ProgramBundle\Entity\TaskKind::Task->value
));
}
if (!$table->hasColumn('definition_of_done')) {
@@ -91,8 +81,8 @@ class Version_0_13_0 extends AbstractMigration
$this->addSql($sql);
}
}
// The RACI join table comes with the TaskRaci entity's SQL (CREATE TABLE plan_task_raci_stakeholders),
// but it may be missing while plan_task_raci exists (a partial earlier run).
// The RACI join table comes with the TaskRaci entity's SQL (CREATE TABLE initiative_task_raci_stakeholders),
// but it may be missing while initiative_task_raci exists (a partial earlier run).
if (!$this->introspectSchema()->hasTable($this->concatPrefix(TaskRaci::JOIN_TABLE_NAME))) {
foreach ($this->getCreateTableSqls(TaskRaci::class, TaskRaci::JOIN_TABLE_NAME) as $sql) {
$this->addSql($sql);
@@ -107,7 +97,7 @@ class Version_0_13_0 extends AbstractMigration
/**
* The CREATE TABLE statements of one of this migration's entities, from Doctrine's SchemaTool —
* the entity's table and, for TaskRaci, its join table plan_task_raci_stakeholders too.
* the entity's table and, for TaskRaci, its join table initiative_task_raci_stakeholders too.
*
* @param class-string $entityClass
*