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
+124
-55
@@ -3,70 +3,96 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'name' => 'Plan',
|
||||
'description' => 'Plan plugin for Mautic.',
|
||||
'version' => '0.13.0',
|
||||
'name' => 'Program',
|
||||
'description' => 'Program plugin for Mautic.',
|
||||
'version' => '0.16.0',
|
||||
'author' => 'Experiential',
|
||||
|
||||
'routes' => [
|
||||
'main' => [
|
||||
'plan_index' => [
|
||||
'path' => '/plans/{page}',
|
||||
'controller' => 'MauticPlugin\PlanBundle\Controller\PlanController::indexAction',
|
||||
'initiative_index' => [
|
||||
'path' => '/programs/{page}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\InitiativeController::indexAction',
|
||||
],
|
||||
// objectAction: view, new, edit, delete, batchDelete.
|
||||
'plan_action' => [
|
||||
'path' => '/plans/{objectAction}/{objectId}',
|
||||
'controller' => 'MauticPlugin\PlanBundle\Controller\PlanController::executeAction',
|
||||
'initiative_action' => [
|
||||
'path' => '/programs/{objectAction}/{objectId}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\InitiativeController::executeAction',
|
||||
],
|
||||
'plan_task_index' => [
|
||||
'path' => '/plan-tasks/{page}',
|
||||
'controller' => 'MauticPlugin\PlanBundle\Controller\TaskController::indexAction',
|
||||
'initiative_task_index' => [
|
||||
'path' => '/program-tasks/{page}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\TaskController::indexAction',
|
||||
],
|
||||
// objectAction: new (optional ?plan=ID), edit, delete, batchDelete.
|
||||
'plan_task_action' => [
|
||||
'path' => '/plan-tasks/{objectAction}/{objectId}',
|
||||
'controller' => 'MauticPlugin\PlanBundle\Controller\TaskController::executeAction',
|
||||
// objectAction: new (optional ?initiative=ID), edit, delete, batchDelete.
|
||||
'initiative_task_action' => [
|
||||
'path' => '/program-tasks/{objectAction}/{objectId}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\TaskController::executeAction',
|
||||
],
|
||||
'plan_stakeholder_index' => [
|
||||
'path' => '/plan-stakeholders/{page}',
|
||||
'controller' => 'MauticPlugin\PlanBundle\Controller\StakeholderController::indexAction',
|
||||
'initiative_stakeholder_index' => [
|
||||
'path' => '/program-stakeholders/{page}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\StakeholderController::indexAction',
|
||||
],
|
||||
// objectAction: new, edit, delete, batchDelete.
|
||||
'plan_stakeholder_action' => [
|
||||
'path' => '/plan-stakeholders/{objectAction}/{objectId}',
|
||||
'controller' => 'MauticPlugin\PlanBundle\Controller\StakeholderController::executeAction',
|
||||
'initiative_stakeholder_action' => [
|
||||
'path' => '/program-stakeholders/{objectAction}/{objectId}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\StakeholderController::executeAction',
|
||||
],
|
||||
'initiative_audience_index' => [
|
||||
'path' => '/program-audiences/{page}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\AudienceController::indexAction',
|
||||
],
|
||||
// objectAction: new, edit, delete, batchDelete.
|
||||
'initiative_audience_action' => [
|
||||
'path' => '/program-audiences/{objectAction}/{objectId}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\AudienceController::executeAction',
|
||||
],
|
||||
// UTM Taxonomies: a placeholder page under Programs for now.
|
||||
'program_utm_taxonomy_index' => [
|
||||
'path' => '/program-utm-taxonomies/{page}',
|
||||
'controller' => 'MauticPlugin\ProgramBundle\Controller\UtmTaxonomyController::indexAction',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
// Top-level "Planning" menu. Future planning objects go in its children, after Plans.
|
||||
// Top-level "Programs" menu. Future program objects go in its children, after Initiatives.
|
||||
'menu' => [
|
||||
'main' => [
|
||||
'mautic.plan.menu.root' => [
|
||||
'id' => 'plan_root',
|
||||
'mautic.program.menu.root' => [
|
||||
'id' => 'program_root',
|
||||
'iconClass' => 'ri-calendar-line',
|
||||
'access' => ['plan:plans:viewown', 'plan:plans:viewother', 'plan:tasks:viewown', 'plan:tasks:viewother', 'plan:stakeholders:viewown', 'plan:stakeholders:viewother'],
|
||||
'access' => ['program:initiatives:viewown', 'program:initiatives:viewother', 'program:tasks:viewown', 'program:tasks:viewother', 'program:stakeholders:viewown', 'program:stakeholders:viewother', 'program:audiences:viewown', 'program:audiences:viewother'],
|
||||
'priority' => 5,
|
||||
'children' => [
|
||||
'mautic.plan.menu.index' => [
|
||||
'id' => 'plan_index',
|
||||
'route' => 'plan_index',
|
||||
'access' => ['plan:plans:viewown', 'plan:plans:viewother'],
|
||||
'mautic.program.menu.index' => [
|
||||
'id' => 'initiative_index',
|
||||
'route' => 'initiative_index',
|
||||
'access' => ['program:initiatives:viewown', 'program:initiatives:viewother'],
|
||||
'priority' => 100,
|
||||
],
|
||||
'mautic.plan.task.menu.index' => [
|
||||
'id' => 'plan_task_index',
|
||||
'route' => 'plan_task_index',
|
||||
'access' => ['plan:tasks:viewown', 'plan:tasks:viewother'],
|
||||
'mautic.program.task.menu.index' => [
|
||||
'id' => 'initiative_task_index',
|
||||
'route' => 'initiative_task_index',
|
||||
'access' => ['program:tasks:viewown', 'program:tasks:viewother'],
|
||||
'priority' => 90,
|
||||
],
|
||||
'mautic.plan.stakeholder.menu.index' => [
|
||||
'id' => 'plan_stakeholder_index',
|
||||
'route' => 'plan_stakeholder_index',
|
||||
'access' => ['plan:stakeholders:viewown', 'plan:stakeholders:viewother'],
|
||||
'mautic.program.stakeholder.menu.index' => [
|
||||
'id' => 'initiative_stakeholder_index',
|
||||
'route' => 'initiative_stakeholder_index',
|
||||
'access' => ['program:stakeholders:viewown', 'program:stakeholders:viewother'],
|
||||
'priority' => 80,
|
||||
],
|
||||
'mautic.program.audience.menu.index' => [
|
||||
'id' => 'initiative_audience_index',
|
||||
'route' => 'initiative_audience_index',
|
||||
'access' => ['program:audiences:viewown', 'program:audiences:viewother'],
|
||||
'priority' => 70,
|
||||
],
|
||||
'mautic.program.utm_taxonomy.menu.index' => [
|
||||
'id' => 'program_utm_taxonomy_index',
|
||||
'route' => 'program_utm_taxonomy_index',
|
||||
'access' => ['program:initiatives:viewown', 'program:initiatives:viewother'],
|
||||
'priority' => 60,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -74,15 +100,15 @@ return [
|
||||
|
||||
'services' => [
|
||||
'integrations' => [
|
||||
'mautic.plan.integration' => [
|
||||
'class' => MauticPlugin\PlanBundle\Integration\PlanIntegration::class,
|
||||
'mautic.program.integration' => [
|
||||
'class' => MauticPlugin\ProgramBundle\Integration\ProgramIntegration::class,
|
||||
'tags' => [
|
||||
'mautic.integration',
|
||||
'mautic.basic_integration',
|
||||
],
|
||||
],
|
||||
'mautic.plan.integration.configuration' => [
|
||||
'class' => MauticPlugin\PlanBundle\Integration\Support\ConfigSupport::class,
|
||||
'mautic.program.integration.configuration' => [
|
||||
'class' => MauticPlugin\ProgramBundle\Integration\Support\ProgramConfigSupport::class,
|
||||
'tags' => [
|
||||
'mautic.config_integration',
|
||||
],
|
||||
@@ -90,30 +116,73 @@ return [
|
||||
],
|
||||
],
|
||||
|
||||
// Registers "plan" as a category type (Settings > Categories), used by Plan::$category.
|
||||
// Registers "initiative" as a category type (Settings > Categories), used by Initiative::$category.
|
||||
'categories' => [
|
||||
'plan' => [
|
||||
'class' => MauticPlugin\PlanBundle\Entity\Plan::class,
|
||||
'label' => 'mautic.plan.category.type',
|
||||
'initiative' => [
|
||||
'class' => MauticPlugin\ProgramBundle\Entity\Initiative::class,
|
||||
'label' => 'mautic.program.category.type',
|
||||
],
|
||||
],
|
||||
|
||||
'parameters' => [
|
||||
// The currency of every amount in the plugin (ISO 4217), edited in Settings > Configuration >
|
||||
// Plan Settings. Read it through CurrencyProvider.
|
||||
'plan_currency' => 'EUR',
|
||||
// Program Settings. Read it through CurrencyProvider.
|
||||
'program_currency' => 'EUR',
|
||||
|
||||
// Item types, edited in Settings > Configuration > Plan Settings. Read them through ItemTypeProvider.
|
||||
// Item types, edited in Settings > Configuration > Program Settings. Read them through ItemTypeProvider.
|
||||
// Each is a list of ['key' => …, 'names' => [locale => …], 'descriptions' => [locale => …]],
|
||||
// plus 'icon' => a Remix Icon class for description, allocation, objective, task and stakeholder types.
|
||||
'plan_description_item_types' => [],
|
||||
'plan_allocation_item_types' => [],
|
||||
'plan_objective_types' => [],
|
||||
'plan_task_types' => [],
|
||||
'plan_stakeholder_types' => [],
|
||||
'program_description_item_types' => [],
|
||||
'program_allocation_item_types' => [],
|
||||
'program_objective_types' => [],
|
||||
'program_task_types' => [],
|
||||
'program_stakeholder_types' => [],
|
||||
|
||||
// Default region (ISO 3166-1 alpha-2, e.g. FR) used to parse stakeholder phone numbers typed
|
||||
// without a country prefix, on save. Read through StakeholderModel.
|
||||
'plan_stakeholder_phone_region' => 'FR',
|
||||
'program_stakeholder_phone_region' => 'FR',
|
||||
|
||||
// Which audience persona attributes are offered on the audience forms, one toggle per attribute
|
||||
// (Settings > Configuration > Program Settings). Read through AudienceAttributes; a parameter set
|
||||
// to false turns the attribute off, and one that was never saved means enabled.
|
||||
'program_audience_attribute_tagline' => true,
|
||||
'program_audience_attribute_profile' => true,
|
||||
'program_audience_attribute_motivations' => true,
|
||||
'program_audience_attribute_barriers' => true,
|
||||
'program_audience_attribute_frustrations' => true,
|
||||
'program_audience_attribute_triggers' => true,
|
||||
'program_audience_attribute_decision_role' => true,
|
||||
'program_audience_attribute_tones' => true,
|
||||
'program_audience_attribute_channels' => true,
|
||||
'program_audience_attribute_stages' => true,
|
||||
'program_audience_attribute_size' => true,
|
||||
|
||||
// The values of an audience's closed attributes, edited in Settings > Configuration > Program
|
||||
// Settings. Each is a list of ['key' => …, 'names' => [locale => …]], read through
|
||||
// ItemTypeProvider (kinds "audience_decision_role" and "audience_tone").
|
||||
'program_audience_decision_roles' => [],
|
||||
'program_audience_tones' => [],
|
||||
|
||||
// Which audience persona attributes are offered on the audience forms, one toggle per attribute
|
||||
// (Settings > Configuration > Program Settings). The parameter names follow
|
||||
// AudienceAttributes::toggleParameter(); a parameter set to false turns the attribute off.
|
||||
// Defaults are handled by AudienceAttributes (enabled unless set to false).
|
||||
'program_audience_attribute_tagline' => true,
|
||||
'program_audience_attribute_profile' => true,
|
||||
'program_audience_attribute_motivations' => true,
|
||||
'program_audience_attribute_barriers' => true,
|
||||
'program_audience_attribute_frustrations' => true,
|
||||
'program_audience_attribute_triggers' => true,
|
||||
'program_audience_attribute_decision_role' => true,
|
||||
'program_audience_attribute_tones' => true,
|
||||
'program_audience_attribute_channels' => true,
|
||||
'program_audience_attribute_stages' => true,
|
||||
'program_audience_attribute_size' => true,
|
||||
|
||||
// The values of an audience's closed attributes, edited in Settings > Configuration > Program
|
||||
// Settings. Each is a list of ['key' => …, 'names' => [locale => …]], read through
|
||||
// ItemTypeProvider (kinds "audience_decision_role" and "audience_tone").
|
||||
'program_audience_decision_roles' => [],
|
||||
'program_audience_tones' => [],
|
||||
],
|
||||
];
|
||||
+10
-8
@@ -16,17 +16,19 @@ return function (ContainerConfigurator $configurator): void {
|
||||
'Tests',
|
||||
];
|
||||
|
||||
$services->load('MauticPlugin\\PlanBundle\\', '../')
|
||||
$services->load('MauticPlugin\\ProgramBundle\\', '../')
|
||||
->exclude('../{'.implode(',', array_merge(MauticCoreExtension::DEFAULT_EXCLUDES, $excludes)).'}');
|
||||
|
||||
// Entity/ is excluded above; repositories must still be services for Doctrine to build them.
|
||||
$services->load('MauticPlugin\\PlanBundle\\Entity\\', '../Entity/*Repository.php')
|
||||
$services->load('MauticPlugin\\ProgramBundle\\Entity\\', '../Entity/*Repository.php')
|
||||
->tag(Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass::REPOSITORY_SERVICE_TAG);
|
||||
|
||||
// Lets core resolve the model with getModel('plan') / getModel('plan.plan').
|
||||
$services->alias('mautic.plan.model.plan', MauticPlugin\PlanBundle\Model\PlanModel::class);
|
||||
// getModel('plan.task').
|
||||
$services->alias('mautic.plan.model.task', MauticPlugin\PlanBundle\Model\TaskModel::class);
|
||||
// getModel('plan.stakeholder').
|
||||
$services->alias('mautic.plan.model.stakeholder', MauticPlugin\PlanBundle\Model\StakeholderModel::class);
|
||||
// Lets core resolve the model with getModel('program').
|
||||
$services->alias('mautic.program.model.initiative', MauticPlugin\ProgramBundle\Model\InitiativeModel::class);
|
||||
// getModel('program.task').
|
||||
$services->alias('mautic.program.model.task', MauticPlugin\ProgramBundle\Model\TaskModel::class);
|
||||
// getModel('program.stakeholder').
|
||||
$services->alias('mautic.program.model.stakeholder', MauticPlugin\ProgramBundle\Model\StakeholderModel::class);
|
||||
// getModel('program.audience').
|
||||
$services->alias('mautic.program.model.audience', MauticPlugin\ProgramBundle\Model\AudienceModel::class);
|
||||
};
|
||||
Reference in new issue
Block a user