first delivery

This commit is contained in:
Alexandre Gain committed 2026-11-07 19:31:49 +01:00
1 parent 793fbc0c91
commit f6684f3b2e
65 files changed
+5828

No files matched your search

+97
View File
@@ -0,0 +1,97 @@
<?php
declare(strict_types=1);
return [
'name' => 'Plan',
'description' => 'Plan plugin for Mautic.',
'version' => '0.8.0',
'author' => 'Experiential',
'routes' => [
'main' => [
'plan_index' => [
'path' => '/plans/{page}',
'controller' => 'MauticPlugin\PlanBundle\Controller\PlanController::indexAction',
],
// objectAction: view, new, edit, delete, batchDelete.
'plan_action' => [
'path' => '/plans/{objectAction}/{objectId}',
'controller' => 'MauticPlugin\PlanBundle\Controller\PlanController::executeAction',
],
'plan_task_index' => [
'path' => '/plan-tasks/{page}',
'controller' => 'MauticPlugin\PlanBundle\Controller\TaskController::indexAction',
],
// objectAction: new (optional ?plan=ID), edit, delete, batchDelete.
'plan_task_action' => [
'path' => '/plan-tasks/{objectAction}/{objectId}',
'controller' => 'MauticPlugin\PlanBundle\Controller\TaskController::executeAction',
],
],
],
// Top-level "Planning" menu. Future planning objects go in its children, after Plans.
'menu' => [
'main' => [
'mautic.plan.menu.root' => [
'id' => 'plan_root',
'iconClass' => 'ri-calendar-line',
'access' => ['plan:plans:viewown', 'plan:plans:viewother', 'plan:tasks:viewown', 'plan:tasks:viewother'],
'priority' => 5,
'children' => [
'mautic.plan.menu.index' => [
'id' => 'plan_index',
'route' => 'plan_index',
'access' => ['plan:plans:viewown', 'plan:plans:viewother'],
'priority' => 100,
],
'mautic.plan.task.menu.index' => [
'id' => 'plan_task_index',
'route' => 'plan_task_index',
'access' => ['plan:tasks:viewown', 'plan:tasks:viewother'],
'priority' => 90,
],
],
],
],
],
'services' => [
'integrations' => [
'mautic.plan.integration' => [
'class' => MauticPlugin\PlanBundle\Integration\PlanIntegration::class,
'tags' => [
'mautic.integration',
'mautic.basic_integration',
],
],
'mautic.plan.integration.configuration' => [
'class' => MauticPlugin\PlanBundle\Integration\Support\ConfigSupport::class,
'tags' => [
'mautic.config_integration',
],
],
],
],
// Registers "plan" as a category type (Settings > Categories), used by Plan::$category.
'categories' => [
'plan' => [
'class' => MauticPlugin\PlanBundle\Entity\Plan::class,
'label' => 'mautic.plan.category.type',
],
],
'parameters' => [
// The currency of every amount in the plugin (ISO 4217), edited in Settings > Configuration >
// Plan Settings. Read it through CurrencyProvider.
'plan_currency' => 'EUR',
// Item types, edited in Settings > Configuration > Plan Settings. Read them through ItemTypeProvider.
// Each is a list of ['key' => …, 'names' => [locale => …], 'descriptions' => [locale => …]],
// plus 'icon' => a Remix Icon class for description item types.
'plan_description_item_types' => [],
'plan_allocation_item_types' => [],
],
];
+30
View File
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
use Mautic\CoreBundle\DependencyInjection\MauticCoreExtension;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return function (ContainerConfigurator $configurator): void {
$services = $configurator->services()
->defaults()
->autowire()
->autoconfigure()
->public();
$excludes = [
'Tests',
];
$services->load('MauticPlugin\\PlanBundle\\', '../')
->exclude('../{'.implode(',', array_merge(MauticCoreExtension::DEFAULT_EXCLUDES, $excludes)).'}');
// Entity/ is excluded above; repositories must still be services for Doctrine to build them.
$services->load('MauticPlugin\\PlanBundle\\Entity\\', '../Entity/*Repository.php')
->tag(Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass::REPOSITORY_SERVICE_TAG);
// Lets core resolve the model with getModel('plan') / getModel('plan.plan').
$services->alias('mautic.plan.model.plan', MauticPlugin\PlanBundle\Model\PlanModel::class);
// getModel('plan.task').
$services->alias('mautic.plan.model.task', MauticPlugin\PlanBundle\Model\TaskModel::class);
};