Loading module/Application/config/merged/agent.config.php +3 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Controller\Agent\AgentControllerFactory; use Application\Controller\AgentFichier\AgentFichierController; use Application\Controller\AgentFichier\AgentFichierControllerFactory; use Application\Controller\EntretienProfessionnel\EntretienProfessionnelController; use Application\Entity\Db\AgentStatut; use Application\Form\Agent\AgentForm; use Application\Form\Agent\AgentFormFactory; use Application\Form\Agent\AgentHydrator; Loading @@ -16,6 +17,7 @@ use Application\Form\Agent\AgentImportFormFactory; use Application\Provider\Privilege\AgentPrivileges; use Application\Service\Agent\AgentService; use Application\Service\Agent\AgentServiceFactory; use Application\View\Helper\AgentStatutViewHelper; use Application\View\Helper\AgentViewHelper; use UnicaenAuth\Guard\PrivilegeController; use Zend\Mvc\Router\Http\Literal; Loading Loading @@ -222,6 +224,7 @@ return [ 'view_helpers' => [ 'invokables' => [ 'agent' => AgentViewHelper::class, 'agentStatut' => AgentStatutViewHelper::class, ], ], Loading module/Application/config/merged/menu.config.php +1 −1 Original line number Diff line number Diff line Loading @@ -199,7 +199,7 @@ return [ 'route' => 'activite', 'privileges' => ActivitePrivileges::AFFICHER, 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' 'icon' => 'fas fa-angle-right', ], [ 'label' => 'Les agents', Loading module/Application/src/Application/Controller/Agent/AgentController.php +11 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,17 @@ class AgentController extends AbstractActionController return $this->redirect()->toRoute('agent', [], [], true); } public function afficherStatutsAction() { $agent = $this->getAgentService()->getRequestedAgent($this, 'agent'); $statuts = $agent->getStatuts(); return new ViewModel([ 'title' => 'Statuts de l\'agent '.$agent->getDenomination(), 'status' => $statuts, ]); } public function importerAction() { $form = $this->getAgentImportForm(); Loading module/Application/src/Application/Controller/IndexController.php +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ class IndexController extends AbstractActionController } $identity = $this->getUserService()->getConnectedUser(); if ($identity) { } // !TODO bouger cela pour faire plus propre ... $agent = $this->getAgentService()->getAgentByUser($identity); Loading module/Application/src/Application/Entity/Db/Agent.php +46 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ class Agent { private $quotite; /** @var AgentStatus */ private $status; /** @var ArrayCollection (AgentStatut)*/ private $statuts; /** @var Correspondance */ private $correspondance; /** @var Corps */ Loading @@ -47,6 +49,7 @@ class Agent { public function __construct() { $this->statuts = new ArrayCollection(); $this->fichiers = new ArrayCollection(); } /** Loading Loading @@ -170,6 +173,34 @@ class Agent { return $this; } /** * @return AgentStatut[] */ public function getStatuts() { return $this->statuts->toArray(); } /** * @param AgentStatut $statut * @return Agent */ public function addStatut($statut) { $this->statuts->add($statut); return $this; } /** * @param AgentStatut $statut * @return Agent */ public function removeStatut($statut) { $this->statuts->removeElement($statut); return $this; } /** * @return Correspondance */ Loading Loading @@ -336,4 +367,19 @@ class Agent { } return $result; } /** * @return AgentStatut[] */ public function getStatutsActifs() { $statutsActifs = []; foreach ($this->statuts as $statut) { if ($statut->isActif()) { $statutsActifs[] = $statut; } } return $statutsActifs; } } No newline at end of file Loading
module/Application/config/merged/agent.config.php +3 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Controller\Agent\AgentControllerFactory; use Application\Controller\AgentFichier\AgentFichierController; use Application\Controller\AgentFichier\AgentFichierControllerFactory; use Application\Controller\EntretienProfessionnel\EntretienProfessionnelController; use Application\Entity\Db\AgentStatut; use Application\Form\Agent\AgentForm; use Application\Form\Agent\AgentFormFactory; use Application\Form\Agent\AgentHydrator; Loading @@ -16,6 +17,7 @@ use Application\Form\Agent\AgentImportFormFactory; use Application\Provider\Privilege\AgentPrivileges; use Application\Service\Agent\AgentService; use Application\Service\Agent\AgentServiceFactory; use Application\View\Helper\AgentStatutViewHelper; use Application\View\Helper\AgentViewHelper; use UnicaenAuth\Guard\PrivilegeController; use Zend\Mvc\Router\Http\Literal; Loading Loading @@ -222,6 +224,7 @@ return [ 'view_helpers' => [ 'invokables' => [ 'agent' => AgentViewHelper::class, 'agentStatut' => AgentStatutViewHelper::class, ], ], Loading
module/Application/config/merged/menu.config.php +1 −1 Original line number Diff line number Diff line Loading @@ -199,7 +199,7 @@ return [ 'route' => 'activite', 'privileges' => ActivitePrivileges::AFFICHER, 'dropdown-header' => true, 'icon' => 'fas fa-angle-right' 'icon' => 'fas fa-angle-right', ], [ 'label' => 'Les agents', Loading
module/Application/src/Application/Controller/Agent/AgentController.php +11 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,17 @@ class AgentController extends AbstractActionController return $this->redirect()->toRoute('agent', [], [], true); } public function afficherStatutsAction() { $agent = $this->getAgentService()->getRequestedAgent($this, 'agent'); $statuts = $agent->getStatuts(); return new ViewModel([ 'title' => 'Statuts de l\'agent '.$agent->getDenomination(), 'status' => $statuts, ]); } public function importerAction() { $form = $this->getAgentImportForm(); Loading
module/Application/src/Application/Controller/IndexController.php +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ class IndexController extends AbstractActionController } $identity = $this->getUserService()->getConnectedUser(); if ($identity) { } // !TODO bouger cela pour faire plus propre ... $agent = $this->getAgentService()->getAgentByUser($identity); Loading
module/Application/src/Application/Entity/Db/Agent.php +46 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ class Agent { private $quotite; /** @var AgentStatus */ private $status; /** @var ArrayCollection (AgentStatut)*/ private $statuts; /** @var Correspondance */ private $correspondance; /** @var Corps */ Loading @@ -47,6 +49,7 @@ class Agent { public function __construct() { $this->statuts = new ArrayCollection(); $this->fichiers = new ArrayCollection(); } /** Loading Loading @@ -170,6 +173,34 @@ class Agent { return $this; } /** * @return AgentStatut[] */ public function getStatuts() { return $this->statuts->toArray(); } /** * @param AgentStatut $statut * @return Agent */ public function addStatut($statut) { $this->statuts->add($statut); return $this; } /** * @param AgentStatut $statut * @return Agent */ public function removeStatut($statut) { $this->statuts->removeElement($statut); return $this; } /** * @return Correspondance */ Loading Loading @@ -336,4 +367,19 @@ class Agent { } return $result; } /** * @return AgentStatut[] */ public function getStatutsActifs() { $statutsActifs = []; foreach ($this->statuts as $statut) { if ($statut->isActif()) { $statutsActifs[] = $statut; } } return $statutsActifs; } } No newline at end of file