Commit 51d02baf authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Divers

parent 9d3a1ec6
Loading
Loading
Loading
Loading
+7 −0
Changes for module/Application/src/ConfigFactory.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -82,6 +82,13 @@ class ConfigFactory
            ];
        }

        if (isset($config['resources'])) {
            if (!isset($finalConfig['bjyauthorize'])) $finalConfig['bjyauthorize'] = [];
            $finalConfig['bjyauthorize']['resource_providers'] = [
                \BjyAuthorize\Provider\Resource\Config::class => $config['resources'],
            ];
        }

        if (isset($config['controllers'])) {
            $finalConfig['controllers'] = [
                'factories' => $config['controllers'],
+1 −1
Changes for module/Application/src/Form/AbstractForm.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ abstract class AbstractForm extends Form implements InputFilterProviderInterface



    public function readOnly(bool $readOnly)
    public function readOnly(bool $readOnly = true)
    {
        /** @var $element \Laminas\Form\Element */
        foreach ($this->getElements() as $element) {
+2 −0
Changes for module/Application/src/ORM/Event/Listeners/ParametreEntityListener.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -167,10 +167,12 @@ class ParametreEntityListener implements EventSubscriber
    {
        $next = $this->nextEntities();
        foreach ($next as $entity) {
            if ($entity) {
                $this->em->remove($entity);
                $this->em->flush($entity);
            }
        }
    }



+2 −5
Changes for module/Intervenant/config/module.config.php: 2 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -21,15 +21,11 @@ return [
            'may_terminate' => true,
            'child_routes'  => [
                'saisie' => [
                    'options'       => [
                    'route'         => '/saisie[/:statut]',
                    'action'        => 'saisie',
                    'constraints'   => [
                        'statut' => '[0-9]*',
                    ],
                        'defaults'    => [
                            'action' => 'saisie',
                        ],
                    ],
                    'may_terminate' => true,
                ],
                'delete' => [
@@ -91,6 +87,7 @@ return [
    'services' => [
        Service\TypeIntervenantService::class => Service\TypeIntervenantServiceFactory::class,
        Service\StatutService::class          => Service\StatutServiceFactory::class,
        Assertion\StatutAssertion::class      => Assertion\StatutAssertionFactory::class,
    ],


+6 −1
Changes for module/Intervenant/src/Controller/StatutController.php: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -68,13 +68,18 @@ class StatutController extends AbstractController
        }

        $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_STATUT_EDITION));
        $canEdit = false;
        if ($canEdit) {
            $form->bindRequestSave($statut, $this->getRequest(), function (Statut $si) {
                try {
                    $isNew = !$si->getId();
                    $this->getServiceStatut()->save($si);
                    unset($this->getCacheContainer(RoleProvider::class)->statutsInfo);
                    unset($this->getCacheContainer(PrivilegeService::class)->privilegesRoles);
                    $this->flashMessenger()->addSuccessMessage('Enregistrement effectué');
                    if ($isNew) {
                        $this->redirect()->toRoute('statut/saisie', ['statut' => $si->getId()]);
                    }
                } catch (\Exception $e) {
                    $this->flashMessenger()->addErrorMessage($this->translate($e));
                }
@@ -84,7 +89,7 @@ class StatutController extends AbstractController
            $form->readOnly();
        }

        return compact('typesIntervenants', 'statuts', 'form', 'title');
        return compact('typesIntervenants', 'statut', 'statuts', 'form', 'title');
    }


Loading