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_*
54 lines
2.0 KiB
PHP
54 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace MauticPlugin\MT3SMarketingProgramBundle\Security\Permissions;
|
|
|
|
use Mautic\CoreBundle\Security\Permissions\AbstractPermissions;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
|
|
/**
|
|
* Permission keys: mt3smarketingprogram:programs:*, mt3smarketingprogram:tasks:*, mt3smarketingprogram:stakeholders:* and
|
|
* mt3smarketingprogram:audiences:* (view/edit/delete/publish own and other, create, full), mt3smarketingprogram:itemtypes:*
|
|
* (the Item types page, Programs > Item types), and mt3smarketingprogram:categories:* (managing the
|
|
* "program" category type).
|
|
*
|
|
* Shown under Settings > Roles. Core discovers this class from Security/Permissions/.
|
|
*/
|
|
class MT3SMarketingProgramPermissions extends AbstractPermissions
|
|
{
|
|
/**
|
|
* @param mixed[] $params
|
|
*/
|
|
public function __construct(array $params)
|
|
{
|
|
parent::__construct($params);
|
|
|
|
$this->addStandardPermissions('categories');
|
|
$this->addExtendedPermissions('programs');
|
|
$this->addExtendedPermissions('tasks');
|
|
$this->addExtendedPermissions('stakeholders');
|
|
$this->addExtendedPermissions('audiences');
|
|
$this->addStandardPermissions('itemtypes');
|
|
}
|
|
|
|
public function getName(): string
|
|
{
|
|
return 'mt3smarketingprogram';
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $options
|
|
* @param array<string, mixed> $data
|
|
*/
|
|
public function buildForm(FormBuilderInterface &$builder, array $options, array $data): void
|
|
{
|
|
$this->addStandardFormFields('mt3smarketingprogram', 'categories', $builder, $data);
|
|
$this->addExtendedFormFields('mt3smarketingprogram', 'programs', $builder, $data);
|
|
$this->addExtendedFormFields('mt3smarketingprogram', 'tasks', $builder, $data);
|
|
$this->addExtendedFormFields('mt3smarketingprogram', 'stakeholders', $builder, $data);
|
|
$this->addExtendedFormFields('mt3smarketingprogram', 'audiences', $builder, $data);
|
|
$this->addStandardFormFields('mt3smarketingprogram', 'itemtypes', $builder, $data);
|
|
}
|
|
}
|