Loading module/Element/config/merged/application-theme.config.php +24 −1 Original line number Diff line number Diff line Loading @@ -41,12 +41,28 @@ return [ 'controller' => ApplicationThemeController::class, 'action' => [ 'ajouter', ], 'privileges' => [ ApplicationthemePrivileges::APPLICATIONTHEME_AJOUTER, ], ], [ 'controller' => ApplicationThemeController::class, 'action' => [ 'modifier', ], 'privileges' => [ ApplicationthemePrivileges::APPLICATIONTHEME_MODIFIER, ], ], [ 'controller' => ApplicationThemeController::class, 'action' => [ 'historiser', 'restaurer', ], 'privileges' => [ ApplicationthemePrivileges::APPLICATIONTHEME_MODIFIER, ApplicationthemePrivileges::APPLICATIONTHEME_HISTORISER, ], ], [ Loading Loading @@ -77,6 +93,7 @@ return [ 'options' => [ 'route' => '/application-theme', 'defaults' => [ /** @see ApplicationThemeController::indexAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'index', ], Loading @@ -87,6 +104,7 @@ return [ 'options' => [ 'route' => '/afficher/:application-groupe', 'defaults' => [ /** @see ApplicationThemeController::afficherAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'afficher', ], Loading @@ -97,6 +115,7 @@ return [ 'options' => [ 'route' => '/ajouter', 'defaults' => [ /** @see ApplicationThemeController::ajouterAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'ajouter', ], Loading @@ -107,6 +126,7 @@ return [ 'options' => [ 'route' => '/modifier/:application-groupe', 'defaults' => [ /** @see ApplicationThemeController::modifierAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'modifier', ], Loading @@ -115,6 +135,7 @@ return [ 'historiser' => [ 'type' => Segment::class, 'options' => [ /** @see ApplicationThemeController::historiserAction() */ 'route' => '/historiser/:application-groupe', 'defaults' => [ 'controller' => ApplicationThemeController::class, Loading @@ -127,6 +148,7 @@ return [ 'options' => [ 'route' => '/restaurer/:application-groupe', 'defaults' => [ /** @see ApplicationThemeController::restaurerAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'restaurer', ], Loading @@ -137,6 +159,7 @@ return [ 'options' => [ 'route' => '/detruire/:application-groupe', 'defaults' => [ /** @see ApplicationThemeController::detruireAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'detruire', ], Loading module/Element/config/merged/application.config.php +0 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ use Element\Service\Application\ApplicationServiceFactory; use Element\Service\HasApplicationCollection\HasApplicationCollectionService; use Element\Service\HasApplicationCollection\HasApplicationCollectionServiceFactory; use Element\View\Helper\ApplicationBlocViewHelper; use Element\View\Helper\ApplicationViewHelper; use UnicaenPrivilege\Guard\PrivilegeController; use Laminas\Router\Http\Literal; use Laminas\Router\Http\Segment; Loading Loading @@ -273,7 +272,6 @@ return [ ], 'view_helpers' => [ 'invokables' => [ 'application' => ApplicationViewHelper::class, 'applicationBloc' => ApplicationBlocViewHelper::class, ], ], Loading module/Element/src/Element/Controller/ApplicationThemeController.php +3 −3 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ class ApplicationThemeController extends AbstractActionController { } $vm = new ViewModel(); $vm->setTemplate('element/default/default-form'); $vm->setTemplate('default/default-form'); $vm->setVariables([ 'title' => "Ajout d'un thème d'application", 'form' => $form, Loading @@ -79,7 +79,7 @@ class ApplicationThemeController extends AbstractActionController { } $vm = new ViewModel(); $vm->setTemplate('application/default/default-form'); $vm->setTemplate('default/default-form'); $vm->setVariables([ 'title' => "Modification d'un thème d'application", 'form' => $form, Loading Loading @@ -115,7 +115,7 @@ class ApplicationThemeController extends AbstractActionController { $vm = new ViewModel(); if ($groupe !== null) { $vm->setTemplate('application/default/confirmation'); $vm->setTemplate('default/confirmation'); $vm->setVariables([ 'title' => "Suppression du groupe d'application [" . $groupe->getLibelle(). "]", 'text' => "La suppression est définitive êtes-vous sûr·e de vouloir continuer ?", Loading module/Element/src/Element/Controller/ApplicationThemeControllerFactory.php +4 −0 Original line number Diff line number Diff line Loading @@ -5,12 +5,16 @@ namespace Element\Controller; use Element\Form\ApplicationTheme\ApplicationThemeForm; use Element\Service\ApplicationTheme\ApplicationThemeService; use Interop\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; class ApplicationThemeControllerFactory { /** * @param ContainerInterface $container * @return ApplicationThemeController * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function __invoke(ContainerInterface $container) : ApplicationThemeController { Loading module/Element/src/Element/Entity/Db/ApplicationElement.php +9 −30 Original line number Diff line number Diff line Loading @@ -14,63 +14,42 @@ class ApplicationElement implements HistoriqueAwareInterface, ValidableInterface use ValidableAwareTrait; use HasNiveauTrait; /** @var integer */ private $id; /** @var Application */ private $application; /** @var string */ private $commentaire; private ?int $id = null; private ?Application $application = null; private ?string $commentaire = null; /** * @return int */ public function getId(): int public function getId(): ?int { return $this->id; } /** * @return Application|null */ public function getApplication(): ?Application { return $this->application; } /** * @param Application|null $application * @return ApplicationElement */ public function setApplication(?Application $application): ApplicationElement public function setApplication(?Application $application): void { $this->application = $application; return $this; } /** * @return string|null */ public function getCommentaire(): ?string { return $this->commentaire; } /** * @param string|null $commentaire * @return ApplicationElement */ public function setCommentaire(?string $commentaire): ApplicationElement public function setCommentaire(?string $commentaire): void { $this->commentaire = $commentaire; return $this; } public function getLibelle() public function getLibelle() : ?string { return ($this->application)?$this->application->getLibelle():""; } public function getObjet() { public function getObjet() : ?Application { return $this->getApplication(); } } No newline at end of file Loading
module/Element/config/merged/application-theme.config.php +24 −1 Original line number Diff line number Diff line Loading @@ -41,12 +41,28 @@ return [ 'controller' => ApplicationThemeController::class, 'action' => [ 'ajouter', ], 'privileges' => [ ApplicationthemePrivileges::APPLICATIONTHEME_AJOUTER, ], ], [ 'controller' => ApplicationThemeController::class, 'action' => [ 'modifier', ], 'privileges' => [ ApplicationthemePrivileges::APPLICATIONTHEME_MODIFIER, ], ], [ 'controller' => ApplicationThemeController::class, 'action' => [ 'historiser', 'restaurer', ], 'privileges' => [ ApplicationthemePrivileges::APPLICATIONTHEME_MODIFIER, ApplicationthemePrivileges::APPLICATIONTHEME_HISTORISER, ], ], [ Loading Loading @@ -77,6 +93,7 @@ return [ 'options' => [ 'route' => '/application-theme', 'defaults' => [ /** @see ApplicationThemeController::indexAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'index', ], Loading @@ -87,6 +104,7 @@ return [ 'options' => [ 'route' => '/afficher/:application-groupe', 'defaults' => [ /** @see ApplicationThemeController::afficherAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'afficher', ], Loading @@ -97,6 +115,7 @@ return [ 'options' => [ 'route' => '/ajouter', 'defaults' => [ /** @see ApplicationThemeController::ajouterAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'ajouter', ], Loading @@ -107,6 +126,7 @@ return [ 'options' => [ 'route' => '/modifier/:application-groupe', 'defaults' => [ /** @see ApplicationThemeController::modifierAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'modifier', ], Loading @@ -115,6 +135,7 @@ return [ 'historiser' => [ 'type' => Segment::class, 'options' => [ /** @see ApplicationThemeController::historiserAction() */ 'route' => '/historiser/:application-groupe', 'defaults' => [ 'controller' => ApplicationThemeController::class, Loading @@ -127,6 +148,7 @@ return [ 'options' => [ 'route' => '/restaurer/:application-groupe', 'defaults' => [ /** @see ApplicationThemeController::restaurerAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'restaurer', ], Loading @@ -137,6 +159,7 @@ return [ 'options' => [ 'route' => '/detruire/:application-groupe', 'defaults' => [ /** @see ApplicationThemeController::detruireAction() */ 'controller' => ApplicationThemeController::class, 'action' => 'detruire', ], Loading
module/Element/config/merged/application.config.php +0 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ use Element\Service\Application\ApplicationServiceFactory; use Element\Service\HasApplicationCollection\HasApplicationCollectionService; use Element\Service\HasApplicationCollection\HasApplicationCollectionServiceFactory; use Element\View\Helper\ApplicationBlocViewHelper; use Element\View\Helper\ApplicationViewHelper; use UnicaenPrivilege\Guard\PrivilegeController; use Laminas\Router\Http\Literal; use Laminas\Router\Http\Segment; Loading Loading @@ -273,7 +272,6 @@ return [ ], 'view_helpers' => [ 'invokables' => [ 'application' => ApplicationViewHelper::class, 'applicationBloc' => ApplicationBlocViewHelper::class, ], ], Loading
module/Element/src/Element/Controller/ApplicationThemeController.php +3 −3 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ class ApplicationThemeController extends AbstractActionController { } $vm = new ViewModel(); $vm->setTemplate('element/default/default-form'); $vm->setTemplate('default/default-form'); $vm->setVariables([ 'title' => "Ajout d'un thème d'application", 'form' => $form, Loading @@ -79,7 +79,7 @@ class ApplicationThemeController extends AbstractActionController { } $vm = new ViewModel(); $vm->setTemplate('application/default/default-form'); $vm->setTemplate('default/default-form'); $vm->setVariables([ 'title' => "Modification d'un thème d'application", 'form' => $form, Loading Loading @@ -115,7 +115,7 @@ class ApplicationThemeController extends AbstractActionController { $vm = new ViewModel(); if ($groupe !== null) { $vm->setTemplate('application/default/confirmation'); $vm->setTemplate('default/confirmation'); $vm->setVariables([ 'title' => "Suppression du groupe d'application [" . $groupe->getLibelle(). "]", 'text' => "La suppression est définitive êtes-vous sûr·e de vouloir continuer ?", Loading
module/Element/src/Element/Controller/ApplicationThemeControllerFactory.php +4 −0 Original line number Diff line number Diff line Loading @@ -5,12 +5,16 @@ namespace Element\Controller; use Element\Form\ApplicationTheme\ApplicationThemeForm; use Element\Service\ApplicationTheme\ApplicationThemeService; use Interop\Container\ContainerInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; class ApplicationThemeControllerFactory { /** * @param ContainerInterface $container * @return ApplicationThemeController * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function __invoke(ContainerInterface $container) : ApplicationThemeController { Loading
module/Element/src/Element/Entity/Db/ApplicationElement.php +9 −30 Original line number Diff line number Diff line Loading @@ -14,63 +14,42 @@ class ApplicationElement implements HistoriqueAwareInterface, ValidableInterface use ValidableAwareTrait; use HasNiveauTrait; /** @var integer */ private $id; /** @var Application */ private $application; /** @var string */ private $commentaire; private ?int $id = null; private ?Application $application = null; private ?string $commentaire = null; /** * @return int */ public function getId(): int public function getId(): ?int { return $this->id; } /** * @return Application|null */ public function getApplication(): ?Application { return $this->application; } /** * @param Application|null $application * @return ApplicationElement */ public function setApplication(?Application $application): ApplicationElement public function setApplication(?Application $application): void { $this->application = $application; return $this; } /** * @return string|null */ public function getCommentaire(): ?string { return $this->commentaire; } /** * @param string|null $commentaire * @return ApplicationElement */ public function setCommentaire(?string $commentaire): ApplicationElement public function setCommentaire(?string $commentaire): void { $this->commentaire = $commentaire; return $this; } public function getLibelle() public function getLibelle() : ?string { return ($this->application)?$this->application->getLibelle():""; } public function getObjet() { public function getObjet() : ?Application { return $this->getApplication(); } } No newline at end of file