Loading module/Application/config/others/etablissement.config.php +3 −2 Changes for module/Application/config/others/etablissement.config.php: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Application\Controller\Factory\EtablissementControllerFactory; use Application\Form\Factory\EtablissementFormFactory; use Application\Form\Factory\EtablissementHydratorFactory; use Application\Provider\Privilege\EcoleDoctoralePrivileges; use Application\Provider\Privilege\EtablissementPrivileges; use Application\Service\Etablissement\EtablissementService; use Application\View\Helper\EtablissementHelper; use UnicaenAuth\Guard\PrivilegeController; Loading @@ -19,7 +20,7 @@ return [ 'index', 'information', ], 'privileges' => EcoleDoctoralePrivileges::ECOLE_DOCT_CONSULTATION, 'privileges' => EtablissementPrivileges::ETABLISSEMENT_CONSULTATION, ], [ 'controller' => 'Application\Controller\Etablissement', Loading @@ -32,7 +33,7 @@ return [ 'retirer-individu', 'supprimer-logo', ], 'privileges' => EcoleDoctoralePrivileges::ECOLE_DOCT_MODIFICATION, 'privileges' => EtablissementPrivileges::ETABLISSEMENT_MODIFICATION, ], ], ], Loading module/Application/config/others/unite-recherche.config.php +33 Changes for module/Application/config/others/unite-recherche.config.php: 33 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\UniteRecherche\UniteRechercheService; use UnicaenAuth\Guard\PrivilegeController; use Application\View\Helper\UniteRechercheHelper; use Zend\Mvc\Router\Http\Segment; return [ 'bjyauthorize' => [ Loading @@ -17,6 +18,7 @@ return [ 'controller' => 'Application\Controller\UniteRecherche', 'action' => [ 'index', 'information', ], 'privileges' => UniteRecherchePrivileges::UNITE_RECH_CONSULTATION, ], Loading Loading @@ -56,6 +58,15 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ 'information' => [ 'type' => Segment::class, 'options' => [ 'route' => '/information/:uniteRecherche', 'defaults' => [ 'action' => 'information', ], ], ], 'ajouter' => [ 'type' => 'Segment', 'options' => [ Loading Loading @@ -219,6 +230,28 @@ return [ 'resource' => PrivilegeController::getResourceId('Application\Controller\UniteRecherche', 'index'), 'order' => 20, 'pages' => [ 'modification' => [ 'label' => 'Modification', 'route' => 'unite-recherche/modifier', 'resource' => PrivilegeController::getResourceId('Application\Controller\UniteRecherche', 'index'), 'withtarget' => true, 'paramsInject' => [ 'uniteRecherche', ], ], 'information' => [ 'label' => 'Détails', 'route' => 'unite-recherche/information', 'resource' => PrivilegeController::getResourceId('Application\Controller\UniteRecherche', 'index'), 'withtarget' => true, 'paramsInject' => [ 'uniteRecherche', ], ], ], ], ], ], Loading module/Application/src/Application/Controller/EcoleDoctoraleController.php −1 Changes for module/Application/src/Application/Controller/EcoleDoctoraleController.php: 0 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -96,7 +96,6 @@ class EcoleDoctoraleController extends AbstractController 'roleListing' => $roleListings, 'individuListing' => $individuListings, ]); } /** Loading module/Application/src/Application/Controller/UniteRechercheController.php +46 Changes for module/Application/src/Application/Controller/UniteRechercheController.php: 46 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ namespace Application\Controller; 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; Loading @@ -12,6 +14,7 @@ use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Application\Service\Individu\IndividuServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Application\Service\UniteRecherche\UniteRechercheServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; use Zend\View\Model\ViewModel; class UniteRechercheController extends AbstractController Loading Loading @@ -86,6 +89,49 @@ class UniteRechercheController extends AbstractController ]); } public function informationAction() { $id = $this->params()->fromRoute('uniteRecherche'); $unite = $this->getUniteRechercheService()->getRepository()->findByStructureId($id); if ($unite === null) { throw new RuntimeException("Aucune unité de recherche ne possède l'identifiant renseigné."); } $roleListings = []; $individuListings = []; $roles = $this->getRoleService()->getRolesByStructure($unite->getStructure()); $individus = $this->getRoleService()->getIndividuByStructure($unite->getStructure()); $individuRoles = $this->getRoleService()->getIndividuRoleByStructure($unite->getStructure()); /** @var Role $role */ foreach ($roles as $role) { $roleListings [$role->getLibelle()] = 0; } /** @var Individu $individu */ foreach ($individus as $individu) { $denomination = $individu->getNomComplet(false, false, false, true, false); $individuListings[$denomination] = []; } /** @var IndividuRole $individuRole */ foreach ($individuRoles as $individuRole) { $denomination = $individuRole->getIndividu()->getNomComplet(false, false, false, true, false); $role = $individuRole->getRole()->getLibelle(); $individuListings[$denomination][] = $role; $roleListings[$role]++; } $etablissementsRattachements = $this->getUniteRechercheService()->findEtablissementRattachement($unite); return new ViewModel([ 'unite' => $unite, 'roleListing' => $roleListings, 'individuListing' => $individuListings, 'etablissementsRattachements' => $etablissementsRattachements, ]); } /** * Modifier permet soit d'afficher le formulaire associé à la modification soit de mettre à jour * les données associées à une unité de recherche (Sigle, Libellé, Code et Logo) Loading module/Application/view/application/unite-recherche/information.phtml +127 Changes for module/Application/view/application/unite-recherche/information.phtml: 127 added lines, 0 removed lines. Original line number Diff line number Diff line <?php /** * @see \Application\Controller\UniteRechercheController::informationAction() * @var UniteRecherche $unite * @var array(string => Role[]) $roleListing * @var array(string => string[]) $individuListing * @var EtablissementRattachement[] $etablissementsRattachements */ use Application\Entity\Db\EtablissementRattachement; use Application\Entity\Db\UniteRecherche; $this->headTitle('Details de l\'unité de recherche ['.$unite->getLibelle().']'); $canEdit = true; ?> <h1 class="page-header"> Details de l'unité de recherche [ <?php echo $unite->getLibelle(); ?> ] </h1> <a href="<?php echo $this->url('unite-recherche', [], [], true); ?>" class="btn btn-primary action" > <span class="glyphicon glyphicon-th-list"></span> Index des unités de recherche </a> <?php if($canEdit): ?> <a href="<?php echo $this->url('unite-recherche/modifier', ['uniteRecherche'=> $unite->getStructure()->getId()], [], true); ?>" class="btn btn-primary action" > <span class="glyphicon glyphicon-pencil"></span> Modifier l'unité de recherche </a> <?php endif; ?> <div> <h2> Informations générales </h2> <div class="row"> <div class="col-md-4"> <img id="logo" style="max-width: 200px; max-height: 200px; border: 1px solid black; background-color: white;" src="data:image/png;base64,<?php echo base64_encode($unite->getLogoContent()); ?>" /> </div> <div class="col-md-6"> <dl> <dt> Libelle : </dt> <dd> <?php echo $unite->getLibelle(); ?> </dd> <dt> Sigle : </dt> <dd> <?php echo $unite->getSigle(); ?> </dd> <dt> Code : </dt> <dd> <?php echo $unite->getCode(); ?> </dd> <dt> Établissement(s) de rattachement : </dt> <dd> <ul> <?php foreach ($etablissementsRattachements as $etablissementRattachement) : ?> <li> <?php echo $etablissementRattachement->getEtablissement()->getLibelle(); ?></li> <?php endforeach; ?> </ul> </dd> <dt> Domaine(s) scientifique(s) : </dt> <dd> <ul> <?php foreach ($unite->getDomaines() as $domaineScientifique) : ?> <li> <?php echo $domaineScientifique->getLibelle(); ?></li> <?php endforeach; ?> </ul> </dd> </dl> </div> </div> <div> <h2> Rôles et membres </h2> <div class="row"> <div class="col-md-6"> <table class="table table-condensed"> <thead> <tr> <th> Libellé du rôles </th> <th> Effectifs </th> </tr> </thead> <tbody> <?php foreach($roleListing as $libelle => $individus): ?> <tr> <td> <?php echo $libelle; ?> </td> <td> <?php echo ($individus)?count($individus):0; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> <div class="col-md-6"> <table class="table table-condensed"> <thead> <tr> <th> Dénomination </th> <th> Rôle </th> </tr> </thead> <tbody> <?php foreach($individuListing as $denomination => $roles): ?> <?php foreach($roles as $role): ?> <tr> <td> <?php echo $denomination; ?> </td> <td> <?php echo $role; ?> </td> </tr> <?php endforeach; ?> <?php endforeach; ?> </tbody> </table> </div> </div> </div> <style> .action { width: 20em; } </style> No newline at end of file Loading
module/Application/config/others/etablissement.config.php +3 −2 Changes for module/Application/config/others/etablissement.config.php: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Application\Controller\Factory\EtablissementControllerFactory; use Application\Form\Factory\EtablissementFormFactory; use Application\Form\Factory\EtablissementHydratorFactory; use Application\Provider\Privilege\EcoleDoctoralePrivileges; use Application\Provider\Privilege\EtablissementPrivileges; use Application\Service\Etablissement\EtablissementService; use Application\View\Helper\EtablissementHelper; use UnicaenAuth\Guard\PrivilegeController; Loading @@ -19,7 +20,7 @@ return [ 'index', 'information', ], 'privileges' => EcoleDoctoralePrivileges::ECOLE_DOCT_CONSULTATION, 'privileges' => EtablissementPrivileges::ETABLISSEMENT_CONSULTATION, ], [ 'controller' => 'Application\Controller\Etablissement', Loading @@ -32,7 +33,7 @@ return [ 'retirer-individu', 'supprimer-logo', ], 'privileges' => EcoleDoctoralePrivileges::ECOLE_DOCT_MODIFICATION, 'privileges' => EtablissementPrivileges::ETABLISSEMENT_MODIFICATION, ], ], ], Loading
module/Application/config/others/unite-recherche.config.php +33 Changes for module/Application/config/others/unite-recherche.config.php: 33 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\UniteRecherche\UniteRechercheService; use UnicaenAuth\Guard\PrivilegeController; use Application\View\Helper\UniteRechercheHelper; use Zend\Mvc\Router\Http\Segment; return [ 'bjyauthorize' => [ Loading @@ -17,6 +18,7 @@ return [ 'controller' => 'Application\Controller\UniteRecherche', 'action' => [ 'index', 'information', ], 'privileges' => UniteRecherchePrivileges::UNITE_RECH_CONSULTATION, ], Loading Loading @@ -56,6 +58,15 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ 'information' => [ 'type' => Segment::class, 'options' => [ 'route' => '/information/:uniteRecherche', 'defaults' => [ 'action' => 'information', ], ], ], 'ajouter' => [ 'type' => 'Segment', 'options' => [ Loading Loading @@ -219,6 +230,28 @@ return [ 'resource' => PrivilegeController::getResourceId('Application\Controller\UniteRecherche', 'index'), 'order' => 20, 'pages' => [ 'modification' => [ 'label' => 'Modification', 'route' => 'unite-recherche/modifier', 'resource' => PrivilegeController::getResourceId('Application\Controller\UniteRecherche', 'index'), 'withtarget' => true, 'paramsInject' => [ 'uniteRecherche', ], ], 'information' => [ 'label' => 'Détails', 'route' => 'unite-recherche/information', 'resource' => PrivilegeController::getResourceId('Application\Controller\UniteRecherche', 'index'), 'withtarget' => true, 'paramsInject' => [ 'uniteRecherche', ], ], ], ], ], ], Loading
module/Application/src/Application/Controller/EcoleDoctoraleController.php −1 Changes for module/Application/src/Application/Controller/EcoleDoctoraleController.php: 0 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -96,7 +96,6 @@ class EcoleDoctoraleController extends AbstractController 'roleListing' => $roleListings, 'individuListing' => $individuListings, ]); } /** Loading
module/Application/src/Application/Controller/UniteRechercheController.php +46 Changes for module/Application/src/Application/Controller/UniteRechercheController.php: 46 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ namespace Application\Controller; 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; Loading @@ -12,6 +14,7 @@ use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Application\Service\Individu\IndividuServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Application\Service\UniteRecherche\UniteRechercheServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; use Zend\View\Model\ViewModel; class UniteRechercheController extends AbstractController Loading Loading @@ -86,6 +89,49 @@ class UniteRechercheController extends AbstractController ]); } public function informationAction() { $id = $this->params()->fromRoute('uniteRecherche'); $unite = $this->getUniteRechercheService()->getRepository()->findByStructureId($id); if ($unite === null) { throw new RuntimeException("Aucune unité de recherche ne possède l'identifiant renseigné."); } $roleListings = []; $individuListings = []; $roles = $this->getRoleService()->getRolesByStructure($unite->getStructure()); $individus = $this->getRoleService()->getIndividuByStructure($unite->getStructure()); $individuRoles = $this->getRoleService()->getIndividuRoleByStructure($unite->getStructure()); /** @var Role $role */ foreach ($roles as $role) { $roleListings [$role->getLibelle()] = 0; } /** @var Individu $individu */ foreach ($individus as $individu) { $denomination = $individu->getNomComplet(false, false, false, true, false); $individuListings[$denomination] = []; } /** @var IndividuRole $individuRole */ foreach ($individuRoles as $individuRole) { $denomination = $individuRole->getIndividu()->getNomComplet(false, false, false, true, false); $role = $individuRole->getRole()->getLibelle(); $individuListings[$denomination][] = $role; $roleListings[$role]++; } $etablissementsRattachements = $this->getUniteRechercheService()->findEtablissementRattachement($unite); return new ViewModel([ 'unite' => $unite, 'roleListing' => $roleListings, 'individuListing' => $individuListings, 'etablissementsRattachements' => $etablissementsRattachements, ]); } /** * Modifier permet soit d'afficher le formulaire associé à la modification soit de mettre à jour * les données associées à une unité de recherche (Sigle, Libellé, Code et Logo) Loading
module/Application/view/application/unite-recherche/information.phtml +127 Changes for module/Application/view/application/unite-recherche/information.phtml: 127 added lines, 0 removed lines. Original line number Diff line number Diff line <?php /** * @see \Application\Controller\UniteRechercheController::informationAction() * @var UniteRecherche $unite * @var array(string => Role[]) $roleListing * @var array(string => string[]) $individuListing * @var EtablissementRattachement[] $etablissementsRattachements */ use Application\Entity\Db\EtablissementRattachement; use Application\Entity\Db\UniteRecherche; $this->headTitle('Details de l\'unité de recherche ['.$unite->getLibelle().']'); $canEdit = true; ?> <h1 class="page-header"> Details de l'unité de recherche [ <?php echo $unite->getLibelle(); ?> ] </h1> <a href="<?php echo $this->url('unite-recherche', [], [], true); ?>" class="btn btn-primary action" > <span class="glyphicon glyphicon-th-list"></span> Index des unités de recherche </a> <?php if($canEdit): ?> <a href="<?php echo $this->url('unite-recherche/modifier', ['uniteRecherche'=> $unite->getStructure()->getId()], [], true); ?>" class="btn btn-primary action" > <span class="glyphicon glyphicon-pencil"></span> Modifier l'unité de recherche </a> <?php endif; ?> <div> <h2> Informations générales </h2> <div class="row"> <div class="col-md-4"> <img id="logo" style="max-width: 200px; max-height: 200px; border: 1px solid black; background-color: white;" src="data:image/png;base64,<?php echo base64_encode($unite->getLogoContent()); ?>" /> </div> <div class="col-md-6"> <dl> <dt> Libelle : </dt> <dd> <?php echo $unite->getLibelle(); ?> </dd> <dt> Sigle : </dt> <dd> <?php echo $unite->getSigle(); ?> </dd> <dt> Code : </dt> <dd> <?php echo $unite->getCode(); ?> </dd> <dt> Établissement(s) de rattachement : </dt> <dd> <ul> <?php foreach ($etablissementsRattachements as $etablissementRattachement) : ?> <li> <?php echo $etablissementRattachement->getEtablissement()->getLibelle(); ?></li> <?php endforeach; ?> </ul> </dd> <dt> Domaine(s) scientifique(s) : </dt> <dd> <ul> <?php foreach ($unite->getDomaines() as $domaineScientifique) : ?> <li> <?php echo $domaineScientifique->getLibelle(); ?></li> <?php endforeach; ?> </ul> </dd> </dl> </div> </div> <div> <h2> Rôles et membres </h2> <div class="row"> <div class="col-md-6"> <table class="table table-condensed"> <thead> <tr> <th> Libellé du rôles </th> <th> Effectifs </th> </tr> </thead> <tbody> <?php foreach($roleListing as $libelle => $individus): ?> <tr> <td> <?php echo $libelle; ?> </td> <td> <?php echo ($individus)?count($individus):0; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> <div class="col-md-6"> <table class="table table-condensed"> <thead> <tr> <th> Dénomination </th> <th> Rôle </th> </tr> </thead> <tbody> <?php foreach($individuListing as $denomination => $roles): ?> <?php foreach($roles as $role): ?> <tr> <td> <?php echo $denomination; ?> </td> <td> <?php echo $role; ?> </td> </tr> <?php endforeach; ?> <?php endforeach; ?> </tbody> </table> </div> </div> </div> <style> .action { width: 20em; } </style> No newline at end of file