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:
1 parent
687d33d30c
commit
ea88b7a772
131 files changed
+3238
-2836
No files matched your search
+34
-34
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace MauticPlugin\ProgramBundle\Entity;
|
||||
namespace MauticPlugin\MT3SMarketingProgramBundle\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -19,11 +19,11 @@ use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
|
||||
/**
|
||||
* One audience of the global directory (Programs > Audiences): who the plan is aimed at, and how.
|
||||
* Audiences are independent of plans; a plan links to them from its Audiences tab through InitiativeAudience,
|
||||
* which carries the audience's priority in that plan, and possibly a initiative-specific message.
|
||||
* Audiences are independent of plans; a plan links to them from its Audiences tab through ProgramAudience,
|
||||
* which carries the audience's priority in that plan, and possibly a program-specific message.
|
||||
*
|
||||
* Which attributes are offered on the forms is set up by the admin in Settings > Configuration >
|
||||
* Initiative Settings (per-attribute toggles, so a b2b install and a b2c install define their personas
|
||||
* Program Settings (per-attribute toggles, so a b2b install and a b2c install define their personas
|
||||
* differently); the decision roles and the tones are lists edited there too. See AudienceAttributes.
|
||||
*
|
||||
* The stages are the Mautic stages (Settings > Stages) this audience maps to; an audience can have
|
||||
@@ -33,26 +33,26 @@ use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
* informational: the user may assign none, one or several; the list view shows their names and
|
||||
* their contact counts. Deleting a segment removes the link, not the audience.
|
||||
*
|
||||
* isPublished (from FormEntity) means "active": an unpublished audience is hidden from the initiative
|
||||
* form's audience picker, but keeps its history on the initiatives it is already linked to.
|
||||
* isPublished (from FormEntity) means "active": an unpublished audience is hidden from the program
|
||||
* form's audience picker, but keeps its history on the mt3s_mp_programs it is already linked to.
|
||||
*/
|
||||
class Audience extends FormEntity
|
||||
{
|
||||
public const TABLE_NAME = 'initiative_audiences';
|
||||
public const TABLE_NAME = 'mt3s_mp_program_audiences';
|
||||
|
||||
/**
|
||||
* Keys offered for preferredChannels, in display order.
|
||||
*/
|
||||
public const CHANNELS = [
|
||||
'email' => 'mautic.program.audience.channel.email',
|
||||
'sms' => 'mautic.program.audience.channel.sms',
|
||||
'web' => 'mautic.program.audience.channel.web',
|
||||
'social_organic' => 'mautic.program.audience.channel.social_organic',
|
||||
'paid_social' => 'mautic.program.audience.channel.paid_social',
|
||||
'paid_search' => 'mautic.program.audience.channel.paid_search',
|
||||
'events_webinar' => 'mautic.program.audience.channel.events_webinar',
|
||||
'outbound_sales' => 'mautic.program.audience.channel.outbound_sales',
|
||||
'partners' => 'mautic.program.audience.channel.partners',
|
||||
'email' => 'mt3s.marketing_program.audience.channel.email',
|
||||
'sms' => 'mt3s.marketing_program.audience.channel.sms',
|
||||
'web' => 'mt3s.marketing_program.audience.channel.web',
|
||||
'social_organic' => 'mt3s.marketing_program.audience.channel.social_organic',
|
||||
'paid_social' => 'mt3s.marketing_program.audience.channel.paid_social',
|
||||
'paid_search' => 'mt3s.marketing_program.audience.channel.paid_search',
|
||||
'events_webinar' => 'mt3s.marketing_program.audience.channel.events_webinar',
|
||||
'outbound_sales' => 'mt3s.marketing_program.audience.channel.outbound_sales',
|
||||
'partners' => 'mt3s.marketing_program.audience.channel.partners',
|
||||
];
|
||||
|
||||
private ?int $id = null;
|
||||
@@ -92,13 +92,13 @@ class Audience extends FormEntity
|
||||
private ?string $triggers = null;
|
||||
|
||||
/**
|
||||
* Key of a decision role set up in Settings > Configuration > Initiative Settings
|
||||
* Key of a decision role set up in Settings > Configuration > Program Settings
|
||||
* (parameter program_audience_decision_roles), or null when the attribute is unused.
|
||||
*/
|
||||
private ?string $decisionRole = null;
|
||||
|
||||
/**
|
||||
* Keys of tones set up in Settings > Configuration > Initiative Settings
|
||||
* Keys of tones set up in Settings > Configuration > Program Settings
|
||||
* (parameter program_audience_tones), or null/[] when the attribute is unused.
|
||||
*
|
||||
* @var list<string>|null
|
||||
@@ -106,7 +106,7 @@ class Audience extends FormEntity
|
||||
private ?array $preferredTones = null;
|
||||
|
||||
/**
|
||||
* Keys of self::CHANNELS the initiative means to use for this audience.
|
||||
* Keys of self::CHANNELS the program means to use for this audience.
|
||||
*
|
||||
* @var list<string>|null
|
||||
*/
|
||||
@@ -132,18 +132,18 @@ class Audience extends FormEntity
|
||||
private ?int $estimatedSize = null;
|
||||
|
||||
/**
|
||||
* The links to the initiatives this audience is assigned to. Inverse side, read-only from here: the
|
||||
* links are managed from the plans (Initiative::addAudience/removeAudience).
|
||||
* The links to the mt3s_mp_programs this audience is assigned to. Inverse side, read-only from here: the
|
||||
* links are managed from the plans (Program::addAudience/removeAudience).
|
||||
*
|
||||
* @var Collection<int, InitiativeAudience>
|
||||
* @var Collection<int, ProgramAudience>
|
||||
*/
|
||||
private Collection $initiativeLinks;
|
||||
private Collection $programLinks;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->stages = new ArrayCollection();
|
||||
$this->segments = new ArrayCollection();
|
||||
$this->initiativeLinks = new ArrayCollection();
|
||||
$this->programLinks = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
@@ -151,7 +151,7 @@ class Audience extends FormEntity
|
||||
$this->id = null;
|
||||
$this->stages = new ArrayCollection();
|
||||
$this->segments = new ArrayCollection();
|
||||
$this->initiativeLinks = new ArrayCollection();
|
||||
$this->programLinks = new ArrayCollection();
|
||||
|
||||
parent::__clone();
|
||||
}
|
||||
@@ -213,13 +213,13 @@ class Audience extends FormEntity
|
||||
->build();
|
||||
|
||||
$builder->createManyToMany('stages', Stage::class)
|
||||
->setJoinTable('initiative_audiences_stages')
|
||||
->setJoinTable('mt3s_mp_program_audiences_stages')
|
||||
->addJoinColumn('audience_id', 'id', false, false, 'CASCADE')
|
||||
->addInverseJoinColumn('stage_id', 'id', false, false, 'CASCADE')
|
||||
->build();
|
||||
|
||||
$builder->createManyToMany('segments', LeadList::class)
|
||||
->setJoinTable('initiative_audiences_segments')
|
||||
->setJoinTable('mt3s_mp_program_audiences_segments')
|
||||
->addJoinColumn('audience_id', 'id', false, false, 'CASCADE')
|
||||
->addInverseJoinColumn('leadlist_id', 'id', false, false, 'CASCADE')
|
||||
->build();
|
||||
@@ -230,8 +230,8 @@ class Audience extends FormEntity
|
||||
->option('unsigned', true)
|
||||
->build();
|
||||
|
||||
// The links to the initiatives, managed from the initiatives.
|
||||
$builder->createOneToMany('initiativeLinks', InitiativeAudience::class)
|
||||
// The links to the mt3s_mp_programs, managed from the mt3s_mp_programs.
|
||||
$builder->createOneToMany('programLinks', ProgramAudience::class)
|
||||
->mappedBy('audience')
|
||||
->fetchExtraLazy()
|
||||
->build();
|
||||
@@ -239,9 +239,9 @@ class Audience extends FormEntity
|
||||
|
||||
public static function loadValidatorMetadata(ClassMetadata $metadata): void
|
||||
{
|
||||
$metadata->addPropertyConstraint('name', new NotBlank(message: 'mautic.program.audience.name.required'));
|
||||
$metadata->addPropertyConstraint('name', new NotBlank(message: 'mt3s.marketing_program.audience.name.required'));
|
||||
$metadata->addPropertyConstraint('name', new Length(max: 191));
|
||||
$metadata->addPropertyConstraint('estimatedSize', new PositiveOrZero(message: 'mautic.program.audience.estimated_size.invalid'));
|
||||
$metadata->addPropertyConstraint('estimatedSize', new PositiveOrZero(message: 'mt3s.marketing_program.audience.estimated_size.invalid'));
|
||||
$metadata->addPropertyConstraint('decisionRole', new Length(max: 64));
|
||||
}
|
||||
|
||||
@@ -470,10 +470,10 @@ class Audience extends FormEntity
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, InitiativeAudience>
|
||||
* @return Collection<int, ProgramAudience>
|
||||
*/
|
||||
public function getInitiativeLinks(): Collection
|
||||
public function getProgramLinks(): Collection
|
||||
{
|
||||
return $this->initiativeLinks;
|
||||
return $this->programLinks;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user