Loading module/Application/src/Application/Controller/EcoleDoctoraleController.php +5 −29 Changes for module/Application/src/Application/Controller/EcoleDoctoraleController.php: 5 added lines, 29 removed lines. Original line number Diff line number Diff line Loading @@ -7,12 +7,13 @@ use Application\Entity\Db\Individu; use Application\Entity\Db\IndividuRole; use Application\Entity\Db\Role; use Application\Entity\Db\Structure; use Application\Entity\Db\StructureConcreteInterface; use Application\Entity\Db\TypeStructure; use Application\Form\EcoleDoctoraleForm; 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 UnicaenApp\Exception\RuntimeException; use Zend\View\Model\ViewModel; Loading @@ -22,39 +23,14 @@ class EcoleDoctoraleController extends AbstractController use IndividuServiceAwareTrait; use RoleServiceAwareTrait; use EtablissementServiceAwareTrait; use StructureServiceAwareTrait; /** * L'index récupére : * - la liste des écoles doctorales * - l'école doctorale sélectionnée * - la liste des rôles associées à l'école * - un tableau de tableaux des rôles associés à chaque rôle * @return \Zend\Http\Response|ViewModel */ public function indexAction() { $structuresAll = $this->getEcoleDoctoraleService()->getRepository()->findAll(); /** retrait des structures substituées */ $structuresSub = array_filter($structuresAll, function (StructureConcreteInterface $structure) { return count($structure->getStructure()->getStructuresSubstituees())!=0; }); $toRemove = []; /** @var EcoleDoctorale $structure */ foreach($structuresSub as $structure) { foreach ($structure->getStructure()->getStructuresSubstituees() as $sub) { $toRemove[] = $sub; } } $structures = []; foreach ($structuresAll as $structure) { $found = false; foreach ($toRemove as $remove) { if($structure->getStructure()->getId() == $remove->getId()) $found = true; } if (!$found) $structures[] = $structure; } $eds = $this->getStructureService()->getStructuresNonSubstitueesByType(TypeStructure::CODE_ECOLE_DOCTORALE, 'libelle'); return new ViewModel([ 'ecoles' => $structures, 'ecoles' => $eds, ]); } Loading module/Application/src/Application/Controller/EtablissementController.php +2 −0 Changes for module/Application/src/Application/Controller/EtablissementController.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ use Application\Form\EtablissementForm; use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Application\Service\Individu\IndividuServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Application\Service\Structure\StructureServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; use Zend\View\Model\ViewModel; Loading @@ -24,6 +25,7 @@ class EtablissementController extends AbstractController use EtablissementServiceAwareTrait; use IndividuServiceAwareTrait; use RoleServiceAwareTrait; use StructureServiceAwareTrait; /** * @var EtablissementForm $etablissementForm Loading module/Application/src/Application/Controller/Factory/EcoleDoctoraleControllerFactory.php +4 −0 Changes for module/Application/src/Application/Controller/Factory/EcoleDoctoraleControllerFactory.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Application\Service\EcoleDoctorale\EcoleDoctoraleService; use Application\Service\Etablissement\EtablissementServiceLocateTrait; use Application\Service\Individu\IndividuService; use Application\Service\Role\RoleService; use Application\Service\Structure\StructureService; use Zend\Mvc\Controller\ControllerManager; class EcoleDoctoraleControllerFactory Loading @@ -31,9 +32,11 @@ class EcoleDoctoraleControllerFactory * @var EcoleDoctoraleService $ecoleDoctoralService * @var IndividuService $individuService * @var RoleService $roleService * @var StructureService $structureService */ $ecoleDoctoralService = $sl->get('EcoleDoctoraleService'); $individuService = $sl->get('IndividuService'); $structureService = $sl->get(StructureService::class); $roleService = $sl->get('RoleService'); $controller = new EcoleDoctoraleController(); Loading @@ -42,6 +45,7 @@ class EcoleDoctoraleControllerFactory $controller->setRoleService($roleService); $controller->setEtablissementService($this->locateEtablissementService($sl)); $controller->setEcoleDoctoraleForm($form); $controller->setStructureService($structureService); return $controller; } Loading module/Application/src/Application/Controller/Factory/EtablissementControllerFactory.php +4 −0 Changes for module/Application/src/Application/Controller/Factory/EtablissementControllerFactory.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Form\EtablissementForm; use Application\Service\Etablissement\EtablissementService; use Application\Service\Individu\IndividuService; use Application\Service\Role\RoleService; use Application\Service\Structure\StructureService; use Zend\Mvc\Controller\ControllerManager; class EtablissementControllerFactory Loading @@ -26,15 +27,18 @@ class EtablissementControllerFactory * @var EtablissementService $etablissmentService * @var IndividuService $individuService * @var RoleService $roleService * @var StructureService $structureService */ $etablissmentService = $controllerManager->getServiceLocator()->get('EtablissementService'); $individuService = $controllerManager->getServiceLocator()->get('IndividuService'); $roleService = $controllerManager->getServiceLocator()->get('RoleService'); $structureService = $controllerManager->getServiceLocator()->get(StructureService::class); $controller = new EtablissementController(); $controller->setEtablissementService($etablissmentService); $controller->setIndividuService($individuService); $controller->setRoleService($roleService); $controller->setStructureService($structureService); $controller->setEtablissementForm($form); return $controller; Loading module/Application/src/Application/Controller/Factory/UniteRechercheControllerFactory.php +4 −0 Changes for module/Application/src/Application/Controller/Factory/UniteRechercheControllerFactory.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Application\Service\DomaineScientifiqueService; use Application\Service\Etablissement\EtablissementServiceLocateTrait; 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; Loading @@ -32,11 +33,13 @@ class UniteRechercheControllerFactory * @var UniteRechercheService $uniteRechercheService * @var IndividuService $individuService * @var RoleService $roleService * @var StructureService $structureService * @var DomaineScientifiqueService $domaineService */ $uniteRechercheService = $sl->get('UniteRechercheService'); $individuService = $sl->get('IndividuService'); $roleService = $sl->get('RoleService'); $structureService = $sl->get(StructureService::class); $domaineService = $sl->get(DomaineScientifiqueService::class); $controller = new UniteRechercheController(); Loading @@ -45,6 +48,7 @@ class UniteRechercheControllerFactory $controller->setRoleService($roleService); $controller->setEtablissementService($this->locateEtablissementService($sl)); $controller->setDomaineScientifiqueService($domaineService); $controller->setStructureService($structureService); $controller->setUniteRechercheForm($form); return $controller; Loading Loading
module/Application/src/Application/Controller/EcoleDoctoraleController.php +5 −29 Changes for module/Application/src/Application/Controller/EcoleDoctoraleController.php: 5 added lines, 29 removed lines. Original line number Diff line number Diff line Loading @@ -7,12 +7,13 @@ use Application\Entity\Db\Individu; use Application\Entity\Db\IndividuRole; use Application\Entity\Db\Role; use Application\Entity\Db\Structure; use Application\Entity\Db\StructureConcreteInterface; use Application\Entity\Db\TypeStructure; use Application\Form\EcoleDoctoraleForm; 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 UnicaenApp\Exception\RuntimeException; use Zend\View\Model\ViewModel; Loading @@ -22,39 +23,14 @@ class EcoleDoctoraleController extends AbstractController use IndividuServiceAwareTrait; use RoleServiceAwareTrait; use EtablissementServiceAwareTrait; use StructureServiceAwareTrait; /** * L'index récupére : * - la liste des écoles doctorales * - l'école doctorale sélectionnée * - la liste des rôles associées à l'école * - un tableau de tableaux des rôles associés à chaque rôle * @return \Zend\Http\Response|ViewModel */ public function indexAction() { $structuresAll = $this->getEcoleDoctoraleService()->getRepository()->findAll(); /** retrait des structures substituées */ $structuresSub = array_filter($structuresAll, function (StructureConcreteInterface $structure) { return count($structure->getStructure()->getStructuresSubstituees())!=0; }); $toRemove = []; /** @var EcoleDoctorale $structure */ foreach($structuresSub as $structure) { foreach ($structure->getStructure()->getStructuresSubstituees() as $sub) { $toRemove[] = $sub; } } $structures = []; foreach ($structuresAll as $structure) { $found = false; foreach ($toRemove as $remove) { if($structure->getStructure()->getId() == $remove->getId()) $found = true; } if (!$found) $structures[] = $structure; } $eds = $this->getStructureService()->getStructuresNonSubstitueesByType(TypeStructure::CODE_ECOLE_DOCTORALE, 'libelle'); return new ViewModel([ 'ecoles' => $structures, 'ecoles' => $eds, ]); } Loading
module/Application/src/Application/Controller/EtablissementController.php +2 −0 Changes for module/Application/src/Application/Controller/EtablissementController.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ use Application\Form\EtablissementForm; use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Application\Service\Individu\IndividuServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Application\Service\Structure\StructureServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; use Zend\View\Model\ViewModel; Loading @@ -24,6 +25,7 @@ class EtablissementController extends AbstractController use EtablissementServiceAwareTrait; use IndividuServiceAwareTrait; use RoleServiceAwareTrait; use StructureServiceAwareTrait; /** * @var EtablissementForm $etablissementForm Loading
module/Application/src/Application/Controller/Factory/EcoleDoctoraleControllerFactory.php +4 −0 Changes for module/Application/src/Application/Controller/Factory/EcoleDoctoraleControllerFactory.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Application\Service\EcoleDoctorale\EcoleDoctoraleService; use Application\Service\Etablissement\EtablissementServiceLocateTrait; use Application\Service\Individu\IndividuService; use Application\Service\Role\RoleService; use Application\Service\Structure\StructureService; use Zend\Mvc\Controller\ControllerManager; class EcoleDoctoraleControllerFactory Loading @@ -31,9 +32,11 @@ class EcoleDoctoraleControllerFactory * @var EcoleDoctoraleService $ecoleDoctoralService * @var IndividuService $individuService * @var RoleService $roleService * @var StructureService $structureService */ $ecoleDoctoralService = $sl->get('EcoleDoctoraleService'); $individuService = $sl->get('IndividuService'); $structureService = $sl->get(StructureService::class); $roleService = $sl->get('RoleService'); $controller = new EcoleDoctoraleController(); Loading @@ -42,6 +45,7 @@ class EcoleDoctoraleControllerFactory $controller->setRoleService($roleService); $controller->setEtablissementService($this->locateEtablissementService($sl)); $controller->setEcoleDoctoraleForm($form); $controller->setStructureService($structureService); return $controller; } Loading
module/Application/src/Application/Controller/Factory/EtablissementControllerFactory.php +4 −0 Changes for module/Application/src/Application/Controller/Factory/EtablissementControllerFactory.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Form\EtablissementForm; use Application\Service\Etablissement\EtablissementService; use Application\Service\Individu\IndividuService; use Application\Service\Role\RoleService; use Application\Service\Structure\StructureService; use Zend\Mvc\Controller\ControllerManager; class EtablissementControllerFactory Loading @@ -26,15 +27,18 @@ class EtablissementControllerFactory * @var EtablissementService $etablissmentService * @var IndividuService $individuService * @var RoleService $roleService * @var StructureService $structureService */ $etablissmentService = $controllerManager->getServiceLocator()->get('EtablissementService'); $individuService = $controllerManager->getServiceLocator()->get('IndividuService'); $roleService = $controllerManager->getServiceLocator()->get('RoleService'); $structureService = $controllerManager->getServiceLocator()->get(StructureService::class); $controller = new EtablissementController(); $controller->setEtablissementService($etablissmentService); $controller->setIndividuService($individuService); $controller->setRoleService($roleService); $controller->setStructureService($structureService); $controller->setEtablissementForm($form); return $controller; Loading
module/Application/src/Application/Controller/Factory/UniteRechercheControllerFactory.php +4 −0 Changes for module/Application/src/Application/Controller/Factory/UniteRechercheControllerFactory.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Application\Service\DomaineScientifiqueService; use Application\Service\Etablissement\EtablissementServiceLocateTrait; 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; Loading @@ -32,11 +33,13 @@ class UniteRechercheControllerFactory * @var UniteRechercheService $uniteRechercheService * @var IndividuService $individuService * @var RoleService $roleService * @var StructureService $structureService * @var DomaineScientifiqueService $domaineService */ $uniteRechercheService = $sl->get('UniteRechercheService'); $individuService = $sl->get('IndividuService'); $roleService = $sl->get('RoleService'); $structureService = $sl->get(StructureService::class); $domaineService = $sl->get(DomaineScientifiqueService::class); $controller = new UniteRechercheController(); Loading @@ -45,6 +48,7 @@ class UniteRechercheControllerFactory $controller->setRoleService($roleService); $controller->setEtablissementService($this->locateEtablissementService($sl)); $controller->setDomaineScientifiqueService($domaineService); $controller->setStructureService($structureService); $controller->setUniteRechercheForm($form); return $controller; Loading