Commit 06f25eba authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Correction problème changement d'année quand on est connecté en tant qu'intervenant

parent 47ba8a18
Loading
Loading
Loading
Loading
Loading
+1 −0
Changes for module/Application/src/Controller/Factory/IndexControllerFactory.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ class IndexControllerFactory
    public function __invoke(ContainerInterface $container, $requestedName, $options = null)
    {
        $controller = new IndexController();
        $controller->setServiceUserContext($container->get(UserContext::class));

        return $controller;
    }
+3 −1
Changes for module/Application/src/Controller/IndexController.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Application\Service\Traits\ContextServiceAwareTrait;
use Application\Service\Traits\ParametresServiceAwareTrait;
use Intervenant\Service\IntervenantServiceAwareTrait;
use Laminas\View\Model\ViewModel;
use UnicaenAuthentification\Service\Traits\UserContextServiceAwareTrait;

/**
 *
@@ -19,6 +20,7 @@ class IndexController extends AbstractController
    use AnneeServiceAwareTrait;
    use IntervenantServiceAwareTrait;
    use ParametresServiceAwareTrait;
    use UserContextServiceAwareTrait;


    public function indexAction()
@@ -80,8 +82,8 @@ class IndexController extends AbstractController
            $role = $this->getServiceContext()->getSelectedIdentityRole();
            if ($role instanceof Role && $role->getIntervenant()) {
                $intervenant = $this->getServiceIntervenant()->getByCode($role->getIntervenant()->getCode());
                if ($intervenant) {
                //Correction mauvais refresh du role lors du changement d'année
                if ($intervenant) {
                    $this->serviceUserContext->setSelectedIdentityRole($intervenant->getStatut()->getRoleId());
                    //$this->serviceUserContext->setNextSelectedIdentityRole($intervenant->getStatut()->getRoleId());
                }