Skip to content
Snippets Groups Projects
Commit 3cc8ab39 authored by lecluse's avatar lecluse
Browse files

#1344 La structure sélectionnée en liste déroulante est de nouveau disponible...

#1344 La structure sélectionnée en liste déroulante est de nouveau disponible via $role->getStructure()
parent bc7eda56
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,10 @@ namespace Application\Entity\Db; ...@@ -7,6 +7,10 @@ namespace Application\Entity\Db;
*/ */
class Perimetre class Perimetre
{ {
const COMPOSANTE = 'composante';
const ETABLISSEMENT = 'etablissement';
const DIPLOME = 'diplome';
/** /**
* @var string * @var string
*/ */
...@@ -96,4 +100,19 @@ class Perimetre ...@@ -96,4 +100,19 @@ class Perimetre
{ {
return $this->getLibelle(); return $this->getLibelle();
} }
public function isEtablissement()
{
return $this->getCode() === self::ETABLISSEMENT;
}
public function isComposante()
{
return $this->getCode() === self::COMPOSANTE;
}
public function isDiplome()
{
return $this->getCode() === self::DIPLOME;
}
} }
...@@ -123,6 +123,11 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface ...@@ -123,6 +123,11 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface
$role->setDbRole($dbRole); $role->setDbRole($dbRole);
$role->setPersonnel($personnel); $role->setPersonnel($personnel);
// Si le rôle est de périmètre établissement, alors il se peut que l'on veuille zoomer sur une composante en particulier...
if ($this->structureSelectionnee && $dbRole->getPerimetre()->isEtablissement()){
$role->setStructure( $this->structureSelectionnee );
}
$roles[$roleId] = $role; $roles[$roleId] = $role;
$affectations = $dbRole->getAffectation(); $affectations = $dbRole->getAffectation();
...@@ -137,6 +142,8 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface ...@@ -137,6 +142,8 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface
$affRole->setStructure( $structure ); $affRole->setStructure( $structure );
$roles[$affRoleId] = $affRole; $roles[$affRoleId] = $affRole;
} }
}else{
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment