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

+12 -8
View File
@@ -2,17 +2,17 @@
declare(strict_types=1);
namespace MauticPlugin\PlanBundle\Migrations;
namespace MauticPlugin\ProgramBundle\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Mautic\IntegrationsBundle\Migration\AbstractMigration;
use MauticPlugin\PlanBundle\Entity\Plan;
use MauticPlugin\PlanBundle\Entity\PlanAllocationItem;
use MauticPlugin\ProgramBundle\Entity\Initiative;
use MauticPlugin\ProgramBundle\Entity\InitiativeAllocationItem;
/**
* Since 0.8.0 every amount is in one general currency (Settings > Configuration > Plan Settings, parameter
* plan_currency), so the per-record currency columns are dropped: plans.currency,
* plan_allocation_items.planned_currency and plan_allocation_items.real_currency. Amounts are kept as they
* program_currency), so the per-record currency columns are dropped: plans.currency,
* initiative_allocation_items.planned_currency and initiative_allocation_items.real_currency. Amounts are kept as they
* are. Each column is dropped only if it exists.
*/
class Version_0_8_0 extends AbstractMigration
@@ -21,13 +21,17 @@ class Version_0_8_0 extends AbstractMigration
* Table => columns to drop.
*/
private const COLUMNS = [
Plan::TABLE_NAME => ['currency'],
PlanAllocationItem::TABLE_NAME => ['planned_currency', 'real_currency'],
Initiative::TABLE_NAME => ['currency'],
InitiativeAllocationItem::TABLE_NAME => ['planned_currency', 'real_currency'],
];
protected function isApplicable(Schema $schema): bool
{
return [] !== $this->getColumnsToDrop($schema);
// 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