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
+20
-20
@@ -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;
|
||||
@@ -10,9 +10,9 @@ use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata as OrmClassMetadata;
|
||||
use Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder;
|
||||
use Mautic\CoreBundle\Entity\FormEntity;
|
||||
use MauticPlugin\ProgramBundle\Validator\Constraints\EndDateAfterStartDate;
|
||||
use MauticPlugin\ProgramBundle\Validator\Constraints\TaskDates;
|
||||
use MauticPlugin\ProgramBundle\Validator\Constraints\ValidTaskDependency;
|
||||
use MauticPlugin\MT3SMarketingProgramBundle\Validator\Constraints\EndDateAfterStartDate;
|
||||
use MauticPlugin\MT3SMarketingProgramBundle\Validator\Constraints\TaskDates;
|
||||
use MauticPlugin\MT3SMarketingProgramBundle\Validator\Constraints\ValidTaskDependency;
|
||||
use Symfony\Component\Validator\Constraints\Length;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Constraints\PositiveOrZero;
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\Validator\Constraints\Range;
|
||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
|
||||
/**
|
||||
* A task of an initiative. Every task belongs to exactly one initiative.
|
||||
* A task of an program. Every task belongs to exactly one program.
|
||||
*
|
||||
* Kinds (taskKind): a regular task; a milestone, whose end date is enslaved to its start date; or a
|
||||
* phase, which has no status of its own — it is a collection of tasks.
|
||||
@@ -29,15 +29,15 @@ use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
* End2End, Start2Start or Start2End. The former parent/child tree is replaced by this dependency
|
||||
* graph.
|
||||
*
|
||||
* RACI: a task is assigned to the initiative's stakeholders through TaskRaci rows (R/A/C/I), several
|
||||
* RACI: a task is assigned to the program's stakeholders through TaskRaci rows (R/A/C/I), several
|
||||
* stakeholders per role.
|
||||
*
|
||||
* Database rules: deleting the initiative deletes its tasks (ON DELETE CASCADE); deleting a task deletes
|
||||
* Database rules: deleting the program deletes its tasks (ON DELETE CASCADE); deleting a task deletes
|
||||
* its dependencies and RACI rows (ON DELETE CASCADE).
|
||||
*/
|
||||
class Task extends FormEntity implements DateRangeInterface
|
||||
{
|
||||
public const TABLE_NAME = 'initiative_tasks';
|
||||
public const TABLE_NAME = 'mt3s_mp_program_tasks';
|
||||
|
||||
public const TYPE_MAX_LENGTH = 64;
|
||||
|
||||
@@ -48,7 +48,7 @@ class Task extends FormEntity implements DateRangeInterface
|
||||
|
||||
private ?int $id = null;
|
||||
|
||||
private ?Initiative $initiative = null;
|
||||
private ?Program $program = null;
|
||||
|
||||
/**
|
||||
* Key of a task type set up in Settings > Configuration > Program Settings (parameter program_task_types);
|
||||
@@ -106,9 +106,9 @@ class Task extends FormEntity implements DateRangeInterface
|
||||
|
||||
$builder->addId();
|
||||
|
||||
$builder->createManyToOne('initiative', Initiative::class)
|
||||
$builder->createManyToOne('program', Program::class)
|
||||
->inversedBy('tasks')
|
||||
->addJoinColumn('initiative_id', 'id', false, false, 'CASCADE')
|
||||
->addJoinColumn('program_id', 'id', false, false, 'CASCADE')
|
||||
->build();
|
||||
|
||||
$builder->createField('type', Types::STRING)
|
||||
@@ -191,11 +191,11 @@ class Task extends FormEntity implements DateRangeInterface
|
||||
{
|
||||
$metadata->addPropertyConstraint('name', new NotBlank(message: 'mautic.core.name.required'));
|
||||
$metadata->addPropertyConstraint('name', new Length(max: 255));
|
||||
$metadata->addPropertyConstraint('initiative', new NotBlank(message: 'mautic.program.task.initiative.required'));
|
||||
$metadata->addPropertyConstraint('type', new NotBlank(message: 'mautic.program.task.type.required'));
|
||||
$metadata->addPropertyConstraint('program', new NotBlank(message: 'mt3s.marketing_program.task.program.required'));
|
||||
$metadata->addPropertyConstraint('type', new NotBlank(message: 'mt3s.marketing_program.task.type.required'));
|
||||
$metadata->addPropertyConstraint('type', new Length(max: self::TYPE_MAX_LENGTH));
|
||||
$metadata->addPropertyConstraint('plannedWork', new PositiveOrZero(message: 'mautic.program.task.planned_work.invalid'));
|
||||
$metadata->addPropertyConstraint('plannedWork', new Range(notInRangeMessage: 'mautic.program.task.planned_work.range', min: 0, max: self::PLANNED_WORK_MAX));
|
||||
$metadata->addPropertyConstraint('plannedWork', new PositiveOrZero(message: 'mt3s.marketing_program.task.planned_work.invalid'));
|
||||
$metadata->addPropertyConstraint('plannedWork', new Range(notInRangeMessage: 'mt3s.marketing_program.task.planned_work.range', min: 0, max: self::PLANNED_WORK_MAX));
|
||||
$metadata->addConstraint(new EndDateAfterStartDate());
|
||||
$metadata->addConstraint(new TaskDates());
|
||||
$metadata->addConstraint(new ValidTaskDependency());
|
||||
@@ -206,15 +206,15 @@ class Task extends FormEntity implements DateRangeInterface
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getInitiative(): ?Initiative
|
||||
public function getProgram(): ?Program
|
||||
{
|
||||
return $this->initiative;
|
||||
return $this->program;
|
||||
}
|
||||
|
||||
public function setInitiative(?Initiative $initiative): static
|
||||
public function setProgram(?Program $program): static
|
||||
{
|
||||
$this->isChanged('initiative', $initiative);
|
||||
$this->initiative = $initiative;
|
||||
$this->isChanged('program', $program);
|
||||
$this->program = $program;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user