Files
mautic-marketing-program-bu…/Security/Permissions/MT3SMarketingProgramPermissions.php
T
alexandre_gain_mt3s 4fb36eebfc feat(call-script): add the Call Script component (0.19.0)
A new Mautic component, listed under Components > Call Scripts (/s/call-scripts),
built like the other domains on AbstractStandardFormController/FormModel.

- CallScript (mt3s_call_scripts): name, description, category, owner, status,
the publish window shown as start/end date and time, the HTML script with
dynamic tokens kept as typed (html cleaning mask), the calling window
(weekdays, hours, sentinel in the contact's or a fixed timezone) and the retry
policy (max attempts, delay, backoff: none/linear/exponential)
- CallScriptOutcome (mt3s_call_script_outcomes, ON DELETE CASCADE): label,
data type (checkbox/radio/free text/dropdown), options JSON ({value,label})
and position; nested collections reuse the program-collection JS
- validators: ValidCallingWindow, ValidCallScriptOutcomeOptions, and an atPath
option on EndDateAfterStartDate so its violation lands on publishDown
- config: routes, the Components menu item (parent mautic.core.components),
call_script category type, model alias, call_scripts permissions, version 0.19.0
- migration Version_0_19_0 creates both tables and their FKs immediately
(users/categories SET NULL, outcomes CASCADE), idempotent
- translations en_US/fr_FR, unit tests, readme/AGENTS documentation
2026-11-21 20:58:25 +01:00

60 lines
2.5 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->addExtendedPermissions(['smart_links']);
$this->addExtendedPermissions(['taxonomies']);
$this->addExtendedPermissions(['call_scripts']);
$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->addExtendedFormFields('mt3smarketingprogram', 'smart_links', $builder, $data);
$this->addExtendedFormFields('mt3smarketingprogram', 'taxonomies', $builder, $data);
$this->addExtendedFormFields('mt3smarketingprogram', 'call_scripts', $builder, $data);
$this->addStandardFormFields('mt3smarketingprogram', 'itemtypes', $builder, $data);
}
}