Loading module/Application/src/Application/Controller/FicheProfilController.php +3 −1 Original line number Diff line number Diff line Loading @@ -89,11 +89,13 @@ class FicheProfilController extends AbstractActionController { public function exporterAction() { $ficheprofil = $this->getFicheProfilService()->getRequestedFicheProfil($this); $ficheposte = $ficheprofil->getFichePoste(); $ficheposte->addDictionnaire('competences', $this->getFichePosteService()->getCompetencesDictionnaires($ficheposte)); $this->getExporterService()->setVars([ 'type' => 'PROFIL_DE_RECRUTMENT', 'ficheprofil' => $ficheprofil, 'ficheposte' => $ficheprofil->getFichePoste(), 'ficheposte' => $ficheposte, 'structure' => $ficheprofil->getStructure(), ]); $this->getExporterService()->export('export.pdf'); Loading module/Application/src/Application/Entity/Db/FichePoste.php +0 −57 Original line number Diff line number Diff line Loading @@ -349,63 +349,6 @@ class FichePoste implements ResourceInterface, HistoriqueAwareInterface, HasAgen /** Fonction pour les affichages dans les documents ***************************************************************/ public function getConnaissancesAffichage() { $dictionnaire = []; foreach ($this->getFichesMetiers() as $fiche) { /** @var Competence $competence */ foreach ($fiche->getFicheType()->getCompetenceListe() as $competenceElement) { $competence = $competenceElement->getCompetence(); if ($competence->getType()->getId() === CompetenceType::CODE_CONNAISSANCE) $dictionnaire[$competence->getId()] = $competence->getLibelle(); } } $texte = "<ul>"; foreach ($dictionnaire as $id => $libelle) { $texte .= "<li>".$libelle."</li>"; } $texte .= "</ul>"; return $texte; } public function getCompetencesOperationnellesAffichage() { $dictionnaire = []; foreach ($this->getFichesMetiers() as $fiche) { /** @var Competence $competence */ foreach ($fiche->getFicheType()->getCompetenceListe() as $competenceElement) { $competence = $competenceElement->getCompetence(); if ($competence->getType()->getId() === CompetenceType::CODE_OPERATIONNELLE) $dictionnaire[$competence->getId()] = $competence->getLibelle(); } } $texte = "<ul>"; foreach ($dictionnaire as $id => $libelle) { $texte .= "<li>".$libelle."</li>"; } $texte .= "</ul>"; return $texte; } public function getCompetencesComportementalesAffichage() { $dictionnaire = []; foreach ($this->getFichesMetiers() as $fiche) { /** @var Competence $competence */ foreach ($fiche->getFicheType()->getCompetenceListe() as $competenceElement) { $competence = $competenceElement->getCompetence(); if ($competence->getType()->getId() === CompetenceType::CODE_COMPORTEMENTALE) $dictionnaire[$competence->getId()] = $competence->getLibelle(); } } $texte = "<ul>"; foreach ($dictionnaire as $id => $libelle) { $texte .= "<li>".$libelle."</li>"; } $texte .= "</ul>"; return $texte; } public function addDictionnaire(string $clef, $valeur) { $this->dictionnaires[$clef] = $valeur; Loading module/Application/src/Application/Entity/Db/MacroContent/FichePosteMacroTrait.php +27 −2 Original line number Diff line number Diff line Loading @@ -142,15 +142,16 @@ trait FichePosteMacroTrait { /** * @param int $typeId * @param bool $all * @return string */ public function toStringCompetencesByTypes(int $typeId) : string public function toStringCompetencesByTypes(int $typeId, bool $all=false) : string { /** @var FichePoste $ficheposte */ $ficheposte = $this; $dictionnaire = $ficheposte->getDictionnaire('competences'); $dictionnaire = array_filter($dictionnaire, function ($a) { return $a["conserve"] === true;}); if (!$all) $dictionnaire = array_filter($dictionnaire, function ($a) { return $a["conserve"] === true;}); $dictionnaire = array_filter($dictionnaire, function ($a) use ($typeId) { return $a["entite"]->getType()->getId() === $typeId;}); usort($dictionnaire, function ($a, $b) { return $a["entite"]->getLibelle() > $b["entite"]->getLibelle();}); Loading @@ -172,6 +173,14 @@ trait FichePosteMacroTrait { return $this->toStringCompetencesByTypes(CompetenceType::CODE_CONNAISSANCE); } /** * @return string */ public function toStringAllCompetencesConnaissances() : string { return $this->toStringCompetencesByTypes(CompetenceType::CODE_CONNAISSANCE, true); } /** * @return string */ Loading @@ -180,6 +189,14 @@ trait FichePosteMacroTrait { return $this->toStringCompetencesByTypes(CompetenceType::CODE_OPERATIONNELLE); } /** * @return string */ public function toStringAllCompetencesOperationnelles() : string { return $this->toStringCompetencesByTypes(CompetenceType::CODE_OPERATIONNELLE, true); } /** * @return string */ Loading @@ -188,6 +205,14 @@ trait FichePosteMacroTrait { return $this->toStringCompetencesByTypes(CompetenceType::CODE_COMPORTEMENTALE); } /** * @return string */ public function toStringAllCompetencesComportementales() : string { return $this->toStringCompetencesByTypes(CompetenceType::CODE_COMPORTEMENTALE, true); } /** * @return string */ Loading Loading
module/Application/src/Application/Controller/FicheProfilController.php +3 −1 Original line number Diff line number Diff line Loading @@ -89,11 +89,13 @@ class FicheProfilController extends AbstractActionController { public function exporterAction() { $ficheprofil = $this->getFicheProfilService()->getRequestedFicheProfil($this); $ficheposte = $ficheprofil->getFichePoste(); $ficheposte->addDictionnaire('competences', $this->getFichePosteService()->getCompetencesDictionnaires($ficheposte)); $this->getExporterService()->setVars([ 'type' => 'PROFIL_DE_RECRUTMENT', 'ficheprofil' => $ficheprofil, 'ficheposte' => $ficheprofil->getFichePoste(), 'ficheposte' => $ficheposte, 'structure' => $ficheprofil->getStructure(), ]); $this->getExporterService()->export('export.pdf'); Loading
module/Application/src/Application/Entity/Db/FichePoste.php +0 −57 Original line number Diff line number Diff line Loading @@ -349,63 +349,6 @@ class FichePoste implements ResourceInterface, HistoriqueAwareInterface, HasAgen /** Fonction pour les affichages dans les documents ***************************************************************/ public function getConnaissancesAffichage() { $dictionnaire = []; foreach ($this->getFichesMetiers() as $fiche) { /** @var Competence $competence */ foreach ($fiche->getFicheType()->getCompetenceListe() as $competenceElement) { $competence = $competenceElement->getCompetence(); if ($competence->getType()->getId() === CompetenceType::CODE_CONNAISSANCE) $dictionnaire[$competence->getId()] = $competence->getLibelle(); } } $texte = "<ul>"; foreach ($dictionnaire as $id => $libelle) { $texte .= "<li>".$libelle."</li>"; } $texte .= "</ul>"; return $texte; } public function getCompetencesOperationnellesAffichage() { $dictionnaire = []; foreach ($this->getFichesMetiers() as $fiche) { /** @var Competence $competence */ foreach ($fiche->getFicheType()->getCompetenceListe() as $competenceElement) { $competence = $competenceElement->getCompetence(); if ($competence->getType()->getId() === CompetenceType::CODE_OPERATIONNELLE) $dictionnaire[$competence->getId()] = $competence->getLibelle(); } } $texte = "<ul>"; foreach ($dictionnaire as $id => $libelle) { $texte .= "<li>".$libelle."</li>"; } $texte .= "</ul>"; return $texte; } public function getCompetencesComportementalesAffichage() { $dictionnaire = []; foreach ($this->getFichesMetiers() as $fiche) { /** @var Competence $competence */ foreach ($fiche->getFicheType()->getCompetenceListe() as $competenceElement) { $competence = $competenceElement->getCompetence(); if ($competence->getType()->getId() === CompetenceType::CODE_COMPORTEMENTALE) $dictionnaire[$competence->getId()] = $competence->getLibelle(); } } $texte = "<ul>"; foreach ($dictionnaire as $id => $libelle) { $texte .= "<li>".$libelle."</li>"; } $texte .= "</ul>"; return $texte; } public function addDictionnaire(string $clef, $valeur) { $this->dictionnaires[$clef] = $valeur; Loading
module/Application/src/Application/Entity/Db/MacroContent/FichePosteMacroTrait.php +27 −2 Original line number Diff line number Diff line Loading @@ -142,15 +142,16 @@ trait FichePosteMacroTrait { /** * @param int $typeId * @param bool $all * @return string */ public function toStringCompetencesByTypes(int $typeId) : string public function toStringCompetencesByTypes(int $typeId, bool $all=false) : string { /** @var FichePoste $ficheposte */ $ficheposte = $this; $dictionnaire = $ficheposte->getDictionnaire('competences'); $dictionnaire = array_filter($dictionnaire, function ($a) { return $a["conserve"] === true;}); if (!$all) $dictionnaire = array_filter($dictionnaire, function ($a) { return $a["conserve"] === true;}); $dictionnaire = array_filter($dictionnaire, function ($a) use ($typeId) { return $a["entite"]->getType()->getId() === $typeId;}); usort($dictionnaire, function ($a, $b) { return $a["entite"]->getLibelle() > $b["entite"]->getLibelle();}); Loading @@ -172,6 +173,14 @@ trait FichePosteMacroTrait { return $this->toStringCompetencesByTypes(CompetenceType::CODE_CONNAISSANCE); } /** * @return string */ public function toStringAllCompetencesConnaissances() : string { return $this->toStringCompetencesByTypes(CompetenceType::CODE_CONNAISSANCE, true); } /** * @return string */ Loading @@ -180,6 +189,14 @@ trait FichePosteMacroTrait { return $this->toStringCompetencesByTypes(CompetenceType::CODE_OPERATIONNELLE); } /** * @return string */ public function toStringAllCompetencesOperationnelles() : string { return $this->toStringCompetencesByTypes(CompetenceType::CODE_OPERATIONNELLE, true); } /** * @return string */ Loading @@ -188,6 +205,14 @@ trait FichePosteMacroTrait { return $this->toStringCompetencesByTypes(CompetenceType::CODE_COMPORTEMENTALE); } /** * @return string */ public function toStringAllCompetencesComportementales() : string { return $this->toStringCompetencesByTypes(CompetenceType::CODE_COMPORTEMENTALE, true); } /** * @return string */ Loading