From 141e62b1a3cd80aff0f18d4bb9449f666aaa124c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Metivier <jean-philippe.metivier@unicaen.fr> Date: Tue, 12 Jul 2022 10:55:33 +0200 Subject: [PATCH] Up --- composer.json | 2 +- documentation/001-BD_BIBLIOTHEQUE.sql | 2 +- documentation/002-BD_EMC2.sql | 2 - .../partial/fiches-postes-as-table.phtml | 4 +- .../merged/application-element.config.php | 6 +- .../merged/competence-element.config.php | 6 +- .../Entity/Db/EntretienProfessionnel.php | 3 +- .../config/merged/formation-groupe.config.php | 4 +- .../config/merged/formation.config.php | 2 +- .../FormationInstanceInscritAssertion.php | 4 +- .../Controller/FormationController.php | 11 +-- .../Controller/FormationGroupeController.php | 16 ++-- .../FormationInstanceFormateurController.php | 11 +-- .../FormationInstanceInscritController.php | 4 + .../Formation/Entity/Db/FormationInstance.php | 54 +++++++++---- .../Entity/Db/FormationInstanceFormateur.php | 39 ---------- ...mation.Entity.Db.FormationInstance.dcm.xml | 3 + ...tity.Db.FormationInstanceFormateur.dcm.xml | 2 - .../FormationInstanceForm.php | 54 +++++++++++++ .../FormationInstanceHydrator.php | 20 +++-- .../FormationInstanceFormateurForm.php | 52 ------------- .../FormationInstanceFormateurHydrator.php | 6 -- .../FormationInstanceService.php | 2 +- .../FormationInstanceInscritService.php | 19 +++++ .../Notification/NotificationService.php | 4 +- .../formation-instance-informations.phtml | 8 ++ .../{afficher-groupe.phtml => afficher.phtml} | 0 .../formation/formation-groupe/index.phtml | 26 ++++--- .../liste-formations-instances.phtml | 28 +++++++ .../partial/formations.phtml | 78 +++++++++++++++++++ .../partial/parcours-entree.phtml | 13 ++++ .../formation-instance/afficher.phtml | 7 +- .../view/formation/formation/index.phtml | 20 ++--- .../Controller/StructureController.php | 8 -- .../Controller/StructureControllerFactory.php | 3 - .../view/structure/structure/afficher.phtml | 2 - 36 files changed, 330 insertions(+), 195 deletions(-) rename module/Formation/view/formation/formation-groupe/{afficher-groupe.phtml => afficher.phtml} (100%) create mode 100644 module/Formation/view/formation/formation-instance-inscrit/partial/formations.phtml create mode 100644 module/Formation/view/formation/formation-instance-inscrit/partial/parcours-entree.phtml diff --git a/composer.json b/composer.json index 0114580cd..ece737e99 100755 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "minimum-stability": "dev", "require": { "unicaen/app": "3.2.0", - "unicaen/authentification": "dev-master", + "unicaen/authentification": "^1.1.0", "unicaen/utilisateur": "dev-master", "unicaen/privilege": "dev-master", "unicaen/renderer": "dev-master", diff --git a/documentation/001-BD_BIBLIOTHEQUE.sql b/documentation/001-BD_BIBLIOTHEQUE.sql index ca7c5a619..bff088fcc 100644 --- a/documentation/001-BD_BIBLIOTHEQUE.sql +++ b/documentation/001-BD_BIBLIOTHEQUE.sql @@ -453,7 +453,7 @@ create table unicaen_autoform_validation_reponse create unique index validation_reponse_id_uindex on unicaen_autoform_validation_reponse (id); --- --------------------------------------------------------------------------------------------------------------------- +-- FICHIER ------------------------------------------------------------------------------------------------------------- create table fichier_nature ( diff --git a/documentation/002-BD_EMC2.sql b/documentation/002-BD_EMC2.sql index 2b99a5a3b..3ddfa92c6 100644 --- a/documentation/002-BD_EMC2.sql +++ b/documentation/002-BD_EMC2.sql @@ -511,8 +511,6 @@ create table formation_instance_formateur nom varchar(256) not null, email varchar(1024), attachement varchar(1024), - volume double precision, - montant double precision, histo_creation timestamp not null, histo_createur_id integer not null constraint formation_instance_formateur_user_id_fk references unicaen_utilisateur_user, histo_modification timestamp, diff --git a/module/Application/src/Application/View/Helper/partial/fiches-postes-as-table.phtml b/module/Application/src/Application/View/Helper/partial/fiches-postes-as-table.phtml index 7aae6c91e..02858e4ef 100644 --- a/module/Application/src/Application/View/Helper/partial/fiches-postes-as-table.phtml +++ b/module/Application/src/Application/View/Helper/partial/fiches-postes-as-table.phtml @@ -65,8 +65,8 @@ if ($retour) $query['retour'] = $retour; $destruction = $fiche->getHistoDestruction(); $agentId = ($fiche->getAgent())?$fiche->getAgent()->getId():null; $agent = ($fiche->getAgent())?$fiche->getAgent()->getDenomination():null; - $structureId = ($fiche->getAgent())?$fiche->getAgent()->getAffectationPrincipale()->getStructure()->getId():null; - $structure = ($fiche->getAgent())?$fiche->getAgent()->getAffectationPrincipale()->getStructure()->getLibelleCourt():null; + $structureId = ($fiche->getAgent() AND $fiche->getAgent()->getAffectationPrincipale())?$fiche->getAgent()->getAffectationPrincipale()->getStructure()->getId():null; + $structure = ($fiche->getAgent() AND $fiche->getAgent()->getAffectationPrincipale())?$fiche->getAgent()->getAffectationPrincipale()->getStructure()->getLibelleCourt():null; $fichePrincipale = ($fiche->toStringFicheMetierPrincipal() !== '')?$fiche->toStringFicheMetierPrincipal():null; $ficheLibelle = ($fiche->getLibelle() !== '')?$fiche->getLibelle():null; $isEnCours = $fiche->isEnCours(); diff --git a/module/Element/config/merged/application-element.config.php b/module/Element/config/merged/application-element.config.php index d35896d1f..64f148385 100644 --- a/module/Element/config/merged/application-element.config.php +++ b/module/Element/config/merged/application-element.config.php @@ -4,6 +4,8 @@ namespace Element; use Element\Form\ApplicationElement\ApplicationElementForm; use Element\Form\ApplicationElement\ApplicationElementFormFactory; +use Element\Form\ApplicationElement\ApplicationElementHydrator; +use Element\Form\ApplicationElement\ApplicationElementHydratorFactory; use Element\Service\ApplicationElement\ApplicationElementService; use Element\Service\ApplicationElement\ApplicationElementServiceFactory; use UnicaenPrivilege\Guard\PrivilegeController; @@ -39,7 +41,9 @@ return [ ], ], 'hydrators' => [ - 'factories' => [], + 'factories' => [ + ApplicationElementHydrator::class => ApplicationElementHydratorFactory::class, + ], ] ]; \ No newline at end of file diff --git a/module/Element/config/merged/competence-element.config.php b/module/Element/config/merged/competence-element.config.php index 122aa04b7..698645e8c 100644 --- a/module/Element/config/merged/competence-element.config.php +++ b/module/Element/config/merged/competence-element.config.php @@ -4,6 +4,8 @@ namespace Element; use Element\Form\CompetenceElement\CompetenceElementForm; use Element\Form\CompetenceElement\CompetenceElementFormFactory; +use Element\Form\CompetenceElement\CompetenceElementHydrator; +use Element\Form\CompetenceElement\CompetenceElementHydratorFactory; use Element\Service\CompetenceElement\CompetenceElementService; use Element\Service\CompetenceElement\CompetenceElementServiceFactory; use UnicaenPrivilege\Guard\PrivilegeController; @@ -38,7 +40,9 @@ return [ ], ], 'hydrators' => [ - 'factories' => [], + 'factories' => [ + CompetenceElementHydrator::class => CompetenceElementHydratorFactory::class, + ], ] ]; \ No newline at end of file diff --git a/module/EntretienProfessionnel/src/EntretienProfessionnel/Entity/Db/EntretienProfessionnel.php b/module/EntretienProfessionnel/src/EntretienProfessionnel/Entity/Db/EntretienProfessionnel.php index 9b11e66a2..f36af1e3a 100644 --- a/module/EntretienProfessionnel/src/EntretienProfessionnel/Entity/Db/EntretienProfessionnel.php +++ b/module/EntretienProfessionnel/src/EntretienProfessionnel/Entity/Db/EntretienProfessionnel.php @@ -628,7 +628,8 @@ class EntretienProfessionnel implements HistoriqueAwareInterface, ResourceInterf public function toStringCREP_Champ($motsClefs) { $mots = explode(";", $motsClefs); - return $this->formulaireInstance->fetchChampReponseByMotsClefs($mots); + $texte = $this->formulaireInstance->fetchChampReponseByMotsClefs($mots); + return str_replace("_"," ",$texte); } /** MACRO du CREF *************************************************************************************************/ diff --git a/module/Formation/config/merged/formation-groupe.config.php b/module/Formation/config/merged/formation-groupe.config.php index cf7846d26..5ed84b158 100644 --- a/module/Formation/config/merged/formation-groupe.config.php +++ b/module/Formation/config/merged/formation-groupe.config.php @@ -33,7 +33,7 @@ return [ [ 'controller' => FormationGroupeController::class, 'action' => [ - 'afficher-groupe', + 'afficher', ], 'privileges' => [ FormationgroupePrivileges::FORMATIONGROUPE_AFFICHER, @@ -120,7 +120,7 @@ return [ 'route' => '/afficher/:formation-groupe', 'defaults' => [ 'controller' => FormationGroupeController::class, - 'action' => 'afficher-groupe', + 'action' => 'afficher', ], ], ], diff --git a/module/Formation/config/merged/formation.config.php b/module/Formation/config/merged/formation.config.php index f3d16ca31..7db87729f 100644 --- a/module/Formation/config/merged/formation.config.php +++ b/module/Formation/config/merged/formation.config.php @@ -123,7 +123,7 @@ return [ 'ressource' => [ 'pages' => [ 'formation_' => [ - 'label' => 'Formations', + 'label' => 'Actions de formation', 'route' => 'formation', 'resource' => PrivilegeController::getResourceId(FormationController::class, 'index') , 'order' => 310, diff --git a/module/Formation/src/Formation/Assertion/FormationInstanceInscritAssertion.php b/module/Formation/src/Formation/Assertion/FormationInstanceInscritAssertion.php index 348c92cd1..b87ebea8b 100644 --- a/module/Formation/src/Formation/Assertion/FormationInstanceInscritAssertion.php +++ b/module/Formation/src/Formation/Assertion/FormationInstanceInscritAssertion.php @@ -19,7 +19,7 @@ class FormationInstanceInscritAssertion extends AbstractAssertion use StructureServiceAwareTrait; use UserServiceAwareTrait; - protected function assertEntity(ResourceInterface $entity = null, $privilege = null) + protected function assertEntity(ResourceInterface $entity = null, $privilege = null): bool { if (!$entity instanceof FormationInstanceInscrit) { return false; @@ -82,7 +82,7 @@ class FormationInstanceInscritAssertion extends AbstractAssertion } } - return false; + return true; } } diff --git a/module/Formation/src/Formation/Controller/FormationController.php b/module/Formation/src/Formation/Controller/FormationController.php index 9643225f1..c6fbd6067 100644 --- a/module/Formation/src/Formation/Controller/FormationController.php +++ b/module/Formation/src/Formation/Controller/FormationController.php @@ -2,6 +2,7 @@ namespace Formation\Controller; +use Application\Entity\Db\Interfaces\HasSourceInterface; use Application\Service\ParcoursDeFormation\ParcoursDeFormationServiceAwareTrait; use Element\Entity\Db\ApplicationElement; use Element\Entity\Db\CompetenceElement; @@ -77,7 +78,7 @@ class FormationController extends AbstractActionController $form->setData($data); if ($form->isValid()) { $this->getFormationService()->create($formation); - $formation->setSource(Formation::SOURCE_EMC2); + $formation->setSource(HasSourceInterface::SOURCE_EMC2); $formation->setIdSource($formation->getId()); $this->getFormationService()->update($formation); exit; @@ -196,7 +197,6 @@ class FormationController extends AbstractActionController { $type = $this->params()->fromRoute('type'); $hasApplicationElement = $this->getFormationService()->getRequestedFormation($this); - $clef='masquer'; if ($hasApplicationElement !== null) { $element = new ApplicationElement(); @@ -204,7 +204,7 @@ class FormationController extends AbstractActionController $form = $this->getApplicationElementForm(); $form->setAttribute('action', $this->url()->fromRoute('formation/ajouter-application-element', ['type' => $type, 'id' => $hasApplicationElement->getId()], [], true)); $form->bind($element); - if ($clef === 'masquer') $form->masquerClef(); + $form->masquerClef(); $request = $this->getRequest(); if ($request->isPost()) { @@ -231,7 +231,6 @@ class FormationController extends AbstractActionController { $type = $this->params()->fromRoute('type'); $hasCompetenceElement = $this->getFormationService()->getRequestedFormation($this); - $clef='masquer'; if ($hasCompetenceElement !== null) { $element = new CompetenceElement(); @@ -239,7 +238,7 @@ class FormationController extends AbstractActionController $form = $this->getCompetenceElementForm(); $form->setAttribute('action', $this->url()->fromRoute('formation/ajouter-competence-element', ['type' => $type, 'id' => $hasCompetenceElement->getId()], [], true)); $form->bind($element); - if ($clef === 'masquer') $form->masquerClef(); + $form->masquerClef(); $request = $this->getRequest(); if ($request->isPost()) { @@ -301,8 +300,6 @@ class FormationController extends AbstractActionController $instance->setFormation($formationSub); $this->getFormationInstanceService()->update($instance); } - //décalage des parcours - // TODO décaler dans les parcours de formations //decalage des applications acquises $applications = $formation->getApplicationCollection(); diff --git a/module/Formation/src/Formation/Controller/FormationGroupeController.php b/module/Formation/src/Formation/Controller/FormationGroupeController.php index bc85052e4..0e43164a1 100644 --- a/module/Formation/src/Formation/Controller/FormationGroupeController.php +++ b/module/Formation/src/Formation/Controller/FormationGroupeController.php @@ -20,8 +20,6 @@ class FormationGroupeController extends AbstractActionController use FormationGroupeFormAwareTrait; use SelectionFormationGroupeFormAwareTrait; - /** CRUD **********************************************************************************************************/ - public function indexAction() : ViewModel { $source = $this->params()->fromQuery('source'); @@ -42,7 +40,9 @@ class FormationGroupeController extends AbstractActionController ]); } - public function afficherGroupeAction() : ViewModel + /** CRUD **********************************************************************************************************/ + + public function afficherAction() : ViewModel { $groupe = $this->getFormationGroupeService()->getRequestedFormationGroupe($this); @@ -110,14 +110,20 @@ class FormationGroupeController extends AbstractActionController { $groupe = $this->getFormationGroupeService()->getRequestedFormationGroupe($this); $this->getFormationGroupeService()->historise($groupe); - return $this->redirect()->toRoute('formation', [], [], true); + + $retour = $this->params()->fromQuery('retour'); + if ($retour) return $this->redirect()->toUrl($retour); + return $this->redirect()->toRoute('formation-groupe', [], [], true); } public function restaurerGroupeAction() : Response { $groupe = $this->getFormationGroupeService()->getRequestedFormationGroupe($this); $this->getFormationGroupeService()->restore($groupe); - return $this->redirect()->toRoute('formation', [], [], true); + + $retour = $this->params()->fromQuery('retour'); + if ($retour) return $this->redirect()->toUrl($retour); + return $this->redirect()->toRoute('formation-groupe', [], [], true); } public function detruireGroupeAction() : ViewModel diff --git a/module/Formation/src/Formation/Controller/FormationInstanceFormateurController.php b/module/Formation/src/Formation/Controller/FormationInstanceFormateurController.php index 6777f9bfc..7cf1c7143 100644 --- a/module/Formation/src/Formation/Controller/FormationInstanceFormateurController.php +++ b/module/Formation/src/Formation/Controller/FormationInstanceFormateurController.php @@ -7,6 +7,7 @@ use Formation\Form\FormationInstanceFormateur\FormationInstanceFormateurFormAwar use Formation\Service\FormationInstance\FormationInstanceServiceAwareTrait; use Formation\Service\FormationInstanceFormateur\FormationInstanceFormateurServiceAwareTrait; use Zend\Http\Request; +use Zend\Http\Response; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; @@ -16,7 +17,7 @@ class FormationInstanceFormateurController extends AbstractActionController use FormationInstanceFormateurServiceAwareTrait; use FormationInstanceFormateurFormAwareTrait; - public function ajouterFormateurAction() + public function ajouterFormateurAction() : ViewModel { $instance = $this->getFormationInstanceService()->getRequestedFormationInstance($this); @@ -45,7 +46,7 @@ class FormationInstanceFormateurController extends AbstractActionController return $vm; } - public function modifierFormateurAction() + public function modifierFormateurAction() : ViewModel { $formateur = $this->getFormationInstanceFormateurService()->getRequestedFormationInstanceFormateur($this); @@ -71,21 +72,21 @@ class FormationInstanceFormateurController extends AbstractActionController return $vm; } - public function historiserFormateurAction() + public function historiserFormateurAction() : Response { $formateur = $this->getFormationInstanceFormateurService()->getRequestedFormationInstanceFormateur($this); $this->getFormationInstanceFormateurService()->historise($formateur); return $this->redirect()->toRoute('formation-instance/afficher', ['formation-instance' => $formateur->getInstance()->getId()], [], true); } - public function restaurerFormateurAction() + public function restaurerFormateurAction() : Response { $formateur = $this->getFormationInstanceFormateurService()->getRequestedFormationInstanceFormateur($this); $this->getFormationInstanceFormateurService()->restore($formateur); return $this->redirect()->toRoute('formation-instance/afficher', ['formation-instance' => $formateur->getInstance()->getId()], [], true); } - public function supprimerFormateurAction() + public function supprimerFormateurAction() : ViewModel { $formateur = $this->getFormationInstanceFormateurService()->getRequestedFormationInstanceFormateur($this); diff --git a/module/Formation/src/Formation/Controller/FormationInstanceInscritController.php b/module/Formation/src/Formation/Controller/FormationInstanceInscritController.php index 9573403ff..5ccc55cfe 100644 --- a/module/Formation/src/Formation/Controller/FormationInstanceInscritController.php +++ b/module/Formation/src/Formation/Controller/FormationInstanceInscritController.php @@ -154,11 +154,15 @@ class FormationInstanceInscritController extends AbstractActionController $agent = $this->getAgentService()->getAgentByUser($utilisateur); $inscriptions = $this->getFormationInstanceInscritService()->getFormationsByInscrit($agent); + $formations = $this->getFormationInstanceInscritService()->getFormationsBySuivies($agent); + $rendu = $this->getRenduService()->generateRenduByTemplateCode('PARCOURS_ENTREE_TEXTE', []); return new ViewModel([ 'instances' => $instances, 'inscriptions' => $inscriptions, + 'formations' => $formations, 'agent' => $agent, + 'texteParcours' => $rendu->getCorps(), ]); } diff --git a/module/Formation/src/Formation/Entity/Db/FormationInstance.php b/module/Formation/src/Formation/Entity/Db/FormationInstance.php index 26daafd7e..74f956ebb 100644 --- a/module/Formation/src/Formation/Entity/Db/FormationInstance.php +++ b/module/Formation/src/Formation/Entity/Db/FormationInstance.php @@ -54,6 +54,11 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, /** @var ArrayCollection (FormationInstanceFormateur) */ private $formateurs; + /** @var float|null */ + private $coutHt; + /** @var float|null */ + private $coutTtc; + /** * @return string */ @@ -210,19 +215,6 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, return $this->formateurs->toArray(); } - /** - * @return float - */ - public function getVolumeHoraireSomme() : float - { - $somme = 0; - /** @var FormationInstanceFormateur $formateur */ - foreach ($this->formateurs as $formateur) { - if ($formateur->estNonHistorise() and $formateur->getVolume()) $somme += $formateur->getVolume(); - } - return $somme; - } - /** JOURNEE *******************************************************************************************************/ /** @@ -389,6 +381,40 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, return false; } + /** COUT DE LA FORMATION *********************************************************************************/ + + /** + * @return float|null + */ + public function getCoutHt(): ?float + { + return $this->coutHt; + } + + /** + * @param float|null $coutHt + */ + public function setCoutHt(?float $coutHt): void + { + $this->coutHt = $coutHt; + } + + /** + * @return float|null + */ + public function getCoutTtc(): ?float + { + return $this->coutTtc; + } + + /** + * @param float|null $coutTtc + */ + public function setCoutTtc(?float $coutTtc): void + { + $this->coutTtc = $coutTtc; + } + /** Fonctions pour les macros **********************************************************************************/ public function getInstanceLibelle() : string @@ -414,7 +440,6 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, $text .= "<tr style='border-bottom:1px solid black;'>"; $text .= "<th>Dénomination </th>"; $text .= "<th>Structure de rattachement </th>"; - $text .= "<th>Volume </th>"; $text .= "</tr>"; $text .= "</thead>"; $text .= "<tbody>"; @@ -422,7 +447,6 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, $text .= "<tr>"; $text .= "<td>" . $formateur->getPrenom() . " " . $formateur->getNom() . "</td>"; $text .= "<td>" . $formateur->getAttachement() . "</td>"; - $text .= "<td>" . (($formateur->getVolume()) ?: "N.C.") . "</td>"; $text .= "</tr>"; } $text .= "</tbody>"; diff --git a/module/Formation/src/Formation/Entity/Db/FormationInstanceFormateur.php b/module/Formation/src/Formation/Entity/Db/FormationInstanceFormateur.php index 8246961ed..7b21239ca 100644 --- a/module/Formation/src/Formation/Entity/Db/FormationInstanceFormateur.php +++ b/module/Formation/src/Formation/Entity/Db/FormationInstanceFormateur.php @@ -21,10 +21,6 @@ class FormationInstanceFormateur implements HistoriqueAwareInterface private $email; /** @var string */ private $attachement; - /** @var float */ - private $volume; - /** @var float */ - private $montant; /** * @return int @@ -124,39 +120,4 @@ class FormationInstanceFormateur implements HistoriqueAwareInterface return $this; } - /** - * @return float|null - */ - public function getVolume(): ?float - { - return $this->volume; - } - - /** - * @param float|null $volume - * @return FormationInstanceFormateur - */ - public function setVolume(?float $volume): FormationInstanceFormateur - { - $this->volume = $volume; - return $this; - } - - /** - * @return float|null - */ - public function getMontant(): ?float - { - return $this->montant; - } - - /** - * @param float|null $montant - * @return FormationInstanceFormateur - */ - public function setMontant(?float $montant): FormationInstanceFormateur - { - $this->montant = $montant; - return $this; - } } \ No newline at end of file diff --git a/module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.FormationInstance.dcm.xml b/module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.FormationInstance.dcm.xml index c4f1f2987..97280af7b 100644 --- a/module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.FormationInstance.dcm.xml +++ b/module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.FormationInstance.dcm.xml @@ -24,6 +24,9 @@ <one-to-many field="inscrits" target-entity="Formation\Entity\Db\FormationInstanceInscrit" mapped-by="instance"/> <one-to-many field="formateurs" target-entity="Formation\Entity\Db\FormationInstanceFormateur" mapped-by="instance"/> + <field name="coutHt" type="float" column="cout_ht" nullable="true"/> + <field name="coutTtc" type="float" column="cout_ttc" nullable="true"/> + <!-- SOURCE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <field name="source" type="string" length="256" column="source" nullable="true"/> <field name="idSource" type="string" length="256" column="id_source" nullable="true"/> diff --git a/module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.FormationInstanceFormateur.dcm.xml b/module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.FormationInstanceFormateur.dcm.xml index b0ed6e9d3..ce8309564 100644 --- a/module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.FormationInstanceFormateur.dcm.xml +++ b/module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.FormationInstanceFormateur.dcm.xml @@ -14,8 +14,6 @@ <field name="nom" column="nom" type="string" length="256" nullable="false"/> <field name="email" column="email" type="string" length="1024" nullable="false"/> <field name="attachement" column="attachement" type="string" length="1024" nullable="true"/> - <field name="volume" column="volume" type="float" nullable="true"/> - <field name="montant" column="montant" type="float" nullable="true"/> <field name="histoCreation" type="datetime" column="histo_creation" nullable="false"/> <field name="histoModification" type="datetime" column="histo_modification" nullable="false"/> diff --git a/module/Formation/src/Formation/Form/FormationInstance/FormationInstanceForm.php b/module/Formation/src/Formation/Form/FormationInstance/FormationInstanceForm.php index b3f0c48b7..c35ad880e 100644 --- a/module/Formation/src/Formation/Form/FormationInstance/FormationInstanceForm.php +++ b/module/Formation/src/Formation/Form/FormationInstance/FormationInstanceForm.php @@ -10,6 +10,7 @@ use Zend\Form\Element\Text; use Zend\Form\Element\Textarea; use Zend\Form\Form; use Zend\InputFilter\Factory; +use Zend\Validator\Regex; class FormationInstanceForm extends Form { @@ -97,6 +98,28 @@ class FormationInstanceForm extends Form 'id' => 'lieu', ], ]); + //cout ht + $this->add([ + 'type' => Text::class, + 'name' => 'cout_ht', + 'options' => [ + 'label' => "Coût HT :", + ], + 'attributes' => [ + 'id' => 'cout_ht', + ], + ]); + //cout ht + $this->add([ + 'type' => Text::class, + 'name' => 'cout_ttc', + 'options' => [ + 'label' => "Coût TTC :", + ], + 'attributes' => [ + 'id' => 'cout_ttc', + ], + ]); //button $this->add([ 'type' => Button::class, @@ -120,6 +143,37 @@ class FormationInstanceForm extends Form 'inscription' => ['required' => true,], 'lieu' => ['required' => true,], 'type' => ['required' => true,], + 'cout_ht' => [ + 'required' => false, + 'validators' => [ + [ + 'name' => Regex::class, + 'options' => [ + 'pattern' => '/[0-9]*\.?[0-9]*/', + 'messages' => [ + Regex::NOT_MATCH => "Veuillez saisir une valeur correcte", + ], + //'break_chain_on_failure' => true, + ], + ], + ], + ], + 'cout_ttc' => [ + 'required' => false, + 'validators' => [ + [ + 'name' => Regex::class, + 'options' => [ + 'pattern' => '/[0-9]*\.?[0-9]*/', + 'messages' => [ + Regex::NOT_MATCH => "Veuillez saisir une valeur correcte", + ], + //'break_chain_on_failure' => true, + ], + ], + ], + ], + ])); } } \ No newline at end of file diff --git a/module/Formation/src/Formation/Form/FormationInstance/FormationInstanceHydrator.php b/module/Formation/src/Formation/Form/FormationInstance/FormationInstanceHydrator.php index 9974694de..3e4f24a79 100644 --- a/module/Formation/src/Formation/Form/FormationInstance/FormationInstanceHydrator.php +++ b/module/Formation/src/Formation/Form/FormationInstance/FormationInstanceHydrator.php @@ -12,15 +12,17 @@ class FormationInstanceHydrator implements HydratorInterface * @param FormationInstance $object * @return array */ - public function extract($object) + public function extract($object) : array { $data = [ - 'description' => ($object->getComplement()) ?: null, - 'principale' => ($object->getNbPlacePrincipale()) ?: 0, - 'complementaire' => ($object->getNbPlaceComplementaire()) ?: 0, - 'lieu' => ($object->getLieu()) ?: null, - 'type' => ($object->getType()) ?: null, - 'inscription' => $object->isAutoInscription(), + 'description' => ($object AND $object->getComplement()) ?: null, + 'principale' => ($object AND $object->getNbPlacePrincipale()) ?: 0, + 'complementaire' => ($object AND $object->getNbPlaceComplementaire()) ?: 0, + 'lieu' => ($object AND $object->getLieu()) ?: null, + 'type' => ($object AND $object->getType()) ?: null, + 'inscription' => ($object) ? $object->isAutoInscription() : null, + 'cout_ht' => ($object) ? $object->getCoutHt() : null, + 'cout_ttc' => ($object) ? $object->getCoutTtc() : null, ]; return $data; } @@ -38,6 +40,8 @@ class FormationInstanceHydrator implements HydratorInterface $lieu = (isset($data['lieu']) and trim($data['lieu']) !== "") ? trim($data['lieu']) : null; $type = (isset($data['type']) and trim($data['type']) !== "") ? trim($data['type']) : null; $inscription = (isset($data['inscription']))?$data['inscription'] : false; + $coutHt = (isset($data['cout_ht']) and trim($data['cout_ht']) !== "") ? trim($data['cout_ht']) : null; + $coutTtc = (isset($data['cout_ttc']) and trim($data['cout_ttc']) !== "") ? trim($data['cout_ttc']) : null; $object->setComplement($description); $object->setNbPlacePrincipale($principale); @@ -45,6 +49,8 @@ class FormationInstanceHydrator implements HydratorInterface $object->setLieu($lieu); $object->setType($type); $object->setAutoInscription($inscription); + $object->setCoutHt($coutHt); + $object->setCoutTtc($coutTtc); return $object; } diff --git a/module/Formation/src/Formation/Form/FormationInstanceFormateur/FormationInstanceFormateurForm.php b/module/Formation/src/Formation/Form/FormationInstanceFormateur/FormationInstanceFormateurForm.php index 628ed1261..850c2007d 100644 --- a/module/Formation/src/Formation/Form/FormationInstanceFormateur/FormationInstanceFormateurForm.php +++ b/module/Formation/src/Formation/Form/FormationInstanceFormateur/FormationInstanceFormateurForm.php @@ -57,28 +57,6 @@ class FormationInstanceFormateurForm extends Form 'id' => 'attachement', ], ]); - //volume - $this->add([ - 'type' => Text::class, - 'name' => 'volume', - 'options' => [ - 'label' => "Volume horaire dispensé :", - ], - 'attributes' => [ - 'id' => 'volume', - ], - ]); - //montant - $this->add([ - 'type' => Text::class, - 'name' => 'montant', - 'options' => [ - 'label' => "Montant horaire :", - ], - 'attributes' => [ - 'id' => 'montant', - ], - ]); //button $this->add([ 'type' => Button::class, @@ -101,36 +79,6 @@ class FormationInstanceFormateurForm extends Form 'nom' => ['required' => true], 'email' => ['required' => true], 'attachement' => ['required' => false], - 'volume' => [ - 'required' => false, - 'validators' => [ - [ - 'name' => Regex::class, - 'options' => [ - 'pattern' => '/[0-9]*\.?[0-9]*/', - 'messages' => [ - Regex::NOT_MATCH => "Veuillez saisir une valeur correcte", - ], - //'break_chain_on_failure' => true, - ], - ], - ], - ], - 'montant' => [ - 'required' => false, - 'validators' => [ - [ - 'name' => Regex::class, - 'options' => [ - 'pattern' => '/[0-9]*\.?[0-9]*/', - 'messages' => [ - Regex::NOT_MATCH => "Veuillez saisir une valeur correcte", - ], - //'break_chain_on_failure' => true, - ], - ], - ], - ], ])); } } \ No newline at end of file diff --git a/module/Formation/src/Formation/Form/FormationInstanceFormateur/FormationInstanceFormateurHydrator.php b/module/Formation/src/Formation/Form/FormationInstanceFormateur/FormationInstanceFormateurHydrator.php index d0c36337d..772b209c6 100644 --- a/module/Formation/src/Formation/Form/FormationInstanceFormateur/FormationInstanceFormateurHydrator.php +++ b/module/Formation/src/Formation/Form/FormationInstanceFormateur/FormationInstanceFormateurHydrator.php @@ -19,8 +19,6 @@ class FormationInstanceFormateurHydrator implements HydratorInterface 'nom' => ($object) ? $object->getNom() : null, 'email' => ($object) ? $object->getEmail() : null, 'attachement' => ($object) ? $object->getAttachement() : null, - 'volume' => ($object) ? $object->getVolume() : null, - 'montant' => ($object) ? $object->getMontant() : null, ]; return $data; } @@ -36,15 +34,11 @@ class FormationInstanceFormateurHydrator implements HydratorInterface $nom = (isset($data['nom']) and trim($data['nom']) !== "") ? trim($data['nom']) : null; $email = (isset($data['email']) and trim($data['email']) !== "") ? trim($data['email']) : null; $attachement = (isset($data['attachement']) and trim($data['attachement']) !== "") ? trim($data['attachement']) : null; - $volume = (isset($data['volume']) and trim($data['volume']) !== "") ? trim($data['volume']) : null; - $montant = (isset($data['montant']) and trim($data['montant']) !== "") ? trim($data['montant']) : null; $object->setPrenom($prenom); $object->setNom($nom); $object->setEmail($email); $object->setAttachement($attachement); - $object->setVolume($volume); - $object->setMontant($montant); return $object; } diff --git a/module/Formation/src/Formation/Service/FormationInstance/FormationInstanceService.php b/module/Formation/src/Formation/Service/FormationInstance/FormationInstanceService.php index 9b20227a6..12b7e7042 100644 --- a/module/Formation/src/Formation/Service/FormationInstance/FormationInstanceService.php +++ b/module/Formation/src/Formation/Service/FormationInstance/FormationInstanceService.php @@ -254,7 +254,7 @@ class FormationInstanceService $instance->setEtat($this->getEtatService()->getEtatByCode(FormationInstance::ETAT_INSCRIPTION_OUVERTE)); $this->update($instance); - $email = $this->getParametreService()->getParametreByCode('GLOBAL', 'MAIL_LISTE_BIATS')->getValeur(); + $email = $this->getParametreService()->getParametreByCode('FORMATION', 'MAIL_PERSONNEL')->getValeur(); $vars = [ 'instance' => $instance, 'UrlService' => $this->getUrlService(), diff --git a/module/Formation/src/Formation/Service/FormationInstanceInscrit/FormationInstanceInscritService.php b/module/Formation/src/Formation/Service/FormationInstanceInscrit/FormationInstanceInscritService.php index f19818382..390809000 100644 --- a/module/Formation/src/Formation/Service/FormationInstanceInscrit/FormationInstanceInscritService.php +++ b/module/Formation/src/Formation/Service/FormationInstanceInscrit/FormationInstanceInscritService.php @@ -182,6 +182,25 @@ class FormationInstanceInscritService return $result; } + /** + * @param Agent $agent + * @return FormationInstanceInscrit[] + */ + public function getFormationsBySuivies(Agent $agent) : array + { + $qb = $this->createQueryBuilder() + ->andWhere('inscrit.agent = :agent') + ->setParameter('agent', $agent) + ->andWhere('instanceetat.code = :retour OR instanceetat.code = :close') + ->setParameter('retour', FormationInstance::ETAT_ATTENTE_RETOURS) + ->setParameter('close', FormationInstance::ETAT_CLOTURE_INSTANCE) + ->andWhere('inscrit.histoDestruction IS NULL') + ->orderBy('formation.libelle', 'ASC'); + + $result = $qb->getQuery()->getResult(); + return $result; + } + /** * @param Structure $structure * @param bool $avecStructuresFilles diff --git a/module/Formation/src/Formation/Service/Notification/NotificationService.php b/module/Formation/src/Formation/Service/Notification/NotificationService.php index 63ab6095f..6fdf611f4 100644 --- a/module/Formation/src/Formation/Service/Notification/NotificationService.php +++ b/module/Formation/src/Formation/Service/Notification/NotificationService.php @@ -31,7 +31,7 @@ class NotificationService { ]; $rendu = $this->getRenduService()->generateRenduByTemplateCode("FORMATION_INSCRIPTION_DEMANDE_AGENT", $vars); - $email = $this->getParametreService()->getParametreByCode('FORMATION','EMAIL')->getValeur(); + $email = $this->getParametreService()->getParametreByCode('FORMATION','MAIL_CCC')->getValeur(); $mail = $this->getMailService()->sendMail($email, $rendu->getSujet(), $rendu->getCorps()); $mail->setMotsClefs([$instance->generateTag(), $rendu->getTemplate()->generateTag()]); $this->getMailService()->update($mail); @@ -44,7 +44,7 @@ class NotificationService { $instance = $inscription->getInstance(); $agent = $inscription->getAgent(); - $email = $this->getParametreService()->getParametreByCode('FORMATION','EMAIL')->getValeur(); + $email = $this->getParametreService()->getParametreByCode('FORMATION','MAIL_CCC')->getValeur(); $email .= ","; $email .= $agent->getEmail(); diff --git a/module/Formation/src/Formation/View/Helper/partial/formation-instance-informations.phtml b/module/Formation/src/Formation/View/Helper/partial/formation-instance-informations.phtml index 9a8eb87d4..0562e2ce3 100644 --- a/module/Formation/src/Formation/View/Helper/partial/formation-instance-informations.phtml +++ b/module/Formation/src/Formation/View/Helper/partial/formation-instance-informations.phtml @@ -37,6 +37,14 @@ use Formation\Entity\Db\FormationInstance; Non (les agents doivent notifier les gestionnaires de formation) <?php endif; ?> </dd> + <?php if ($instance->getCoutHt() !== null) : ?> + <dt> Coût HT </dt> + <dd> <?php echo $instance->getCoutHt(); ?>€</dd> + <?php endif; ?> + <?php if ($instance->getCoutTtc() !== null) : ?> + <dt> Coût TTC </dt> + <dd> <?php echo $instance->getCoutTtc(); ?>€</dd> + <?php endif; ?> </dl> <?php endif; ?> diff --git a/module/Formation/view/formation/formation-groupe/afficher-groupe.phtml b/module/Formation/view/formation/formation-groupe/afficher.phtml similarity index 100% rename from module/Formation/view/formation/formation-groupe/afficher-groupe.phtml rename to module/Formation/view/formation/formation-groupe/afficher.phtml diff --git a/module/Formation/view/formation/formation-groupe/index.phtml b/module/Formation/view/formation/formation-groupe/index.phtml index c6603d504..e1433fe41 100644 --- a/module/Formation/view/formation/formation-groupe/index.phtml +++ b/module/Formation/view/formation/formation-groupe/index.phtml @@ -46,9 +46,9 @@ $canDetruire = $this->isAllowed(FormationgroupePrivileges::getResourceId( <thead> <tr> <th> Libellé </th> - <th style="width: 12rem;"> #Formation </th> - <th style="width: 12rem;"> Source </th> - <th style="width: 12rem;"> Action </th> + <th style="width: 10rem;"> #Formation </th> + <th style="width: 14rem;"> Source </th> + <th style="width: 9rem;"> Action </th> </tr> </thead> <tbody> @@ -99,15 +99,17 @@ $canDetruire = $this->isAllowed(FormationgroupePrivileges::getResourceId( <span class="icon restaurer" style="color:lightgrey;"></span> <?php endif; ?> <?php endif; ?> + <?php if (false) : ?> <?php if ($canDedoublonner) : ?> - <a - <?php /** @see FormationGroupeController::dedoublonnerAction() */ ?> - href="<?php echo $this->url('formation-groupe/dedoublonner', ['formation-groupe' => $groupe->getId()], [], true); ?>" - class="ajax-modal" data-event="modification" - > - <span class="icon fusionner" title="Dedoublonner le groupe"></span></a> - <?php else : ?> - <span class="icon fusionner" style="color:lightgrey;"></span> + <a + <?php /** @see FormationGroupeController::dedoublonnerAction() */ ?> + href="<?php echo $this->url('formation-groupe/dedoublonner', ['formation-groupe' => $groupe->getId()], [], true); ?>" + class="ajax-modal" data-event="modification" + > + <span class="icon fusionner" title="Dedoublonner le groupe"></span></a> + <?php else : ?> + <span class="icon fusionner" style="color:lightgrey;"></span> + <?php endif; ?> <?php endif; ?> <?php if ($canDetruire) : ?> <a @@ -115,7 +117,7 @@ $canDetruire = $this->isAllowed(FormationgroupePrivileges::getResourceId( href="<?php echo $this->url('formation-groupe/detruire', ['formation-groupe' => $groupe->getId()], [], true); ?>" class="ajax-modal" data-event="modification" > - <span class="icon detruire" title="Afficher le groupe"></span></a> + <span class="icon detruire text-danger" title="Supprimer le groupe"></span></a> <?php else : ?> <span class="icon detruire" style="color:lightgrey;"></span> <?php endif; ?> diff --git a/module/Formation/view/formation/formation-instance-inscrit/liste-formations-instances.phtml b/module/Formation/view/formation/formation-instance-inscrit/liste-formations-instances.phtml index 10aabd0e5..0e3b1c9c9 100644 --- a/module/Formation/view/formation/formation-instance-inscrit/liste-formations-instances.phtml +++ b/module/Formation/view/formation/formation-instance-inscrit/liste-formations-instances.phtml @@ -3,8 +3,10 @@ /** * @see \Formation\Controller\FormationInstanceInscritController::listeFormationsInstancesAction() * @var FormationInstance[] $instances + * @var FormationInstance[] $formations * @var FormationInstanceInscrit[] $inscriptions * @var Agent $agent + * @var string $texteParcours */ use Application\Entity\Db\Agent; @@ -44,6 +46,22 @@ $this->headTitle("Liste des actions de formations proposées"); </span> </a> </li> + <li> + <a href="#formations" aria-controls="formations" role="tab" data-toggle="tabz"> + Mes formations suivies + <span class="badge"> + <?php echo count($formations); ?> + </span> + </a> + </li> + <li class="pull-right"> + <a href="#parcours" aria-controls="parcours" role="tab" data-toggle="tabz" > + Mon parcours d'entrée +<!-- <span class="badge">--> + <?php //echo count($inscriptions); ?> +<!-- </span>--> + </a> + </li> </ul> </div> </div> @@ -62,6 +80,16 @@ $this->headTitle("Liste des actions de formations proposées"); <?php echo $this->partial('partial/inscriptions', ['instances' => $instances, 'inscriptions' => $inscriptions, 'agent' => $agent]); ?> </div> + <!-- Type----------------------------------------------------------------------------------------------> + <div id="formations" class="tab-pane " role="tabpanel"> + <?php echo $this->partial('partial/formations', ['formations' => $formations, 'agent' => $agent]); ?> + </div> + + <!-- Type----------------------------------------------------------------------------------------------> + <div id="parcours" class="tab-pane " role="tabpanel"> + <?php echo $this->partial('partial/parcours-entree', ['description' => $texteParcours, 'agent' => $agent]); ?> + </div> + </div> </div> diff --git a/module/Formation/view/formation/formation-instance-inscrit/partial/formations.phtml b/module/Formation/view/formation/formation-instance-inscrit/partial/formations.phtml new file mode 100644 index 000000000..d0241aba4 --- /dev/null +++ b/module/Formation/view/formation/formation-instance-inscrit/partial/formations.phtml @@ -0,0 +1,78 @@ +<?php + +/** + * @var FormationInstanceInscrit[] $formations + * @var Agent $agent + */ + +use Application\Entity\Db\Agent; +use Formation\Entity\Db\FormationInstance; +use Formation\Entity\Db\FormationInstanceInscrit; + +$retours = array_filter($formations, function (FormationInstanceInscrit $a) { return $a->getInstance()->getEtat()->getCode() === FormationInstance::ETAT_ATTENTE_RETOURS;} ); +$closes = array_filter($formations, function (FormationInstanceInscrit $a) { return $a->getInstance()->getEtat()->getCode() === FormationInstance::ETAT_CLOTURE_INSTANCE;} ); +?> + +<h2> + Formations en attentes de retour + <span class="badge"><?php echo count($retours); ?></span> +</h2> + +<?php if (empty($retours)) : ?> + <em> Aucune formation en attente de retour </em> +<?php else : ?> + <?php foreach ($retours as $inscription) : ?> + <div class="row formation-inscription"> + <div class="col-md-8 description"> + <?php echo $this->formationInstanceInformations($inscription->getInstance(), 'bloc'); ?> + <br/> + <br/> + </div> + <div class="pull-right"> + <a + <?php /** @see \Formation\Controller\FormationInstanceController::renseignerQuestionnaireAction() */?> + href="<?php echo $this->url('formation-instance/renseigner-questionnaire', ['inscrit' => $inscription->getId()], [], true); ?>" + class="btn btn-primary action" + > + <span class="icon editer"> Je complète le formulaire</span> + </a> + <br/> + <a + <?php /** @see \Formation\Controller\FormationInstanceDocumentController::genererAttestationAction() */?> + href="<?php echo $this->url('formation-instance/generer-attestation', ['inscrit' => $inscription->getId()], [], true); ?>" + class="btn btn-primary action <?php if ($inscription->getQuestionnaire() === null) echo " disabled "; ?>" + > + <span class="icon pdf"> Je télécharge mon attestation</span> + </a> + </div> + </div> + <?php endforeach; ?> +<?php endif; ?> + +<h2> + Formations closes + <span class="badge"><?php echo count($closes); ?></span> +</h2> + +<?php if (empty($closes)) : ?> + <em> Aucune formation close </em> +<?php else : ?> + <?php foreach ($closes as $inscription) : ?> + <div class="row formation-inscription"> + <div class="col-md-8 description"> + <?php echo $this->formationInstanceInformations($inscription->getInstance(), 'bloc'); ?> + <br/> + <br/> + </div> + <div class="pull-right"> + <a + <?php /** @see \Formation\Controller\FormationInstanceDocumentController::genererAttestationAction() */?> + href="<?php echo $this->url('formation-instance/generer-attestation', ['inscrit' => $inscription->getId()], [], true); ?>" + class="btn btn-primary action <?php if ($inscription->getQuestionnaire() === null) echo " disabled "; ?>" + > + <span class="icon pdf"> Je télécharge mon attestation</span> + </a> + </div> + </div> + <?php endforeach; ?> +<?php endif; ?> \ No newline at end of file diff --git a/module/Formation/view/formation/formation-instance-inscrit/partial/parcours-entree.phtml b/module/Formation/view/formation/formation-instance-inscrit/partial/parcours-entree.phtml new file mode 100644 index 000000000..09af8dd81 --- /dev/null +++ b/module/Formation/view/formation/formation-instance-inscrit/partial/parcours-entree.phtml @@ -0,0 +1,13 @@ +<?php + +/** + * @var string $description + */ + +?> + +<h2> + Mon parcours d'entrée +</h2> + +<?php echo $description; ?> \ No newline at end of file diff --git a/module/Formation/view/formation/formation-instance/afficher.phtml b/module/Formation/view/formation/formation-instance/afficher.phtml index 555609842..9567d0d98 100644 --- a/module/Formation/view/formation/formation-instance/afficher.phtml +++ b/module/Formation/view/formation/formation-instance/afficher.phtml @@ -187,7 +187,7 @@ $canGererInscription = $this->isAllowed(FormationinstancePrivileges::getResou <div class="row"> <div class="col-sm-6 col-md-8"> - <h3>Formateurs <span class="badge"><?php echo count($formateurs); ?></span> </h3> + <h3>Formateurs </h3> </div> <div class="pull-right"> <?php if ($canFormateurModifier) : ?> @@ -207,7 +207,6 @@ $canGererInscription = $this->isAllowed(FormationinstancePrivileges::getResou <tr> <th> Dénomination </th> <th> Structure de rattachement </th> - <th> Volume </th> <th> Action </th> </tr> </thead> @@ -216,7 +215,6 @@ $canGererInscription = $this->isAllowed(FormationinstancePrivileges::getResou <tr class="<?php echo ($formateur->estHistorise())?"historise":""; ?>"> <td> <?php echo $formateur->getPrenom(); ?> <?php echo $formateur->getNom(); ?> </td> <td> <?php echo ($formateur->getAttachement())?:"Non renseigné"; ?> </td> - <td> <?php echo ($formateur->getVolume())?:"Non renseigné"; ?> </td> <td> <?php if ($canFormateurModifier) : ?> <a <?php /** @see FormationInstanceFormateurController::modifierFormateurAction() */ ?> @@ -244,9 +242,6 @@ $canGererInscription = $this->isAllowed(FormationinstancePrivileges::getResou <?php endforeach; ?> </tbody> </table> - <?php if ($canJourneeModifier) : ?> - <strong>Volume horaire sommé :</strong> <?php echo $instance->getVolumeHoraireSomme(); ?> heures. - <?php endif; ?> <div class="row"> <div class="col-md-8"> diff --git a/module/Formation/view/formation/formation/index.phtml b/module/Formation/view/formation/formation/index.phtml index a0d8a03f7..fa7153e97 100644 --- a/module/Formation/view/formation/formation/index.phtml +++ b/module/Formation/view/formation/formation/index.phtml @@ -53,7 +53,7 @@ $this->headTitle("Actions de formation"); <th class="col-md-6 nosort"> Libellé </th> <th class="col-md-3 nosort" style="min-width:10rem;"> Groupe </th> <th class="col-md-2 nosort" style="min-width:10rem;"> Source </th> - <th class="col-md-1 nosort" style="min-width:8rem;"> Action </th> + <th class="col-md-1 nosort" style="min-width:10rem;"> Action </th> </tr> </thead> <tbody> @@ -89,13 +89,15 @@ $this->headTitle("Actions de formation"); <span class="icon restaurer" title="Restaurer la formation"></span></a> <?php endif; ?> <?php endif; ?> - <?php if ($canDedoublonner) : ?> - <a - <?php /** @see FormationController::dedoublonnerAction() */ ?> - href="<?php echo $this->url('formation/dedoublonner', ['formation' => $formation->getId()], [], true); ?>" - class="ajax-modal" data-event="modification" - > - <span class="icon fusionner" title="Dédoublonner la formation"></span></a> + <?php if (false) : ?> + <?php if ($canDedoublonner) : ?> + <a + <?php /** @see FormationController::dedoublonnerAction() */ ?> + href="<?php echo $this->url('formation/dedoublonner', ['formation' => $formation->getId()], [], true); ?>" + class="ajax-modal" data-event="modification" + > + <span class="icon fusionner" title="Dédoublonner la formation"></span></a> + <?php endif; ?> <?php endif; ?> <?php if ($canDetruire) : ?> <a @@ -103,7 +105,7 @@ $this->headTitle("Actions de formation"); href="<?php echo $this->url('formation/detruire', ['formation' => $formation->getId()], [], true); ?>" class="ajax-modal" data-event="modification" > - <span class="icon detruire" title="Supprimer la formation"></span></a> + <span class="icon detruire text-danger" title="Supprimer la formation"></span></a> <?php endif; ?> </td> </tr> diff --git a/module/Structure/src/Structure/Controller/StructureController.php b/module/Structure/src/Structure/Controller/StructureController.php index 82df1a6f6..dec756b6a 100644 --- a/module/Structure/src/Structure/Controller/StructureController.php +++ b/module/Structure/src/Structure/Controller/StructureController.php @@ -11,7 +11,6 @@ use Application\Service\Agent\AgentServiceAwareTrait; use Application\Service\AgentMissionSpecifique\AgentMissionSpecifiqueServiceAwareTrait; use Application\Service\FichePoste\FichePosteServiceAwareTrait; use Application\Service\FicheProfil\FicheProfilServiceAwareTrait; -use Application\Service\Poste\PosteServiceAwareTrait; use Application\Service\SpecificitePoste\SpecificitePosteServiceAwareTrait; use DateTime; use EntretienProfessionnel\Service\Campagne\CampagneServiceAwareTrait; @@ -43,7 +42,6 @@ class StructureController extends AbstractActionController { use FichePosteServiceAwareTrait; use FicheProfilServiceAwareTrait; use FormationInstanceInscritServiceAwareTrait; - use PosteServiceAwareTrait; use StructureServiceAwareTrait; use StructureAgentForceServiceAwareTrait; use SpecificitePosteServiceAwareTrait; @@ -98,7 +96,6 @@ class StructureController extends AbstractActionController { $allAgents = array_merge($agents, $agentsForces); $fichesRecrutements = $this->getStructureService()->getFichesPostesRecrutementsByStructures($structures); - $postes = $this->getPosteService()->getPostesByStructures($structures); usort($allAgents, function (Agent $a, Agent $b) { $aaa = $a->getNomUsuel() . " ". $a->getPrenom(); $bbb = $b->getNomUsuel() . " ". $b->getPrenom(); return $aaa > $bbb;}); /** Campagne */ @@ -108,10 +105,7 @@ class StructureController extends AbstractActionController { $agentsForcesLast = array_map(function (StructureAgentForce $a) { return $a->getAgent(); }, $structure->getAgentsForces()); $allAgentsLast = array_merge($agentsLast, $agentsForcesLast); - - $campagnes = $this->getCampagneService()->getCampagnesActives(); - $entretiens = []; $delegues = $this->getDelegueService()->getDeleguesByStructure($structure); $inscriptions = $this->getFormationInstanceInscritService()->getInscriptionsByStructure($structure, true, true); @@ -139,12 +133,10 @@ class StructureController extends AbstractActionController { 'agents' => $agents, 'agentsForces' => $agentsForces, 'agentsAll' => $allAgents, - 'postes' => $postes, 'last' => $last, 'agentsLast' => $allAgentsLast, 'campagnes' => $campagnes, - 'entretiens' => $entretiens, 'delegues' => $delegues, ]); } diff --git a/module/Structure/src/Structure/Controller/StructureControllerFactory.php b/module/Structure/src/Structure/Controller/StructureControllerFactory.php index be4b30cb7..d68060632 100644 --- a/module/Structure/src/Structure/Controller/StructureControllerFactory.php +++ b/module/Structure/src/Structure/Controller/StructureControllerFactory.php @@ -36,7 +36,6 @@ class StructureControllerFactory { * @var FichePosteService $fichePosteService * @var FicheProfilService $ficheProfilService * @var FormationInstanceInscritService $formationInstanceInscritService - * @var PosteService $posteService * @var SpecificitePosteService $specificiteService * @var StructureService $structureService * @var StructureAgentForceService $structureAgentForceService @@ -50,7 +49,6 @@ class StructureControllerFactory { $fichePosteService = $container->get(FichePosteService::class); $ficheProfilService = $container->get(FicheProfilService::class); $formationInstanceInscritService = $container->get(FormationInstanceInscritService::class); - $posteService = $container->get(PosteService::class); $specificiteService = $container->get(SpecificitePosteService::class); $structureService = $container->get(StructureService::class); $structureAgentForceService = $container->get(StructureAgentForceService::class); @@ -80,7 +78,6 @@ class StructureControllerFactory { $controller->setFichePosteService($fichePosteService); $controller->setFicheProfilService($ficheProfilService); $controller->setFormationInstanceInscritService($formationInstanceInscritService); - $controller->setPosteService($posteService); $controller->setSpecificitePosteService($specificiteService); $controller->setStructureService($structureService); $controller->setStructureAgentForceService($structureAgentForceService); diff --git a/module/Structure/view/structure/structure/afficher.phtml b/module/Structure/view/structure/structure/afficher.phtml index 366822b2a..53018d68e 100644 --- a/module/Structure/view/structure/structure/afficher.phtml +++ b/module/Structure/view/structure/structure/afficher.phtml @@ -13,7 +13,6 @@ * @var FichePoste[] $fichesCompletes * @var FichePoste[] $fichesIncompletes * @var FichePoste[] $fichesRecrutements - * @var Poste[] $postes * @var Agent[] $agents * @var Agent[] $agentsForces * @var Agent[] $agentsAll @@ -30,7 +29,6 @@ use Application\Entity\Db\Agent; use Application\Entity\Db\AgentMissionSpecifique; use Application\Entity\Db\FichePoste; use Application\Entity\Db\FicheProfil; -use Application\Entity\Db\Poste; use EntretienProfessionnel\Entity\Db\Campagne; use EntretienProfessionnel\Entity\Db\Delegue; use Formation\Entity\Db\FormationInstanceInscrit; -- GitLab