- Implemented TargetType form for managing target details including name, type, priority, stages, estimated size, profile criteria, pain points, value proposition, and preferred channels. - Created migration scripts for adding type and priority columns to plan objectives and tasks. - Added migration for creating plan targets and plan target stages tables, including foreign key constraints. - Introduced stakeholder management with forms and views for creating, editing, and listing stakeholders. - Enhanced UI with read more functionality for long text descriptions and filtering options in plan tab tables.
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace MauticPlugin\PlanBundle\Migrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Mautic\IntegrationsBundle\Migration\AbstractMigration;
|
|
use MauticPlugin\PlanBundle\Entity\PlanObjective;
|
|
|
|
/**
|
|
* Since 0.10.1 objectives have a priority, a whole number from 1 (highest) to 99 (lowest). Adds
|
|
* plan_objectives.priority for installs created before 0.10.1: NOT NULL with the default 1, and the
|
|
* existing objectives get that default. Runs only when the column is missing.
|
|
*/
|
|
class Version_0_10_1 extends AbstractMigration
|
|
{
|
|
protected function isApplicable(Schema $schema): bool
|
|
{
|
|
$objectives = $this->concatPrefix(PlanObjective::TABLE_NAME);
|
|
|
|
if (!$schema->hasTable($objectives)) {
|
|
return false;
|
|
}
|
|
|
|
return !$schema->getTable($objectives)->hasColumn('priority');
|
|
}
|
|
|
|
protected function up(): void
|
|
{
|
|
$objectives = $this->concatPrefix(PlanObjective::TABLE_NAME);
|
|
$table = $this->entityManager->getConnection()->createSchemaManager()->introspectTable($objectives);
|
|
|
|
if (!$table->hasColumn('priority')) {
|
|
$this->addSql(sprintf(
|
|
"ALTER TABLE %s ADD priority INT NOT NULL DEFAULT %d",
|
|
$objectives,
|
|
PlanObjective::PRIORITY_MIN
|
|
));
|
|
}
|
|
}
|
|
}
|