Loading module/Application/src/Application/Controller/AgentController.php +32 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ use Formation\Service\Formation\FormationServiceAwareTrait; use Formation\Service\FormationElement\FormationElementServiceAwareTrait; use Formation\Service\HasFormationCollection\HasFormationCollectionServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; use UnicaenEtat\Service\Etat\EtatServiceAwareTrait; use UnicaenEtat\Service\EtatType\EtatTypeServiceAwareTrait; use UnicaenUtilisateur\Service\User\UserServiceAwareTrait; use UnicaenValidation\Entity\Db\ValidationInstance; use UnicaenValidation\Service\ValidationInstance\ValidationInstanceServiceAwareTrait; Loading Loading @@ -91,6 +93,9 @@ class AgentController extends AbstractActionController use AgentAccompagnementServiceAwareTrait; use AgentAccompagnementFormAwareTrait; use EtatTypeServiceAwareTrait; use EtatServiceAwareTrait; public function indexAction() { $fromQueries = $this->params()->fromQuery(); Loading Loading @@ -393,6 +398,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/ppp/ajouter', ['agent' => $agent->getId()], [], true)); $form->bind($ppp); $type = $this->getEtatTypeService()->getEtatTypeByCode('PPP'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading @@ -419,6 +427,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/ppp/modifier', ['ppp' => $ppp->getId()], [], true)); $form->bind($ppp); $type = $this->getEtatTypeService()->getEtatTypeByCode('PPP'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading Loading @@ -496,6 +507,10 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/stageobs/ajouter', ['agent' => $agent->getId()], [], true)); $form->bind($stageObservation); $type = $this->getEtatTypeService()->getEtatTypeByCode('STAGE_OBSERVATION'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading @@ -522,6 +537,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/stageobs/modifier', ['stageobs' => $stageObservation->getId()], [], true)); $form->bind($stageObservation); $type = $this->getEtatTypeService()->getEtatTypeByCode('STAGE_OBSERVATION'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading Loading @@ -599,6 +617,10 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/tutorat/ajouter', ['agent' => $agent->getId()], [], true)); $form->bind($tutorat); $type = $this->getEtatTypeService()->getEtatTypeByCode('TUTORAT'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading @@ -625,6 +647,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/tutorat/modifier', ['tutorat' => $tutorat->getId()], [], true)); $form->bind($tutorat); $type = $this->getEtatTypeService()->getEtatTypeByCode('TUTORAT'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading Loading @@ -702,6 +727,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/accompagnement/ajouter', ['agent' => $agent->getId()], [], true)); $form->bind($accompagnement); $type = $this->getEtatTypeService()->getEtatTypeByCode('ACCOMPAGNEMENT'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading @@ -728,6 +756,10 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/accompagnement/modifier', ['accompagnement' => $accompagnement->getId()], [], true)); $form->bind($accompagnement); $type = $this->getEtatTypeService()->getEtatTypeByCode('ACCOMPAGNEMENT'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading module/Application/src/Application/Controller/AgentControllerFactory.php +13 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ use Formation\Service\Formation\FormationService; use Formation\Service\FormationElement\FormationElementService; use Formation\Service\HasFormationCollection\HasFormationCollectionService; use Interop\Container\ContainerInterface; use UnicaenEtat\Service\Etat\EtatService; use UnicaenEtat\Service\EtatType\EtatTypeService; use UnicaenUtilisateur\Service\User\UserService; use UnicaenValidation\Service\ValidationInstance\ValidationInstanceService; use UnicaenValidation\Service\ValidationType\ValidationTypeService; Loading Loading @@ -151,6 +153,17 @@ class AgentControllerFactory { $controller->setAgentTutoratForm($agentTutoratForm); $controller->setAgentAccompagnementService($agentAccompagnementService); $controller->setAgentAccompagnementForm($agentAccompagnementForm); /** * @var EtatService $etatService * @var EtatTypeService $etatTypeService */ $etatService = $container->get(EtatService::class); $etatTypeService = $container->get(EtatTypeService::class); $controller->setEtatService($etatService); $controller->setEtatTypeService($etatTypeService); return $controller; } } No newline at end of file module/Application/src/Application/Form/AgentAccompagnement/AgentAccompagnementForm.php +9 −2 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Service\Agent\AgentServiceAwareTrait; use Application\Service\Corps\CorpsServiceAwareTrait; use Application\Service\Correspondance\CorrespondanceServiceAwareTrait; use UnicaenApp\Form\Element\SearchAndSelect; use UnicaenEtat\Form\EtatFieldset\EtatFieldset; use UnicaenEtat\Service\Etat\EtatServiceAwareTrait; use Zend\Form\Element\Button; use Zend\Form\Element\Select; Loading Loading @@ -71,8 +72,14 @@ class AgentAccompagnementForm extends Form 'id' => 'periode', ] ]); // etat TODO //$this->get('etat')->setValueOptions($this->getEtatService()->getEtatsAsOption($type)); // etat $this->add([ 'name' => 'etat', 'type' => EtatFieldset::class, 'attributes' => [ 'id' => 'etat', ] ]); // complement $this->add([ Loading module/Application/src/Application/Form/AgentAccompagnement/AgentAccompagnementHydrator.php +4 −2 Original line number Diff line number Diff line Loading @@ -31,7 +31,9 @@ class AgentAccompagnementHydrator implements HydratorInterface { 'date_debut' => ($object->getDateDebut())?$object->getDateDebut()->format('d/m/Y'):null, 'date_fin' => ($object->getDateFin())?$object->getDateFin()->format('d/m/Y'):null, ], 'etat' => [ 'etat' => ($object->getEtat())?$object->getEtat()->getId():null, ], 'complement' => $object->getComplement(), 'resutlat' => $object->getResultat(), ]; Loading @@ -50,7 +52,7 @@ class AgentAccompagnementHydrator implements HydratorInterface { $corps = (isset($data['corps']) AND trim($data['corps']) !== '')?$this->getCorpsService()->getCorp($data['corps']):null; $dataDebut = (isset($data['HasPeriode']) AND isset($data['HasPeriode']['date_debut']) AND trim($data['HasPeriode']['date_debut']) !== '')?DateTime::createFromFormat(HasPeriodeFieldset::format, $data['HasPeriode']['date_debut']):null; $dateFin = (isset($data['HasPeriode']) AND isset($data['HasPeriode']['date_fin']) AND trim($data['HasPeriode']['date_fin']) !== '')?DateTime::createFromFormat(HasPeriodeFieldset::format, $data['HasPeriode']['date_fin']):null; $etat = (isset($data['etat']))?$this->getEtatService()->getEtat($data['etat']):null; $etat = (isset($data['etat']) AND isset($data['etat']['etat']))?$this->getEtatService()->getEtat($data['etat']['etat']):null; $complement = (isset($data['complement']) AND trim($data['complement']) !== '')?trim($data['complement']):null; $resultat = (isset($data['resultat']) AND trim($data['resultat']) !== '')?($data['resultat']):null; Loading module/Application/src/Application/Form/AgentPPP/AgentPPPForm.php +9 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Application\Form\AgentPPP; use Application\Form\HasPeriode\HasPeriodeFieldset; use UnicaenEtat\Form\EtatFieldset\EtatFieldset; use UnicaenEtat\Service\Etat\EtatServiceAwareTrait; use Zend\Form\Element\Button; use Zend\Form\Element\Number; Loading Loading @@ -60,8 +61,14 @@ class AgentPPPForm extends Form { 'id' => 'periode', ] ]); // etat TODO //$this->get('etat')->setValueOptions($this->getEtatService()->getEtatsAsOption($type)); /// etat $this->add([ 'name' => 'etat', 'type' => EtatFieldset::class, 'attributes' => [ 'id' => 'etat', ] ]); // Utilisation du cpf $this->add([ Loading Loading
module/Application/src/Application/Controller/AgentController.php +32 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ use Formation\Service\Formation\FormationServiceAwareTrait; use Formation\Service\FormationElement\FormationElementServiceAwareTrait; use Formation\Service\HasFormationCollection\HasFormationCollectionServiceAwareTrait; use UnicaenApp\Exception\RuntimeException; use UnicaenEtat\Service\Etat\EtatServiceAwareTrait; use UnicaenEtat\Service\EtatType\EtatTypeServiceAwareTrait; use UnicaenUtilisateur\Service\User\UserServiceAwareTrait; use UnicaenValidation\Entity\Db\ValidationInstance; use UnicaenValidation\Service\ValidationInstance\ValidationInstanceServiceAwareTrait; Loading Loading @@ -91,6 +93,9 @@ class AgentController extends AbstractActionController use AgentAccompagnementServiceAwareTrait; use AgentAccompagnementFormAwareTrait; use EtatTypeServiceAwareTrait; use EtatServiceAwareTrait; public function indexAction() { $fromQueries = $this->params()->fromQuery(); Loading Loading @@ -393,6 +398,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/ppp/ajouter', ['agent' => $agent->getId()], [], true)); $form->bind($ppp); $type = $this->getEtatTypeService()->getEtatTypeByCode('PPP'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading @@ -419,6 +427,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/ppp/modifier', ['ppp' => $ppp->getId()], [], true)); $form->bind($ppp); $type = $this->getEtatTypeService()->getEtatTypeByCode('PPP'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading Loading @@ -496,6 +507,10 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/stageobs/ajouter', ['agent' => $agent->getId()], [], true)); $form->bind($stageObservation); $type = $this->getEtatTypeService()->getEtatTypeByCode('STAGE_OBSERVATION'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading @@ -522,6 +537,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/stageobs/modifier', ['stageobs' => $stageObservation->getId()], [], true)); $form->bind($stageObservation); $type = $this->getEtatTypeService()->getEtatTypeByCode('STAGE_OBSERVATION'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading Loading @@ -599,6 +617,10 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/tutorat/ajouter', ['agent' => $agent->getId()], [], true)); $form->bind($tutorat); $type = $this->getEtatTypeService()->getEtatTypeByCode('TUTORAT'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading @@ -625,6 +647,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/tutorat/modifier', ['tutorat' => $tutorat->getId()], [], true)); $form->bind($tutorat); $type = $this->getEtatTypeService()->getEtatTypeByCode('TUTORAT'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading Loading @@ -702,6 +727,9 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/accompagnement/ajouter', ['agent' => $agent->getId()], [], true)); $form->bind($accompagnement); $type = $this->getEtatTypeService()->getEtatTypeByCode('ACCOMPAGNEMENT'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading @@ -728,6 +756,10 @@ class AgentController extends AbstractActionController $form->setAttribute('action', $this->url()->fromRoute('agent/accompagnement/modifier', ['accompagnement' => $accompagnement->getId()], [], true)); $form->bind($accompagnement); $type = $this->getEtatTypeService()->getEtatTypeByCode('ACCOMPAGNEMENT'); $form->get('etat')->resetEtats($this->getEtatService()->getEtatsByType($type)); $request = $this->getRequest(); if ($request->isPost()) { $data = $request->getPost(); Loading
module/Application/src/Application/Controller/AgentControllerFactory.php +13 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ use Formation\Service\Formation\FormationService; use Formation\Service\FormationElement\FormationElementService; use Formation\Service\HasFormationCollection\HasFormationCollectionService; use Interop\Container\ContainerInterface; use UnicaenEtat\Service\Etat\EtatService; use UnicaenEtat\Service\EtatType\EtatTypeService; use UnicaenUtilisateur\Service\User\UserService; use UnicaenValidation\Service\ValidationInstance\ValidationInstanceService; use UnicaenValidation\Service\ValidationType\ValidationTypeService; Loading Loading @@ -151,6 +153,17 @@ class AgentControllerFactory { $controller->setAgentTutoratForm($agentTutoratForm); $controller->setAgentAccompagnementService($agentAccompagnementService); $controller->setAgentAccompagnementForm($agentAccompagnementForm); /** * @var EtatService $etatService * @var EtatTypeService $etatTypeService */ $etatService = $container->get(EtatService::class); $etatTypeService = $container->get(EtatTypeService::class); $controller->setEtatService($etatService); $controller->setEtatTypeService($etatTypeService); return $controller; } } No newline at end of file
module/Application/src/Application/Form/AgentAccompagnement/AgentAccompagnementForm.php +9 −2 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Service\Agent\AgentServiceAwareTrait; use Application\Service\Corps\CorpsServiceAwareTrait; use Application\Service\Correspondance\CorrespondanceServiceAwareTrait; use UnicaenApp\Form\Element\SearchAndSelect; use UnicaenEtat\Form\EtatFieldset\EtatFieldset; use UnicaenEtat\Service\Etat\EtatServiceAwareTrait; use Zend\Form\Element\Button; use Zend\Form\Element\Select; Loading Loading @@ -71,8 +72,14 @@ class AgentAccompagnementForm extends Form 'id' => 'periode', ] ]); // etat TODO //$this->get('etat')->setValueOptions($this->getEtatService()->getEtatsAsOption($type)); // etat $this->add([ 'name' => 'etat', 'type' => EtatFieldset::class, 'attributes' => [ 'id' => 'etat', ] ]); // complement $this->add([ Loading
module/Application/src/Application/Form/AgentAccompagnement/AgentAccompagnementHydrator.php +4 −2 Original line number Diff line number Diff line Loading @@ -31,7 +31,9 @@ class AgentAccompagnementHydrator implements HydratorInterface { 'date_debut' => ($object->getDateDebut())?$object->getDateDebut()->format('d/m/Y'):null, 'date_fin' => ($object->getDateFin())?$object->getDateFin()->format('d/m/Y'):null, ], 'etat' => [ 'etat' => ($object->getEtat())?$object->getEtat()->getId():null, ], 'complement' => $object->getComplement(), 'resutlat' => $object->getResultat(), ]; Loading @@ -50,7 +52,7 @@ class AgentAccompagnementHydrator implements HydratorInterface { $corps = (isset($data['corps']) AND trim($data['corps']) !== '')?$this->getCorpsService()->getCorp($data['corps']):null; $dataDebut = (isset($data['HasPeriode']) AND isset($data['HasPeriode']['date_debut']) AND trim($data['HasPeriode']['date_debut']) !== '')?DateTime::createFromFormat(HasPeriodeFieldset::format, $data['HasPeriode']['date_debut']):null; $dateFin = (isset($data['HasPeriode']) AND isset($data['HasPeriode']['date_fin']) AND trim($data['HasPeriode']['date_fin']) !== '')?DateTime::createFromFormat(HasPeriodeFieldset::format, $data['HasPeriode']['date_fin']):null; $etat = (isset($data['etat']))?$this->getEtatService()->getEtat($data['etat']):null; $etat = (isset($data['etat']) AND isset($data['etat']['etat']))?$this->getEtatService()->getEtat($data['etat']['etat']):null; $complement = (isset($data['complement']) AND trim($data['complement']) !== '')?trim($data['complement']):null; $resultat = (isset($data['resultat']) AND trim($data['resultat']) !== '')?($data['resultat']):null; Loading
module/Application/src/Application/Form/AgentPPP/AgentPPPForm.php +9 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Application\Form\AgentPPP; use Application\Form\HasPeriode\HasPeriodeFieldset; use UnicaenEtat\Form\EtatFieldset\EtatFieldset; use UnicaenEtat\Service\Etat\EtatServiceAwareTrait; use Zend\Form\Element\Button; use Zend\Form\Element\Number; Loading Loading @@ -60,8 +61,14 @@ class AgentPPPForm extends Form { 'id' => 'periode', ] ]); // etat TODO //$this->get('etat')->setValueOptions($this->getEtatService()->getEtatsAsOption($type)); /// etat $this->add([ 'name' => 'etat', 'type' => EtatFieldset::class, 'attributes' => [ 'id' => 'etat', ] ]); // Utilisation du cpf $this->add([ Loading