Loading module/Application/src/Application/Controller/UtilisateurController.php +1 −10 Changes for module/Application/src/Application/Controller/UtilisateurController.php: 1 added line, 10 removed lines. Original line number Diff line number Diff line Loading @@ -100,16 +100,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle ->setItemCountPerPage((int)$maxi) ->setCurrentPageNumber((int)$page); $qb = $this->roleService->getRepository()->createQueryBuilder('r'); $qb ->join('r.source', 's', Join::WITH, 's.importable = 0') ->andWhere('r.attributionAutomatique = 0') ->andWhere($qb->expr()->notIn('r.roleId', [ Role::ROLE_ID_ECOLE_DOCT, Role::ROLE_ID_UNITE_RECH, ])) ->andWhere('1 = pasHistorise(r)') ->orderBy('r.roleId'); $rolesStatiques = $qb->getQuery()->getResult(); $rolesStatiques = $this->roleService->getRoleModeleByStructures(); $qb = $this->roleService->getRepository()->createQueryBuilder('r') ->andWhere('r.attributionAutomatique = 1') Loading module/Application/src/Application/Service/Role/RoleService.php +14 −0 Changes for module/Application/src/Application/Service/Role/RoleService.php: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use Application\Entity\Db\Utilisateur; use Application\Service\BaseService; use Application\Entity\Db\Structure; use Doctrine\ORM\Query\Expr\Join; use MongoDB\BSON\Type; use UnicaenImport\Entity\Db\Source; use ZfcUser\Entity\UserInterface; Loading Loading @@ -120,6 +121,19 @@ class RoleService extends BaseService return $roles; } public function getRoleModeleByStructures() { $roleModele = []; $structures = $this->entityManager->getRepository(TypeStructure::class)->findAll(); /** @var TypeStructure $structure */ foreach ($structures as $structure) { $roles = $this->getRoleModeleByStructureType($structure->getId()); $roleModele[$structure->getLibelle()] = $roles; } return $roleModele; } /** * @param UniteRecherche|EcoleDoctorale|Etablissement $structure * @throws \Doctrine\ORM\OptimisticLockException Loading module/Application/view/application/utilisateur/index.phtml +19 −6 Changes for module/Application/view/application/utilisateur/index.phtml: 19 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -32,12 +32,25 @@ $select = (new Select("roles")) <div class="alert alert-info alert-md"> <span class="glyphicon glyphicon-info-sign"></span> <?php echo $this->translate("Sur cette page vous pouvez attribuer les rôles suivants :"); ?> <ul> <?php foreach ($roles as $r): ?> <li><?php echo $this->translate($r->getRoleId()) ?></li> <?php endforeach ?> </ul> <?php echo $this->translate("Sur cette page vous pouvez attribuer les rôles dépendant de structures."); ?> <ol> <?php foreach($roles as $structure => $roleModeles){ echo "<li>" .$structure ."</li>"; echo "<ul>"; foreach ($roleModeles as $roleModele) { echo "<li>".$roleModele->getLibelle() . "</li>"; } echo "</ul>"; } ?> </ol> <!-- <ul>--> <!-- --><?php //foreach ($roles as $r): ?> <!-- <li>--><?php //echo $this->translate($r->getRoleId()) ?><!--</li>--> <!-- --><?php //endforeach ?> <!-- </ul>--> </div> <div class="row"> Loading Loading
module/Application/src/Application/Controller/UtilisateurController.php +1 −10 Changes for module/Application/src/Application/Controller/UtilisateurController.php: 1 added line, 10 removed lines. Original line number Diff line number Diff line Loading @@ -100,16 +100,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle ->setItemCountPerPage((int)$maxi) ->setCurrentPageNumber((int)$page); $qb = $this->roleService->getRepository()->createQueryBuilder('r'); $qb ->join('r.source', 's', Join::WITH, 's.importable = 0') ->andWhere('r.attributionAutomatique = 0') ->andWhere($qb->expr()->notIn('r.roleId', [ Role::ROLE_ID_ECOLE_DOCT, Role::ROLE_ID_UNITE_RECH, ])) ->andWhere('1 = pasHistorise(r)') ->orderBy('r.roleId'); $rolesStatiques = $qb->getQuery()->getResult(); $rolesStatiques = $this->roleService->getRoleModeleByStructures(); $qb = $this->roleService->getRepository()->createQueryBuilder('r') ->andWhere('r.attributionAutomatique = 1') Loading
module/Application/src/Application/Service/Role/RoleService.php +14 −0 Changes for module/Application/src/Application/Service/Role/RoleService.php: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use Application\Entity\Db\Utilisateur; use Application\Service\BaseService; use Application\Entity\Db\Structure; use Doctrine\ORM\Query\Expr\Join; use MongoDB\BSON\Type; use UnicaenImport\Entity\Db\Source; use ZfcUser\Entity\UserInterface; Loading Loading @@ -120,6 +121,19 @@ class RoleService extends BaseService return $roles; } public function getRoleModeleByStructures() { $roleModele = []; $structures = $this->entityManager->getRepository(TypeStructure::class)->findAll(); /** @var TypeStructure $structure */ foreach ($structures as $structure) { $roles = $this->getRoleModeleByStructureType($structure->getId()); $roleModele[$structure->getLibelle()] = $roles; } return $roleModele; } /** * @param UniteRecherche|EcoleDoctorale|Etablissement $structure * @throws \Doctrine\ORM\OptimisticLockException Loading
module/Application/view/application/utilisateur/index.phtml +19 −6 Changes for module/Application/view/application/utilisateur/index.phtml: 19 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -32,12 +32,25 @@ $select = (new Select("roles")) <div class="alert alert-info alert-md"> <span class="glyphicon glyphicon-info-sign"></span> <?php echo $this->translate("Sur cette page vous pouvez attribuer les rôles suivants :"); ?> <ul> <?php foreach ($roles as $r): ?> <li><?php echo $this->translate($r->getRoleId()) ?></li> <?php endforeach ?> </ul> <?php echo $this->translate("Sur cette page vous pouvez attribuer les rôles dépendant de structures."); ?> <ol> <?php foreach($roles as $structure => $roleModeles){ echo "<li>" .$structure ."</li>"; echo "<ul>"; foreach ($roleModeles as $roleModele) { echo "<li>".$roleModele->getLibelle() . "</li>"; } echo "</ul>"; } ?> </ol> <!-- <ul>--> <!-- --><?php //foreach ($roles as $r): ?> <!-- <li>--><?php //echo $this->translate($r->getRoleId()) ?><!--</li>--> <!-- --><?php //endforeach ?> <!-- </ul>--> </div> <div class="row"> Loading