Commit c12c3606 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'FixAvantDeploiement'

parents 52f9be5b 6484ed80
Loading
Loading
Loading
Loading
Loading
+10
Changes for module/Application/config/others/structure.config.php: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ return [
                    'controller' => StructureController::class,
                    'action'     => [
                        'individu-role',
                        'generer-roles-defauts',
                    ],
                    'privileges' => EtablissementPrivileges::ETABLISSEMENT_CONSULTATION,
                ],
@@ -53,6 +54,15 @@ return [
                            ],
                        ],
                    ],
                    'generer-roles-defauts' => [
                        'type'          => Segment::class,
                        'options'       => [
                            'route'       => '/generer-roles-defauts/:id/:type',
                            'defaults'    => [
                                'action' => 'generer-roles-defauts',
                            ],
                        ],
                    ],
                ],
            ],
        ],
+12
Changes for module/Application/src/Application/Controller/Factory/StructureControllerFactory.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,9 +3,12 @@
namespace Application\Controller\Factory;

use Application\Controller\StructureController;
use Application\Service\EcoleDoctorale\EcoleDoctoraleService;
use Application\Service\Etablissement\EtablissementService;
use Application\Service\Individu\IndividuService;
use Application\Service\Role\RoleService;
use Application\Service\Structure\StructureService;
use Application\Service\UniteRecherche\UniteRechercheService;
use Zend\Mvc\Controller\ControllerManager;

class StructureControllerFactory
@@ -24,16 +27,25 @@ class StructureControllerFactory
         * @var IndividuService $individuService
         * @var RoleService $roleService
         * @var StructureService $structureService
         * @var EcoleDoctoraleService $ecoleService
         * @var UniteRechercheService $uniteService
         * @var EtablissementService $etablissementService
         */

        $individuService = $sl->get('IndividuService');
        $roleService = $sl->get('RoleService');
        $structureService = $sl->get('StructureService');
        $ecoleService = $sl->get('EcoleDoctoraleService');
        $uniteService = $sl->get('UniteRechercheService');
        $etablissementService = $sl->get('EtablissementService');

        $controller = new StructureController();
        $controller->setIndividuService($individuService);
        $controller->setRoleService($roleService);
        $controller->setStructureService($structureService);
        $controller->setEcoleDoctoraleService($ecoleService);
        $controller->setUniteRechercheService($uniteService);
        $controller->setEtablissementService($etablissementService);

        return $controller;
    }
+35
Changes for module/Application/src/Application/Controller/StructureController.php: 35 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,9 +4,13 @@ namespace Application\Controller;

use Application\Entity\Db\IndividuRole;
use Application\Entity\Db\Role;
use Application\Entity\Db\TypeStructure;
use Application\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareTrait;
use Application\Service\Etablissement\EtablissementServiceAwareTrait;
use Application\Service\Individu\IndividuServiceAwareTrait;
use Application\Service\Role\RoleServiceAwareTrait;
use Application\Service\Structure\StructureServiceAwareTrait;
use Application\Service\UniteRecherche\UniteRechercheServiceAwareTrait;
use Zend\View\Model\ViewModel;

class StructureController extends AbstractController
@@ -14,6 +18,9 @@ class StructureController extends AbstractController
    use RoleServiceAwareTrait;
    use IndividuServiceAwareTrait;
    use StructureServiceAwareTrait;
    use EcoleDoctoraleServiceAwareTrait;
    use UniteRechercheServiceAwareTrait;
    use EtablissementServiceAwareTrait;

    public function individuRoleAction()
    {
@@ -57,4 +64,32 @@ class StructureController extends AbstractController
            'type' => $type,
        ]);
    }


    /**
     * @throws \Doctrine\ORM\OptimisticLockException
     */
    public function genererRolesDefautsAction() {
        $id   = $this->params()->fromRoute('id');
        $type = $this->params()->fromRoute('type');

        switch($type) {
            case TypeStructure::CODE_ECOLE_DOCTORALE :
                $ecole = $this->getEcoleDoctoraleService()->getEcoleDoctoraleByStructureId($id);
                $this->getRoleService()->addRoleByStructure($ecole);
                $this->redirect()->toRoute('ecole-doctorale', [], ['query' => ['selected' => $id]]);
                break;
            case TypeStructure::CODE_UNITE_RECHERCHE :
                $unite = $this->getUniteRechercheService()->getUniteRechercheByStructureId($id);
                $this->getRoleService()->addRoleByStructure($unite);
                $this->redirect()->toRoute('unite-recherche', [], ['query' => ['selected' => $id]]);
                break;
            case TypeStructure::CODE_ETABLISSEMENT :
                $unite = $this->getEtablissementService()->getEtablissementByStructureId($id);
                $this->getRoleService()->addRoleByStructure($unite);
                $this->redirect()->toRoute('etablissement', [], ['query' => ['selected' => $id]]);
                break;
        }
    }

}
 No newline at end of file
+1
Changes for module/Application/src/Application/Controller/TheseController.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -1399,6 +1399,7 @@ class TheseController extends AbstractController
                    //message de notification dans la page
                    $message = "Les points de vigilance viennent d'être sauvegardés.";
                    $this->flashMessenger()->addSuccessMessage($message);
                    $this->redirect()->toRoute('these/points-de-vigilance', ["these" => $these->getId()]);
                }
            }
        }
+4
Changes for module/Application/src/Application/Service/EcoleDoctorale/EcoleDoctoraleServiceAwareTrait.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -16,4 +16,8 @@ trait EcoleDoctoraleServiceAwareTrait
    {
        $this->ecoleDoctoraleService = $ecoleDoctoraleService;
    }

    public function getEcoleDoctoraleService() {
        return $this->ecoleDoctoraleService;
    }
}
 No newline at end of file
Loading