Commit a367c81a authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Correction bug #25557

parent 270f7932
Loading
Loading
Loading
Loading
+1
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ author: Laurent Lécluse - DSI - Unicaen

* Un bug modifiant les paramètres globaux qui avaient été configurés a été résolu
* La duplication de statuts refonctionne
* Lors de la création d'un nouveau statut, l'octroi de privilèges ne plante plus


# OSE 9.0.1-zf2 et 9.0.1-zf3
+6
Changes for module/Application/src/Application/Controller/StatutIntervenantController.php: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,9 +2,11 @@

namespace Application\Controller;

use Application\Cache\Traits\CacheContainerTrait;
use Application\Entity\Db\StatutIntervenant;
use Application\Provider\Privilege\Privileges;
use Application\Form\StatutIntervenant\Traits\StatutIntervenantSaisieFormAwareTrait;
use Application\Provider\Role\RoleProvider;
use Application\Service\Traits\StatutIntervenantServiceAwareTrait;
use UnicaenApp\View\Model\MessengerViewModel;
use Application\Service\Traits\TypeIntervenantServiceAwareTrait;
@@ -15,6 +17,7 @@ class StatutIntervenantController extends AbstractController
    use StatutIntervenantServiceAwareTrait;
    use StatutIntervenantSaisieFormAwareTrait;
    use TypeIntervenantServiceAwareTrait;
    use CacheContainerTrait;



@@ -54,6 +57,7 @@ class StatutIntervenantController extends AbstractController
            $form->bindRequestSave($statutIntervenant, $this->getRequest(), function (StatutIntervenant $si) {
                try {
                    $this->getServiceStatutIntervenant()->save($si);
                    unset($this->getCacheContainer(RoleProvider::class)->statutsInfo);
                    $this->flashMessenger()->addSuccessMessage('Enregistrement effectué');
                } catch (\Exception $e) {
                    $this->flashMessenger()->addErrorMessage($this->translate($e));
@@ -82,6 +86,7 @@ class StatutIntervenantController extends AbstractController
        $form->bindRequestSave($newStatutIntervenant, $this->getRequest(), function (StatutIntervenant $si) {
            try {
                $this->getServiceStatutIntervenant()->save($si);
                unset($this->getCacheContainer(RoleProvider::class)->statutsInfo);
                $this->flashMessenger()->addSuccessMessage('Duplication effectuée');
            } catch (\Exception $e) {
                $this->flashMessenger()->addErrorMessage($this->translate($e));
@@ -111,6 +116,7 @@ class StatutIntervenantController extends AbstractController
        } else {
            try {
                $this->getServiceStatutIntervenant()->delete($statutIntervenant);
                unset($this->getCacheContainer(RoleProvider::class)->statutsInfo);
                $this->flashMessenger()->addSuccessMessage("Statut d'Intervenant supprimé avec succès.");
            } catch (\Exception $e) {
                $this->flashMessenger()->addErrorMessage($this->translate($e));
+6 −4
Changes for module/Application/src/Application/Provider/Role/RoleProvider.php: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Application\Provider\Role;

use Application\Cache\Traits\CacheContainerTrait;
use Application\Entity\Db\Affectation;
use Application\Entity\Db\Structure;
use Application\Service\Traits\ContextServiceAwareTrait;
@@ -29,6 +30,7 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface
    use IntervenantServiceAwareTrait;
    use PrivilegeProviderAwareTrait;
    use ContextServiceAwareTrait;
    use CacheContainerTrait;

    /**
     * @var array
@@ -192,8 +194,8 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface

    public function getStatutsInfo()
    {
        $session = $this->getSessionContainer();
        if (!isset($session->statutsInfo)) {
        $cc = $this->getCacheContainer(self::class);
        if (!isset($cc->statutsInfo)) {
            $si      = [];
            $statuts = $this->getServiceStatutIntervenant()->getList();
            foreach ($statuts as $statut) {
@@ -203,10 +205,10 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface
                    'role-name' => $statut->getTypeIntervenant()->getLibelle(),
                ];
            }
            $session->statutsInfo = $si;
            $cc->statutsInfo = $si;
        }

        return $session->statutsInfo;
        return $cc->statutsInfo;
    }