refactor(plugin): rebrand as MT3SMarketingProgram, release 0.17.0

Rename the plugin's vendor/namespace from experiential/Program to mt3s/MT3SMarketingProgram (composer: mt3s/mautic-marketing-program-bundle):

- ProgramBundle -> MT3SMarketingProgramBundle; extension, integration,
  config support, permissions, events and twig extension renamed likewise
- Initiative* -> Program*: controller (InitiativeController ->
  ProgramController), model, entities, repositories, form types and views
  (new _tabs/_task_table/_tab_table_filter partials, details page)
- Settings config form theme -> _config_mt3smarketingprogramconfig_widget;
  routes and translations re-prefixed (mt3s_marketing_program_*)
- Assets: icon.svg -> mt3s-mp-icon.svg; program.js -> mt3s-mp-program.js
  (OnLoad hooks renamed mt3sMpProgram*)
- Add Command/RefreshStatsCommand; Migrations/Version_0_17_0.php renames
  the tables to mt3s_mp_program_*
This commit is contained in:
Alexandre Gain committed 2026-11-15 17:48:01 +01:00
1 parent 687d33d30c
commit ea88b7a772
131 files changed
+3238 -2836

No files matched your search

+109 -106
View File
@@ -1,12 +1,12 @@
# Mautic Program plugin
# Mautic Marketing Program plugin
A custom Mautic 7 plugin (`ProgramBundle`) for managing programs: a name, status, owner, dates, budget and category, with their initiatives.
A custom Mautic 7 plugin (`MT3SMarketingProgramBundle`) for managing marketing programs: a name, status, owner, dates, budget and category, with their mt3s_mp_programs.
This repository holds only the plugin source. The bundle files are at the repository root, and Mautic loads them from `docroot/plugins/ProgramBundle`. The plugin was called `PlanBundle` (and plans `Plan`) before 0.16.0: see *Rename history* below.
This repository holds only the plugin source. The bundle files are at the repository root, and Mautic loads them from `docroot/plugins/MT3SMarketingProgramBundle`. The plugin was called `PlanBundle` before 0.16.0 and `ProgramBundle` (with programs) before 0.17.0: see *Rename history* below.
## Installation
1. Copy or clone this repository into your Mautic installation as `docroot/plugins/ProgramBundle`. The folder name must be `ProgramBundle`.
1. Copy or clone this repository into your Mautic installation as `docroot/plugins/MT3SMarketingProgramBundle`. The folder name must be `MT3SMarketingProgramBundle`.
2. Clear the cache and register the plugin:
```bash
@@ -14,11 +14,11 @@ This repository holds only the plugin source. The bundle files are at the reposi
php bin/console mautic:plugins:reload
```
3. In Mautic, go to **Settings > Plugins**, open **Program** and publish it.
3. In Mautic, go to **Settings > Plugins**, open **MT3S Marketing Program** and publish it.
Initiatives are listed under **Programs > Initiatives** in the main menu (URL `/s/programs`), tasks under **Programs > Tasks** (URL `/s/program-tasks`), the stakeholder directory under **Programs > Stakeholders** (URL `/s/program-stakeholders`), and the audience directory under **Programs > Audiences** (URL `/s/program-audiences`). The item type lists are edited under **Programs > Item types** (URL `/s/program-item-types`), below **UTM Taxonomies** (URL `/s/program-utm-taxonomies`, a placeholder for a coming feature). Users who aren't administrators need a role with the **Program Permissions** set in **Settings > Roles**.
Programs are listed under **Marketing Programs** in the main menu (URL `/s/marketing-programs`), tasks under **Marketing Programs > Tasks** (URL `/s/marketing-program-tasks`), the stakeholder directory under **Marketing Programs > Stakeholders** (URL `/s/marketing-program-stakeholders`), and the audience directory under **Marketing Programs > Audiences** (URL `/s/marketing-program-audiences`). The item type lists are edited under **Marketing Programs > Item types** (URL `/s/marketing-program-item-types`). The UTM Taxonomies page (URL `/s/marketing-program-utm-taxonomies`) is a placeholder for a coming feature and is kept out of the menu. Users who aren't administrators need a role with the **Marketing Program Permissions** set in **Settings > Roles**.
Before using the items of an initiative's **Insights**, **Objectives**, **Allocations** and **Tasks** tabs, set up their types under **Programs > Item types** (`program:itemtypes:view` to see the page, `program:itemtypes:edit` to save it).
Before using the items of a program's **Insights**, **Objectives**, **Allocations** and **Tasks** tabs, set up their types under **Marketing Programs > Item types** (`mt3smarketingprogram:itemtypes:view` to see the page, `mt3smarketingprogram:itemtypes:edit` to save it).
## Development
@@ -35,7 +35,7 @@ In the dev environment's `.env`, point it at this plugin:
PLUGIN_PLAN_PATH=../mautic-plugin-plan
```
The dev environment mounts it as `docroot/plugins/ProgramBundle`.
The dev environment mounts it as `docroot/plugins/MT3SMarketingProgramBundle`.
Run all commands from the `mautic-dev-env` folder:
@@ -52,175 +52,178 @@ For the complete list of commands, see the dev environment's README.
The plugin uses the IntegrationsBundle conventions:
- `ProgramBundle.php`: the bundle class
- `MT3SMarketingProgramBundle.php`: the bundle class
- `Config/config.php`: metadata, routes, menu and integration service tags
- `Config/services.php`: autowires and autoconfigures every class in the bundle
- `DependencyInjection/ProgramExtension.php`: loads `Config/services.php`
- `Integration/ProgramIntegration.php`: the integration that is listed on the Plugins page
- `Integration/Support/ProgramConfigSupport.php`: the configuration form for the integration
- `DependencyInjection/MT3SMarketingProgramExtension.php`: loads `Config/services.php`
- `Event/MT3SMarketingProgramEvents.php` and `Event/ProgramEvent.php`: the plugin's `mt3s.marketing_program.*` event names and their payload, dispatched by `Model/ProgramModel.php` on save and delete
- `Command/RefreshStatsCommand.php`: `mt3s:marketing-program:refresh-stats`, recomputes and prints the per-program statistics
- `Integration/MT3SMarketingProgramIntegration.php`: the integration that is listed on the Plugins page
- `Integration/Support/MT3SMarketingProgramConfigSupport.php`: the configuration form for the integration
- `Translations/en_US/messages.ini` and `validators.ini`: UI strings and validation messages
### Pages and permissions
- `Controller/InitiativeController.php`: list, detail page, create, edit and delete (single and batch), built on core's `AbstractStandardFormController`
- `Resources/views/Initiative/list.html.twig`: the list. An initiative's name opens its detail page.
- `Resources/views/Initiative/form.html.twig` and `details.html.twig`: the create/edit form and the detail page. Both have the same seven tabs, from `_tabs.html.twig`: **Details**, **Insights** (description items), **Objectives**, **Allocations** (planned budget, currency and allocation items), **Audiences**, **Stakeholders** and **Tasks**.
- `Resources/views/Initiative/_task_table.html.twig`: the initiative's tasks in the Tasks tab. It has the harmonized tab columns (pictogram, Type, Name with kind badge for milestones and phases, Description, Start date, End date, Status — no ID), one row per task, no tree: a phase's or milestone's badge marks it in the name column. On the detail page it has an **Add task** button, links to each task and the filter/sort of the other tabs. On the initiative form it is read-only (no links, no filter), so that following a link doesn't drop unsaved changes.
- `Controller/TaskController.php` and `Resources/views/Task/`: the task list, and the create/edit form (**Programs > Tasks**). `new?initiative=ID` preselects the initiative. After Save or Cancel, the user goes back to where the form was opened from. Opened from **Programs > Tasks**, that's the task list. Opened from an initiative's Tasks tab, whose links carry `returnTo=initiative`, that's the initiative (its new initiative, if the task was moved). The origin is stored in the session when the form is opened, because the form posts without the query string.
- `Controller/UtmTaxonomyController.php` and `Resources/views/UtmTaxonomy/`: the placeholder page for the coming UTM Taxonomies feature.
- `Controller/ItemTypesController.php` and `Resources/views/ItemTypes/form.html.twig`: the Item types page (**Programs > Item types**), below UTM Taxonomies in the menu. The type lists that used to be sections of **Settings > Configuration > Program Settings** (insights, allocation, objective, task, stakeholder types and the audience decision roles and tones) are edited here. `Form/Type/ItemTypesType.php` builds the lists, `Service/ItemTypeInUseGuard.php` refuses to remove a type that items still use, and the page saves through core's `Configurator` exactly like the Settings pages do: merge into `config/local.php`, write, refresh the config cache. **Settings > Configuration > Program Settings** keeps only the plugin's general settings: the currency, the stakeholder phone region and the audience attribute toggles.
- `Assets/js/program.js`: on the form, the objectives editor (add, remove, drag-and-drop ordering), and after a failed save, marking the tabs that contain errors with an icon and opening the first one. Started by `Mautic.programOnLoad()`.
- `Controller/ProgramController.php`: list, detail page, create, edit and delete (single and batch), built on core's `AbstractStandardFormController`
- `Resources/views/Program/list.html.twig`: the list. A program's name opens its detail page.
- `Resources/views/Program/form.html.twig` and `details.html.twig`: the create/edit form and the detail page. Both have the same seven tabs, from `_tabs.html.twig`: **Details**, **Insights** (description items), **Objectives**, **Allocations** (planned budget, currency and allocation items), **Audiences**, **Stakeholders** and **Tasks**.
- `Resources/views/Program/_task_table.html.twig`: the program's tasks in the Tasks tab. It has the harmonized tab columns (pictogram, Type, Name with kind badge for milestones and phases, Description, Start date, End date, Status — no ID), one row per task, no tree: a phase's or milestone's badge marks it in the name column. On the detail page it has an **Add task** button, links to each task and the filter/sort of the other tabs. On the program form it is read-only (no links, no filter), so that following a link doesn't drop unsaved changes.
- `Controller/TaskController.php` and `Resources/views/Task/`: the task list, and the create/edit form (**Marketing Programs > Tasks**). `new?program=ID` preselects the program. After Save or Cancel, the user goes back to where the form was opened from. Opened from **Marketing Programs > Tasks**, that's the task list. Opened from a program's Tasks tab, whose links carry `returnTo=program`, that's the program (its new program, if the task was moved). The origin is stored in the session when the form is opened, because the form posts without the query string.
- `Controller/UtmTaxonomyController.php` and `Resources/views/UtmTaxonomy/`: the placeholder page for the coming UTM Taxonomies feature, kept out of the menu (reachable at `/s/marketing-program-utm-taxonomies`).
- `Controller/ItemTypesController.php` and `Resources/views/ItemTypes/form.html.twig`: the Item types page (**Marketing Programs > Item types**). The type lists that used to be sections of **Settings > Configuration > Marketing Program Settings** (insights, allocation, objective, task, stakeholder types and the audience decision roles and tones) are edited here. `Form/Type/ItemTypesType.php` builds the lists, `Service/ItemTypeInUseGuard.php` refuses to remove a type that items still use, and the page saves through core's `Configurator` exactly like the Settings pages do: merge into `config/local.php`, write, refresh the config cache. **Settings > Configuration > Marketing Program Settings** keeps only the plugin's general settings: the currency, the stakeholder phone region and the audience attribute toggles.
- `Assets/js/mt3s-mp-program.js`: on the form, the objectives editor (add, remove, drag-and-drop ordering), and after a failed save, marking the tabs that contain errors with an icon and opening the first one. Started by `Mautic.mt3sMpProgramOnLoad()`.
The initiative's tab panes deliberately have no Bootstrap `fade` class. Core reopens the last tab used on a page (`12.tabs.js`), and the plugin opens the tab with an error after a failed save. With `fade`, those two `tab('show')` calls overlapped within the 150 ms transition and left two panes visible at once, so the Tasks tab also showed the objectives.
The program's tab panes deliberately have no Bootstrap `fade` class. Core reopens the last tab used on a page (`12.tabs.js`), and the plugin opens the tab with an error after a failed save. With `fade`, those two `tab('show')` calls overlapped within the 150 ms transition and left two panes visible at once, so the Tasks tab also showed the objectives.
Which tab opens on an initiative's detail page and form (`Mautic.programInitTabs`):
Which tab opens on a program's detail page and form (`Mautic.mt3sMpProgramInitTabs`):
- The tab last used for an initiative is remembered for the browser session (`sessionStorage`, key `mautic.program.tab.<initiative id>`). The detail page and the form both reopen it, so Edit and Save keep the current tab. Cancel goes to the initiatives list, as in core.
- The tab last used for a program is remembered for the browser session (`sessionStorage`, key `mt3s.marketing_program.tab.<program id>`). The detail page and the form both reopen it, so Edit and Save keep the current tab. Cancel goes to the mt3s_mp_programs list, as in core.
- After a failed save, the first tab with an error opens instead, and every tab with an error gets a warning icon.
- Core reopens its own remembered tab on page load and after every Ajax request (`Mautic.rememberActiveTabs`), in an order that varies. `program.js` wraps that function, so the initiative's choice is applied right after core's restore, and only during the page load.
- Core reopens its own remembered tab on page load and after every Ajax request (`Mautic.rememberActiveTabs`), in an order that varies. `mt3s-mp-program.js` wraps that function, so the program's choice is applied right after core's restore, and only during the page load.
- A tab counts as having an error only if it shows an error message (`.help-block .alert-danger`), not just because an element has the `has-error` class. Mautic's own `checkbox_row` theme adds `has-error` to every checkbox: it tests `errors|length is not empty`, and `0` isn't "empty" in Twig. Every objective's "Achieved" checkbox would otherwise put a warning icon on the Objectives tab, and opening that tab on load looked like a jump to Objectives.
- `Security/Permissions/ProgramPermissions.php`: the permissions shown in **Settings > Roles**
- `Security/Permissions/MT3SMarketingProgramPermissions.php`: the permissions shown in **Settings > Roles**
The main menu has a top-level **Programs** entry, with **Initiatives**, **Tasks**, **Stakeholders**, **Audiences** and **UTM Taxonomies** as its items. Add future pages as more children of `mautic.program.menu.root` in `Config/config.php`.
The main menu has a top-level **Programs** entry, with **Programs**, **Tasks**, **Stakeholders**, **Audiences** and **Item types** as its items. Add future pages as more children of `mt3s.marketing_program.menu.root` in `Config/config.php`.
The **Audiences** tab lists the initiative's audiences, harmonized like the other tabs: pictogram (fixed per audience type), Type, Name (a link to the audience's page in the directory), Priority in this initiative, Stages, Estimated size, Value proposition, Preferred channels.
The **Audiences** tab lists the program's audiences, harmonized like the other tabs: pictogram (fixed per audience type), Type, Name (a link to the audience's page in the directory), Priority in this program, Stages, Estimated size, Value proposition, Preferred channels.
| Route | URL | Purpose |
| --- | --- | --- |
| `initiative_index` | `/s/programs/{page}` | Initiative list, with search on name |
| `initiative_action` | `/s/programs/{objectAction}/{objectId}` | `view`, `new`, `edit`, `delete`, `batchDelete` |
| `initiative_task_index` | `/s/program-tasks/{page}` | Task list, with search on name and description |
| `initiative_task_action` | `/s/program-tasks/{objectAction}/{objectId}` | `new` (optional `?initiative=ID`), `edit`, `delete`, `batchDelete` |
| `initiative_stakeholder_index` | `/s/program-stakeholders/{page}` | Stakeholder directory, with search on name, email, role and type |
| `initiative_stakeholder_action` | `/s/program-stakeholders/{objectAction}/{objectId}` | `new`, `edit`, `delete`, `batchDelete` |
| `initiative_audience_index` | `/s/program-audiences/{page}` | Audience directory, with search on name |
| `initiative_audience_action` | `/s/program-audiences/{objectAction}/{objectId}` | `new`, `edit`, `view`, `delete`, `batchDelete` |
| `program_utm_taxonomy_index` | `/s/program-utm-taxonomies/{page}` | UTM Taxonomies (placeholder) |
| `mt3s_marketing_program_index` | `/s/marketing-programs/{page}` | Program list, with search on name |
| `mt3s_marketing_program_action` | `/s/marketing-programs/{objectAction}/{objectId}` | `view`, `new`, `edit`, `delete`, `batchDelete` |
| `mt3s_marketing_program_task_index` | `/s/marketing-program-tasks/{page}` | Task list, with search on name and description |
| `mt3s_marketing_program_task_action` | `/s/marketing-program-tasks/{objectAction}/{objectId}` | `new` (optional `?program=ID`), `edit`, `delete`, `batchDelete` |
| `mt3s_marketing_program_stakeholder_index` | `/s/marketing-program-stakeholders/{page}` | Stakeholder directory, with search on name, email, role and type |
| `mt3s_marketing_program_stakeholder_action` | `/s/marketing-program-stakeholders/{objectAction}/{objectId}` | `new`, `edit`, `delete`, `batchDelete` |
| `mt3s_marketing_program_audience_index` | `/s/marketing-program-audiences/{page}` | Audience directory, with search on name |
| `mt3s_marketing_program_audience_action` | `/s/marketing-program-audiences/{objectAction}/{objectId}` | `new`, `edit`, `view`, `delete`, `batchDelete` |
| `mt3s_marketing_program_utm_taxonomy_index` | `/s/marketing-program-utm-taxonomies/{page}` | UTM Taxonomies (placeholder, off-menu) |
The initiative templates don't pass `routeBase` to core's button helpers (`page_actions`, `list_actions`) when a "close" button is involved: from `routeBase`, core builds `mautic_<routeBase>_*` route names, which don't exist in this plugin. The other buttons use the `actionRoute` (`initiative_action`) that the controller passes to the template.
The program templates don't pass `routeBase` to core's button helpers (`page_actions`, `list_actions`) when a "close" button is involved: from `routeBase`, core builds `mautic_<routeBase>_*` route names, which don't exist in this plugin. The other buttons use the `actionRoute` (`mt3s_marketing_program_action`) that the controller passes to the template.
Permission keys:
- `program:initiatives:*`, `program:tasks:*`, `program:stakeholders:*` and `program:audiences:*`: `viewown`, `viewother`, `editown`, `editother`, `create`, `deleteown`, `deleteother`, `publishown`, `publishother`, `full`. "Own" means items the user created (`createdBy`), as in core objects.
- `program:categories:*`: managing the `program` category type.
- `mt3smarketingprogram:programs:*`, `mt3smarketingprogram:tasks:*`, `mt3smarketingprogram:stakeholders:*` and `mt3smarketingprogram:audiences:*`: `viewown`, `viewother`, `editown`, `editother`, `create`, `deleteown`, `deleteother`, `publishown`, `publishother`, `full`. "Own" means items the user created (`createdBy`), as in core objects.
- `mt3smarketingprogram:categories:*`: managing the `program` category type.
### The Initiative object
### The Program object
- `Entity/Initiative.php`: the entity (table `initiatives`), with its Doctrine mapping and validation rules
- `Entity/InitiativeStatus.php`: the status enum (`draft`, `planned`, `active`, `paused`, `completed`, `archived`)
- `Entity/InitiativeRepository.php`: the repository
- `Entity/InitiativeObjective.php` and `InitiativeObjectiveRepository.php`: an initiative's objectives (table `initiative_objectives`): type (with its pictogram), title, description, position and an "achieved" flag
- `Entity/Audience.php`, `AudienceType.php`, `AudiencePriority.php` and `AudienceRepository.php`: the audiences of the global directory (table `initiative_audiences`, `plan_targets` before 0.15.0): name, a fixed type (persona, ICP, broad audience, lifecycle cohort, partner/influencer — each with its own pictogram), a tagline, the Mautic segments that hold this audience's contacts (see below), and the persona attributes the admin switched on (**Settings > Configuration > Program Settings**, one toggle per attribute, so a b2b install and a b2c install define their personas differently): profile criteria, motivations, barriers, frustrations (formerly pain points), triggers, a decision-making role (a value of the admin-edited list `program_audience_decision_roles`), a preferred tone (checkboxes of the admin-edited list `program_audience_tones`), preferred channels (checkboxes: email, SMS, web, social organic, paid social, paid search, events/webinar, outbound sales, partners), any number of Mautic stages (join table `initiative_audiences_stages`) and an estimated size. `Service/AudienceAttributes.php` reads the toggles.
- **Segments**: each audience can have any number of Mautic segments (LeadBundle lists), purely informational — nothing requires one, and nothing in the initiative depends on them. They are stored in the join table `initiative_audiences_segments` (audience_id, leadlist_id), picked in the audience form (published segments only), shown in the directory's Segments column (each with its count of contacts, from `lead_lists_leads` where `manually_removed = 0`) and on the detail page. `AudienceRepository::getSegmentContactCountsForAudiences()` computes the counts for the whole page in one query.
- `Entity/InitiativeAudience.php`: the link between an initiative and an audience (table `initiative_audiences_initiative`), with the audience's priority in that initiative (primary, secondary, exclusion), an initiative-specific value proposition and a position. Deleting the initiative or the audience deletes the link (ON DELETE CASCADE both sides).
- `Model/AudienceModel.php`: the model, available as `mautic.program.model.audience` or with `getModel('program.audience')`.
- `Controller/AudienceController.php` and `Resources/views/Audience/`: the directory (**Programs > Audiences**), with the columns ID, Pictogram, Type, Name (with its tagline), Segments (each with its contact count), Estimated size, Active, and **Assigned initiatives** — the initiatives the audience is linked to, each with its priority in that initiative. The detail page lists the segments, the persona attributes that are filled in, and those initiatives.
- `Model/InitiativeModel.php`: the model, available as `mautic.program.model.initiative` or with `getModel('program.initiative')`. A new initiative from `getEntity()` has the current user as owner.
- `Entity/InitiativeDescriptionItem.php` and `InitiativeDescriptionItemRepository.php`: an initiative's description items (table `initiative_description_items`): type, description and position. They make up the **Insights** tab and replace the former `description` field.
- `Form/Type/InitiativeType.php`, `InitiativeObjectiveType.php` and `InitiativeDescriptionItemType.php`: the create and edit form, with the objectives and the description items as collections
- `Validator/Constraints/EndDateAfterStartDate.php`: the end date must be on or after the start date, when both are set. Used by initiatives and tasks, through `Entity/DateRangeInterface.php`.
- `Entity/Program.php`: the entity (table `mt3s_mp_programs`), with its Doctrine mapping and validation rules
- `Entity/ProgramStatus.php`: the status enum (`draft`, `planned`, `active`, `paused`, `completed`, `archived`)
- `Entity/ProgramRepository.php`: the repository
- `Entity/ProgramObjective.php` and `ProgramObjectiveRepository.php`: a program's objectives (table `mt3s_mp_program_objectives`): type (with its pictogram), title, description, position and an "achieved" flag
- `Entity/Audience.php`, `AudienceType.php`, `AudiencePriority.php` and `AudienceRepository.php`: the audiences of the global directory (table `mt3s_mp_program_audiences`, `plan_targets` before 0.15.0): name, a fixed type (persona, ICP, broad audience, lifecycle cohort, partner/influencer — each with its own pictogram), a tagline, the Mautic segments that hold this audience's contacts (see below), and the persona attributes the admin switched on (**Settings > Configuration > Marketing Program Settings**, one toggle per attribute, so a b2b install and a b2c install define their personas differently): profile criteria, motivations, barriers, frustrations (formerly pain points), triggers, a decision-making role (a value of the admin-edited list `mt3s_marketing_program_audience_decision_roles`), a preferred tone (checkboxes of the admin-edited list `mt3s_marketing_program_audience_tones`), preferred channels (checkboxes: email, SMS, web, social organic, paid social, paid search, events/webinar, outbound sales, partners), any number of Mautic stages (join table `mt3s_mp_program_audiences_stages`) and an estimated size. `Service/AudienceAttributes.php` reads the toggles.
- **Segments**: each audience can have any number of Mautic segments (LeadBundle lists), purely informational — nothing requires one, and nothing in the program depends on them. They are stored in the join table `mt3s_mp_program_audiences_segments` (audience_id, leadlist_id), picked in the audience form (published segments only), shown in the directory's Segments column (each with its count of contacts, from `lead_lists_leads` where `manually_removed = 0`) and on the detail page. `AudienceRepository::getSegmentContactCountsForAudiences()` computes the counts for the whole page in one query.
- `Entity/ProgramAudience.php`: the link between a program and an audience (table `mt3s_mp_program_audiences_program`), with the audience's priority in that program (primary, secondary, exclusion), a program-specific value proposition and a position. Deleting the program or the audience deletes the link (ON DELETE CASCADE both sides).
- `Model/AudienceModel.php`: the model, available as `mt3s.marketing_program.model.audience` or with `getModel('mt3smp.audience')`.
- `Controller/AudienceController.php` and `Resources/views/Audience/`: the directory (**Marketing Programs > Audiences**), with the columns ID, Pictogram, Type, Name (with its tagline), Segments (each with its contact count), Estimated size, Active, and **Assigned mt3s_mp_programs** — the mt3s_mp_programs the audience is linked to, each with its priority in that program. The detail page lists the segments, the persona attributes that are filled in, and those mt3s_mp_programs.
- `Model/ProgramModel.php`: the model, available as `mt3s.marketing_program.model.program` or with `getModel('mt3smp.program')`. A new program from `getEntity()` has the current user as owner.
- `Entity/ProgramDescriptionItem.php` and `ProgramDescriptionItemRepository.php`: a program's description items (table `mt3s_mp_program_description_items`): type, description and position. They make up the **Insights** tab and replace the former `description` field.
- `Form/Type/ProgramType.php`, `ProgramObjectiveType.php` and `ProgramDescriptionItemType.php`: the create and edit form, with the objectives and the description items as collections
- `Validator/Constraints/EndDateAfterStartDate.php`: the end date must be on or after the start date, when both are set. Used by mt3s_mp_programs and tasks, through `Entity/DateRangeInterface.php`.
Behaviour to know about:
- Setting the status to `completed` from another status sets `completedAt` to the current time. Moving a completed initiative to any other status clears `completedAt`.
- `owner` is required by validation, but the column is nullable: if the user is deleted, the owner becomes `NULL` (`ON DELETE SET NULL`), and the initiative must be given a new owner before it can be saved again.
- Categories use the core CategoryBundle with the `program` type (**Settings > Categories**), shown as "Initiative".
- There is one currency for every amount: initiative budgets, allocation costs and totals. It's a general setting, the **Currency** dropdown in **Settings > Configuration > Program Settings** (parameter `program_currency`, `EUR` by default), offering 40 main world currencies (`Service/CurrencyProvider.php`). Users never choose a currency, and amount fields show it next to the input. Changing it doesn't convert existing amounts: they're simply shown with the new currency.
- `version` is a whole number from 1 to 99, and new initiatives start at 1. It is edited by hand and isn't related to Doctrine's optimistic locking.
- Objectives belong to their initiative: they are saved with it, deleted with it (`ON DELETE CASCADE` in the database too), and an objective removed from the form is deleted (`orphanRemoval`). They are always loaded ordered by `position`. On save, the model renumbers positions to 0, 1, 2… in their current order. Description items follow the same rules.
- Setting the status to `completed` from another status sets `completedAt` to the current time. Moving a completed program to any other status clears `completedAt`.
- `owner` is required by validation, but the column is nullable: if the user is deleted, the owner becomes `NULL` (`ON DELETE SET NULL`), and the program must be given a new owner before it can be saved again.
- Categories use the core CategoryBundle with the `program` type (**Settings > Categories**), shown as "MT3S Marketing Program" (label `mt3s.marketing_program.category.type`).
- There is one currency for every amount: program budgets, allocation costs and totals. It's a general setting, the **Currency** dropdown in **Settings > Configuration > Marketing Program Settings** (parameter `mt3s_marketing_program_currency`, `EUR` by default), offering 40 main world currencies (`Service/CurrencyProvider.php`). Users never choose a currency, and amount fields show it next to the input. Changing it doesn't convert existing amounts: they're simply shown with the new currency.
- `version` is a whole number from 1 to 99, and new mt3s_mp_programs start at 1. It is edited by hand and isn't related to Doctrine's optimistic locking.
- Objectives belong to their program: they are saved with it, deleted with it (`ON DELETE CASCADE` in the database too), and an objective removed from the form is deleted (`orphanRemoval`). They are always loaded ordered by `position`. On save, the model renumbers positions to 0, 1, 2… in their current order. Description items follow the same rules.
- `getObjectives()` and `getDescriptionItems()` return the rows sorted by position, as a new collection. The mapping's `orderBy` isn't enough: after a reorder, the page shown right after saving uses the collection already loaded, in its old order.
- Text typed in the initiative form, including in objectives and description items, is kept as typed: line breaks, `&` and quotes are preserved, and HTML tags are removed. This depends on `InitiativeType` passing a mask array to `CleanFormSubscriber`. Without one, core HTML-encodes every value, again on each save.
- Text typed in the program form, including in objectives and description items, is kept as typed: line breaks, `&` and quotes are preserved, and HTML tags are removed. This depends on `ProgramType` passing a mask array to `CleanFormSubscriber`. Without one, core HTML-encodes every value, again on each save.
### Typed items: description items, allocation items and tasks
- A **description item** (Insights tab, `Entity/InitiativeDescriptionItem.php`) has a type and a description. More fields are planned.
- An **allocation item** (Allocations tab, `Entity/InitiativeAllocationItem.php`, table `initiative_allocation_items`) is a cost line: type (with its pictogram), name (optional), description, planned cost and real cost. Costs are `DECIMAL(12,2)`, in the general currency.
- An **objective** (`Entity/InitiativeObjective.php`) has a type too (with its pictogram), a title, a priority (a whole number from 1, the most important, to 99), a description and the achieved flag. The initiative's Objectives tab lists them by priority; ties keep the manual order. The priority is required.
- A **description item** (Insights tab, `Entity/ProgramDescriptionItem.php`) has a type and a description. More fields are planned.
- An **allocation item** (Allocations tab, `Entity/ProgramAllocationItem.php`, table `mt3s_mp_program_allocation_items`) is a cost line: type (with its pictogram), name (optional), description, planned cost and real cost. Costs are `DECIMAL(12,2)`, in the general currency.
- An **objective** (`Entity/ProgramObjective.php`) has a type too (with its pictogram), a title, a priority (a whole number from 1, the most important, to 99), a description and the achieved flag. The program's Objectives tab lists them by priority; ties keep the manual order. The priority is required.
- A **task** (`Entity/Task.php`) has a type too (with its pictogram): see *The Task object* below.
- Description items, allocation items and objectives are edited inside the initiative form, like objectives: add, remove, drag to reorder. They're saved and deleted with the initiative. Tasks are edited on their own form, where the type's pictogram and description appear around the type dropdown.
- Each kind's types are set up on the **Item types** page (**Programs > Item types**), in several sections. Each type has a name and a description for each language installed in Mautic, and the default language (the `locale` parameter) requires a name. Each type also has a pictogram (none for the audience decision roles and tones). Users see their own language, or the default language when theirs is empty. The order of the types is the order of the dropdown.
- The types are stored in `config/local.php`, in the `program_description_item_types`, `program_allocation_item_types`, `program_objective_types`, `program_task_types` and `program_stakeholder_types` parameters. Read them with `Service/ItemTypeProvider.php`, passing the kind (`description`, `allocation`, `objective`, `task` or `stakeholder`). In templates, use the Twig functions `program_item_type_name(kind, key)`, `program_item_type_description(kind, key)` and `program_item_type_icon(kind, key)`, plus `program_currency()` and `program_money(amount)` (`Twig/ProgramExtension.php`).
- **Every item type has a pictogram**, chosen by the administrator from a list of Remix Icons that Mautic ships (`Service/Pictograms.php`, each checked against Mautic 7's icon stylesheet), with a live preview. It's stored as `icon` in the type. On the initiative form and the task form it appears next to the type dropdown when a type is chosen.
- **The four item tabs of an initiative's detail page are harmonized** (`Resources/views/Initiative/details.html.twig`, `_task_table.html.twig`, `_tab_table_filter.html.twig`): every column starts with the pictogram (its header stays empty — no "Pictogram" label), then Type, Name, Description, and the kind's other fields; objectives show their Priority after Description, and tasks end with Status. The initiative's Tasks tab doesn't show task IDs (`data-task-id` still carries them). Each tab has one filter box that matches every column, and every column header sorts the rows asc/desc on click (`Mautic.programInitTabTable` in `Assets/js/program.js`, client-side). The objective's achieved flag is the Status column of its table.
- A description item's long description is **clamped to 10 lines** in the Insights tab, with a *Read more* / *Show less* toggle (`_description_read_more.html.twig`, `Mautic.programInitReadMore`). The toggle appears only when the text really overflows: the pane is hidden on page load, so the measurement waits for the tab to be shown.
- Description items, allocation items and objectives are edited inside the program form, like objectives: add, remove, drag to reorder. They're saved and deleted with the program. Tasks are edited on their own form, where the type's pictogram and description appear around the type dropdown.
- Each kind's types are set up on the **Item types** page (**Marketing Programs > Item types**), in several sections. Each type has a name and a description for each language installed in Mautic, and the default language (the `locale` parameter) requires a name. Each type also has a pictogram (none for the audience decision roles and tones). Users see their own language, or the default language when theirs is empty. The order of the types is the order of the dropdown.
- The types are stored in `config/local.php`, in the `mt3s_marketing_program_description_item_types`, `mt3s_marketing_program_allocation_item_types`, `mt3s_marketing_program_objective_types`, `mt3s_marketing_program_task_types` and `mt3s_marketing_program_stakeholder_types` parameters. Read them with `Service/ItemTypeProvider.php`, passing the kind (`description`, `allocation`, `objective`, `task` or `stakeholder`). In templates, use the Twig functions `mt3s_marketing_program_item_type_name(kind, key)`, `mt3s_marketing_program_item_type_description(kind, key)` and `mt3s_marketing_program_item_type_icon(kind, key)`, plus `mt3s_marketing_program_currency()` and `mt3s_marketing_program_money(amount)` (`Twig/MT3SMarketingProgramExtension.php`).
- **Every item type has a pictogram**, chosen by the administrator from a list of Remix Icons that Mautic ships (`Service/Pictograms.php`, each checked against Mautic 7's icon stylesheet), with a live preview. It's stored as `icon` in the type. On the program form and the task form it appears next to the type dropdown when a type is chosen.
- **The four item tabs of a program's detail page are harmonized** (`Resources/views/Program/details.html.twig`, `_task_table.html.twig`, `_tab_table_filter.html.twig`): every column starts with the pictogram (its header stays empty — no "Pictogram" label), then Type, Name, Description, and the kind's other fields; objectives show their Priority after Description, and tasks end with Status. The program's Tasks tab doesn't show task IDs (`data-task-id` still carries them). Each tab has one filter box that matches every column, and every column header sorts the rows asc/desc on click (`Mautic.mt3sMpProgramInitTabTable` in `Assets/js/mt3s-mp-program.js`, client-side). The objective's achieved flag is the Status column of its table.
- A description item's long description is **clamped to 10 lines** in the Insights tab, with a *Read more* / *Show less* toggle (`_description_read_more.html.twig`, `Mautic.mt3sMpProgramInitReadMore`). The toggle appears only when the text really overflows: the pane is hidden on page load, so the measurement waits for the tab to be shown.
- Each type has a hidden key, generated when it's created and never changed. Items store that key, so renaming a type renames it everywhere.
- A type that items use can't be removed: the lists aren't saved, and the error lists the types and how many items use them (`Service/ItemTypeInUseGuard.php`, called by `ItemTypesController` before saving the page).
- On the initiative form, the selected type's description is shown under the type dropdown. When no types are set up, the tab says where to set them up.
- Files: `Form/Type/ItemTypesType.php`, `ItemTypeConfigType.php`, `InitiativeDescriptionItemType.php`, `InitiativeAllocationItemType.php`, `Controller/ItemTypesController.php` and `Resources/views/ItemTypes/form.html.twig` (the page), and `Form/Type/ConfigType.php` with `Resources/views/FormTheme/Config/_config_programconfig_widget.html.twig` (the general settings that stayed in **Settings > Configuration**). Adding and removing types is handled in `Assets/js/program.js`.
- On the program form, the selected type's description is shown under the type dropdown. When no types are set up, the tab says where to set them up.
- Files: `Form/Type/ItemTypesType.php`, `ItemTypeConfigType.php`, `ProgramDescriptionItemType.php`, `ProgramAllocationItemType.php`, `Controller/ItemTypesController.php` and `Resources/views/ItemTypes/form.html.twig` (the page), and `Form/Type/ConfigType.php` with `Resources/views/FormTheme/Config/_config_mt3smarketingprogramconfig_widget.html.twig` (the general settings that stayed in **Settings > Configuration**). Adding and removing types is handled in `Assets/js/mt3s-mp-program.js`.
### Cost totals
- `Initiative::getAllocationTotals()` adds up the allocation items' planned and real costs, in the general currency. The sums are done in cents, as integers.
- The initiative detail page shows them under the title, after the initiative status, as on an email's page (`publishStatus` block): a "Planned" tag and a "Real" tag. A real total above the planned total is red, otherwise green.
- `Program::getAllocationTotals()` adds up the allocation items' planned and real costs, in the general currency. The sums are done in cents, as integers.
- The program detail page shows them under the title, after the program status, as on an email's page (`publishStatus` block): a "Planned" tag and a "Real" tag. A real total above the planned total is red, otherwise green.
- The Allocations tab of the detail page lists the cost lines, followed by a total row.
- `isAchieved` is toggled by hand on the form for now.
### The Stakeholder object
- `Entity/Stakeholder.php` and `StakeholderRepository.php`: a stakeholder (table `initiative_stakeholders`), the global directory of the people, companies and teams involved in the initiatives: name, email (validated, indexed for duplicate detection), phone, role, type and the active flag (`isPublished`). Independent of initiatives.
- `Entity/InitiativeStakeholder.php`: the link between an initiative and a stakeholder (table `initiative_stakeholders_initiative`), with the stakeholder's role in that initiative (free text, column `role_in_initiative`) and a position. Deleting the initiative or the stakeholder deletes the link (ON DELETE CASCADE both sides).
- `Model/StakeholderModel.php`: the model, available as `mautic.program.model.stakeholder` or with `getModel('program.stakeholder')`. On save, the phone number is normalized to E.164 using the default region from **Settings > Configuration > Program Settings** (parameter `program_stakeholder_phone_region`, `FR` by default); a number that doesn't parse is kept exactly as typed, and the save is never blocked.
- `Controller/StakeholderController.php` and `Resources/views/Stakeholder/`: the directory (**Programs > Stakeholders**), with the columns ID, Pictogram, Type, Name, Role, Email (mailto link), Phone (tel link), Active, and **Assigned initiatives** — the initiatives the stakeholder is linked to, each with its role in that initiative. The detail page lists those initiatives too.
- The stakeholder's type is the key of a stakeholder type set up in **Settings > Configuration > Program Settings** (parameter `program_stakeholder_types`), same pattern as the other item types, pictogram included.
- An initiative's **Stakeholders tab** links the directory to the initiative: each row picks an active stakeholder and gives its role in the initiative. The tab shows the harmonized table (pictogram, Type, Name, Role in the initiative, Role, Email, Phone, Active). Unpublished stakeholders are not offered in the picker, but keep their links.
- `Entity/Stakeholder.php` and `StakeholderRepository.php`: a stakeholder (table `mt3s_mp_program_stakeholders`), the global directory of the people, companies and teams involved in the mt3s_mp_programs: name, email (validated, indexed for duplicate detection), phone, role, type and the active flag (`isPublished`). Independent of mt3s_mp_programs.
- `Entity/ProgramStakeholder.php`: the link between a program and a stakeholder (table `mt3s_mp_program_stakeholders_program`), with the stakeholder's role in that program (free text, column `role_in_program`) and a position. Deleting the program or the stakeholder deletes the link (ON DELETE CASCADE both sides).
- `Model/StakeholderModel.php`: the model, available as `mt3s.marketing_program.model.stakeholder` or with `getModel('mt3smp.stakeholder')`. On save, the phone number is normalized to E.164 using the default region from **Settings > Configuration > Marketing Program Settings** (parameter `mt3s_marketing_program_stakeholder_phone_region`, `FR` by default); a number that doesn't parse is kept exactly as typed, and the save is never blocked.
- `Controller/StakeholderController.php` and `Resources/views/Stakeholder/`: the directory (**Marketing Programs > Stakeholders**), with the columns ID, Pictogram, Type, Name, Role, Email (mailto link), Phone (tel link), Active, and **Assigned mt3s_mp_programs** — the mt3s_mp_programs the stakeholder is linked to, each with its role in that program. The detail page lists those mt3s_mp_programs too.
- The stakeholder's type is the key of a stakeholder type set up in **Settings > Configuration > Marketing Program Settings** (parameter `mt3s_marketing_program_stakeholder_types`), same pattern as the other item types, pictogram included.
- A program's **Stakeholders tab** links the directory to the program: each row picks an active stakeholder and gives its role in the program. The tab shows the harmonized table (pictogram, Type, Name, Role in the program, Role, Email, Phone, Active). Unpublished stakeholders are not offered in the picker, but keep their links.
### The Task object
- `Entity/Task.php` and `TaskRepository.php`: a task (table `initiative_tasks`): type (with its pictogram), name, description, initiative, kind (task, milestone or phase), optional start and end dates (plain dates, no time), definition of done, planned work in whole hours, status (not for phases), dependencies (table `initiative_task_dependencies`) and RACI assignments (table `initiative_task_raci` with its `initiative_task_raci_stakeholders` join table)
- `Entity/Task.php` and `TaskRepository.php`: a task (table `mt3s_mp_program_tasks`): type (with its pictogram), name, description, program, kind (task, milestone or phase), optional start and end dates (plain dates, no time), definition of done, planned work in whole hours, status (not for phases), dependencies (table `mt3s_mp_program_task_dependencies`) and RACI assignments (table `mt3s_mp_program_task_raci` with its `mt3s_mp_program_task_raci_stakeholders` join table)
- `Entity/TaskStatus.php`: the status enum. The order of its cases is the order of the dropdown: `new` (New, the default), `todo` (To do), `in_progress` (In progress), `done` (Done). Stored as `VARCHAR(20)`, indexed.
- `Model/TaskModel.php`: the model, available as `mautic.program.model.task` or with `getModel('program.task')`. `getTaskTree($initiative)` returns an initiative's tasks as flat rows for the Tasks tab, ordered by name, with their dependencies and RACI rows fully loaded.
- `Model/TaskModel.php`: the model, available as `mt3s.marketing_program.model.task` or with `getModel('mt3smp.task')`. `getTaskTree($program)` returns a program's tasks as flat rows for the Tasks tab, ordered by name, with their dependencies and RACI rows fully loaded.
- `Form/Type/TaskType.php`: the create and edit form
- `Validator/Constraints/ValidTaskDependency.php`: a dependency must point at another task of the same initiative, and the dependency graph must not form a cycle (followed through the database, so a cycle crossing other tasks is caught too)
- `Validator/Constraints/ValidTaskDependency.php`: a dependency must point at another task of the same program, and the dependency graph must not form a cycle (followed through the database, so a cycle crossing other tasks is caught too)
Behaviour to know about:
- A task must belong to an initiative. An initiative can have any number of tasks, including none.
- A task must belong to a program. A program can have any number of tasks, including none.
- A task's end date must be on or after its start date, when both are set.
- The task list (**Programs > Tasks**) shows these columns, in this order: ID, Pictogram, Type, Name, Description (first 120 characters), Start date, End date, Status. Every column except Pictogram and Description can be sorted.
- A task's type is required. It's the key of a task type set up in **Settings > Configuration > Program Settings** (parameter `program_task_types`); on the task form the type's pictogram appears next to the dropdown and its description under it. The initiative's Tasks tab shows the same Pictogram and Type columns as the task list, without the ID column.
- Deleting an initiative deletes its tasks (`initiative_id` `ON DELETE CASCADE`).
- The task list (**Marketing Programs > Tasks**) shows these columns, in this order: ID, Pictogram, Type, Name, Description (first 120 characters), Start date, End date, Status. Every column except Pictogram and Description can be sorted.
- A task's type is required. It's the key of a task type set up in **Settings > Configuration > Marketing Program Settings** (parameter `mt3s_marketing_program_task_types`); on the task form the type's pictogram appears next to the dropdown and its description under it. The program's Tasks tab shows the same Pictogram and Type columns as the task list, without the ID column.
- Deleting a program deletes its tasks (`program_id` `ON DELETE CASCADE`).
- Deleting a task removes its dependency edges and RACI rows too (`ON DELETE CASCADE`).
- Tasks are edited on their own pages, not inside the initiative form: a task can only be picked as a dependency once it exists.
- Tasks are edited on their own pages, not inside the program form: a task can only be picked as a dependency once it exists.
- Kinds: a **milestone**'s end date is enslaved to its start date (same day — the entity's `setTaskKind` copies it, the `TaskDates` validator keeps it in step, the form shows it disabled); a **phase** has no status of its own, it comes from its tasks (the form shows no status field).
- RACI: one row per role (Responsible, Accountable, Consulted, Informed), each with several stakeholders picked from the initiative's stakeholders.
- RACI: one row per role (Responsible, Accountable, Consulted, Informed), each with several stakeholders picked from the program's stakeholders.
After you change `Assets/js/program.js`, run `php bin/console mautic:assets:generate` (in the dev environment, `./dev.sh console mautic:assets:generate`), because production mode bundles plugin scripts into `app.js`.
After you change `Assets/js/mt3s-mp-program.js`, run `php bin/console mautic:assets:generate` (in the dev environment, `./dev.sh console mautic:assets:generate`), because production mode bundles plugin scripts into `app.js`.
### Database schema
Mautic creates the `initiatives` table from the entity mapping when it installs the plugin. However, the installer drops foreign keys that point to core tables (`users`, `categories`). `Migrations/Version_0_2_0.php` adds them and only runs when they are missing. Core runs plugin migrations when the plugin version changes, and `EventListener/PluginInstallSubscriber.php` also runs them right after a fresh install.
Mautic creates the `mt3s_mp_programs` table from the entity mapping when it installs the plugin. However, the installer drops foreign keys that point to core tables (`users`, `categories`). `Migrations/Version_0_2_0.php` adds them and only runs when they are missing. Core runs plugin migrations when the plugin version changes, and `EventListener/PluginInstallSubscriber.php` also runs them right after a fresh install.
`Migrations/Version_0_16_0.php` renames every table and column of the Plan era to the Program one: `plans` → `initiatives`, `plan_tasks` → `initiative_tasks`, `plan_stakeholders` → `initiative_stakeholders`, `plan_audiences` → `initiative_audiences`, `plan_stakeholders_plan` → `initiative_stakeholders_initiative`, `plan_audiences_plan` → `initiative_audiences_initiative`, `plan_audiences_segments` → `initiative_audiences_segments`, `plan_audiences_stages` → `initiative_audiences_stages`, `plan_objectives` → `initiative_objectives`, `plan_description_items` → `initiative_description_items`, `plan_allocation_items` → `initiative_allocation_items`, `plan_task_dependencies` → `initiative_task_dependencies`, `plan_task_raci` → `initiative_task_raci`, `plan_task_raci_stakeholders` → `initiative_task_raci_stakeholders`, and the `plan_id` foreign key columns become `initiative_id`; `role_in_plan` becomes `role_in_initiative`. The earlier migrations (`Version_0_2_0.php` … `Version_0_14_0.php`) keep their historical table names in their bodies but are disabled (`isApplicable()` returns `false`), since their changes are history now kept by the renames in 0.16.0.
`Migrations/Version_0_16_0.php` renames every table and column of the Plan era to the Program one: `plans` → `mt3s_mp_programs`, `plan_tasks` → `mt3s_mp_program_tasks`, `plan_stakeholders` → `mt3s_mp_program_stakeholders`, `plan_audiences` → `mt3s_mp_program_audiences`, `plan_stakeholders_plan` → `mt3s_mp_program_stakeholders_program`, `plan_audiences_plan` → `mt3s_mp_program_audiences_program`, `plan_audiences_segments` → `mt3s_mp_program_audiences_segments`, `plan_audiences_stages` → `mt3s_mp_program_audiences_stages`, `plan_objectives` → `mt3s_mp_program_objectives`, `plan_description_items` → `mt3s_mp_program_description_items`, `plan_allocation_items` → `mt3s_mp_program_allocation_items`, `plan_task_dependencies` → `mt3s_mp_program_task_dependencies`, `plan_task_raci` → `mt3s_mp_program_task_raci`, `plan_task_raci_stakeholders` → `mt3s_mp_program_task_raci_stakeholders`, and the `plan_id` foreign key columns become `program_id`; `role_in_plan` becomes `role_in_program`. The earlier migrations (`Version_0_2_0.php` … `Version_0_14_0.php`) keep their historical table names in their bodies but are disabled (`isApplicable()` returns `false`), since their changes are history now kept by the renames in 0.16.0.
When you change the schema, add a migration in `Migrations/` and increase `version` in `Config/config.php`, then run `./dev.sh reload`. The migration engine executes the `addSql()` statements after `up()` returns; a rename migration must instead run its statements immediately through `$connection->executeStatement()`, re-reading the schema between steps.
## Naming conventions
To avoid collisions with other plugins, such as UTM Manager, every identifier in this bundle is prefixed with `program`:
To avoid collisions with other plugins, such as UTM Manager, every identifier in this bundle is prefixed with the bundle's name (the `MT3S` in `MT3SMarketingProgramBundle`):
- Service IDs: `mautic.program.*` (and the models resolve from `getModel('program.initiative')` etc.)
- Form block prefixes: `program_*` (`program_task`, `program_audience`, …)
- Route names: `initiative_*` (the initiative pages), with `program_utm_taxonomy_index` for the placeholder
- Translation keys: `mautic.program.*`, plus `mautic.plugin.program.name`
- Permission keys: `program:*`
- Config parameters: `program_*` (`program_currency`, `program_*_types`, …)
- Menu keys: `mautic.program.menu.*`
- URL paths: `/s/programs`, `/s/program-tasks`, `/s/program-stakeholders`, `/s/program-audiences`, `/s/program-utm-taxonomies`
- Service IDs: `mt3s.marketing_program.*` (and the models resolve from `getModel('mt3smp.program')` etc.)
- Form block prefixes: `mt3s_marketing_program_*` (`mt3s_marketing_program_task`, `mt3s_marketing_program_audience`, …)
- Route names: `mt3s_marketing_program_*` (e.g. `mt3s_marketing_program_index`, `mt3s_marketing_program_task_action`, with `mt3s_marketing_program_utm_taxonomy_index` for the placeholder)
- Translation keys: `mt3s.marketing_program.*`, plus `mautic.plugin.mt3smarketingprogram.name`
- Permission keys: `mt3smarketingprogram:*` (from the bundle name, lowercased)
- Config parameters: `mt3s_marketing_program_*` (`mt3s_marketing_program_currency`, `mt3s_marketing_program_*_types`, …)
- Menu keys: `mt3s.marketing_program.menu.*`
- URL paths: `/s/marketing-programs`, `/s/marketing-program-tasks`, `/s/marketing-program-stakeholders`, `/s/marketing-program-audiences`, `/s/marketing-program-utm-taxonomies`
The bundle class is `ProgramBundle`, the integration name is `Program`, the entity classes are `Initiative`, `Task`, `Stakeholder` and `Audience`, and their tables are `initiatives`, `initiative_tasks`, `initiative_stakeholders` and `initiative_audiences`. The DB index names follow: `program_status` on `initiatives`, `program_task_status` on `initiative_tasks`, `program_stakeholder_email` on `initiative_stakeholders`.
The bundle class is `MT3SMarketingProgramBundle`, the integration name is `MT3SMarketingProgram`, the entity classes are `Program`, `Task`, `Stakeholder` and `Audience`, and their tables are `mt3s_mp_programs`, `mt3s_mp_program_tasks`, `mt3s_mp_program_stakeholders` and `mt3s_mp_program_audiences`. The DB index names are kept from before 0.17.0: `program_status` on `mt3s_mp_programs`, `program_task_status` on `mt3s_mp_program_tasks`, `program_stakeholder_email` on `mt3s_mp_program_stakeholders`. The plugin also dispatches `mt3s.marketing_program.*` events (`Event/MT3SMarketingProgramEvents.php`, payload `Event/ProgramEvent.php`) and ships `Command/RefreshStatsCommand.php` (`php bin/console mt3s:marketing-program:refresh-stats`).
## Rename history
The plugin was born as `PlanBundle` with a `Plan` entity (table `plans`) and menu root **Planning** > **Plans**:
- Before 0.15.0: "targets" were renamed to "audiences" (entity `Audience`, table `plan_targets` → `plan_audiences`), with Mautic segments attached to each audience.
- 0.16.0: the full rename to `ProgramBundle` / `Initiative`. The bundle namespace, class names, the `plugins` DB row (`ProgramBundle`), all tables (`plan_*` → `initiative_*`), all columns (`plan_id` → `initiative_id`, `role_in_plan` → `role_in_initiative`), all permission keys (`plan:*` → `program:*`), the config parameters and the menu (root **Programs**, entry **Initiatives**, plus the placeholder **UTM Taxonomies**) took the new names. The data was kept: the migration renames the tables, it doesn't rebuild them.
- The old URLs (`/s/plans`, `/s/plan-tasks`, …) are gone: the routes were renamed and the old names return 404.
- 0.16.0: the full rename to `ProgramBundle` / `Program` (and a "plan" became an "initiative"). The bundle namespace, class names, the `plugins` DB row (`ProgramBundle`), all tables (`plan_*` → `initiative_*`), all columns (`plan_id` → `initiative_id`, `role_in_plan` → `role_in_initiative`), all permission keys (`plan:*` → `program:*`), the config parameters and the menu (root **Programs**, entry **Initiatives**, plus the placeholder **UTM Taxonomies**) took the new names. The data was kept: the migration renames the tables, it doesn't rebuild them.
- 0.17.0: the rename to `MT3SMarketingProgramBundle` / "MT3S Marketing Program", and an initiative became a marketing program. The bundle namespace, class names, the `plugins` DB row (`MT3SMarketingProgramBundle`, name "MT3S Marketing Program"), all tables (`initiative_*` → `mt3s_mp_program_*`), all columns (`initiative_id` → `program_id`, `role_in_initiative` → `role_in_program`), all permission keys (`program:*` → `mt3smarketingprogram:*`), the routes, the service IDs, the config parameters, the URLs (`/s/marketing-programs`, …) and the menu (root **Marketing Programs**, entry **Marketing Programs**) took the new names, and the plugin's events (`mt3s.marketing_program.*`) and the `mt3s:marketing-program:refresh-stats` command were added. The data was kept again: `Version_0_17_0.php` renames the tables and carries over the rows the rename orphans — the plugins row, the roles' permission rows (which the 0.16.0 rename had missed), the categories (`plan`- and `initiative`-era rows) and the audit log.
- The old URLs (`/s/plans`, `/s/plan-tasks`, `/s/programs`, `/s/program-tasks`, …) are gone: the routes were renamed and the old names return 404.
A rename like this needs care:
- The historical migrations must stay literal (they describe the old schema) or be neutralized; after the entity renames, their Doctrine mappings no longer match and they can only run with literal SQL.
- The `plugins` DB row must be updated to the new bundle name (and its version kept), or Mautic's installer treats the plugin as new and its `SchemaTool` pass creates empty tables from the current mappings. If that happens, drop the empty tables and turn the install into an update before reloading.
- The permission keys of each role are stored in the `permissions` table per (bundle, name); a role that had `plan:plans:*` grants doesn't automatically get `program:initiatives:*`, and cached permission sets in the sessions need a re-login.
- `getModel()` resolves `program.initiative` to the service `mautic.program.model.initiative`, unlike core bundles' `mautic.<x>.model.<x>`: only the service IDs decide.
- The `config/local.php` parameter keys are not renamed by the migration either (they are not in the database): `plan_currency` → `program_currency`, the `plan_*_types` lists → `program_*_types`, and the pre-0.15 audience keys `plan_target_attribute_*`, `plan_target_decision_roles` and `plan_target_tones` → `program_audience_attribute_*`, `program_audience_decision_roles` and `program_audience_tones`. Rename them by hand after upgrading, or the type lists on the settings page and every type dropdown read empty (the stored items keep their type keys, they only show "Unknown type").
- The permission keys of each role are stored in the `permissions` table per (bundle, name); a role that had `plan:plans:*` grants doesn't automatically get `mt3smarketingprogram:programs:*`, and cached permission sets in the sessions need a re-login.
- `getModel()` resolves `mt3smp.program` to the service `mt3s.marketing_program.model.program`, unlike core bundles' `mautic.<x>.model.<x>`: only the service IDs decide.
- The `config/local.php` parameter keys are not renamed by the migration either (they are not in the database): `plan_currency` → `mt3s_marketing_program_currency`, the `plan_*_types` lists → `mt3s_marketing_program_*_types`, and the pre-0.15 audience keys `plan_target_attribute_*`, `plan_target_decision_roles` and `plan_target_tones` → `mt3s_marketing_program_audience_attribute_*`, `mt3s_marketing_program_audience_decision_roles` and `mt3s_marketing_program_audience_tones`. Rename them by hand after upgrading, or the type lists on the settings page and every type dropdown read empty (the stored items keep their type keys, they only show "Unknown type").