Loading documentation/release/4.2.1.md +3 −0 Original line number Diff line number Diff line Loading @@ -4,12 +4,15 @@ Version 4.2.0 (XX/11/2023) Évolution --- - [Mes Formations] Couleur pour les axes + mise en forme dans les plans de formation - [Mes Formations] Couleur pour les domaines + mise en forme dans les plans de formation Modification en BD --- ```postgresql alter table formation_axe add couleur varchar(64); alter table formation_domaine add couleur varchar(64); ``` Loading module/Formation/src/Formation/Entity/Db/Domaine.php +11 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ class Domaine implements HistoriqueAwareInterface, HasDescriptionInterface private ?int $id = -1; private ?string $libelle = null; private ?int $ordre = null; private ?string $couleur = null; private Collection $formations; public function __construct() Loading Loading @@ -51,6 +52,16 @@ class Domaine implements HistoriqueAwareInterface, HasDescriptionInterface $this->ordre = $ordre; } public function getCouleur(): ?string { return ($this->couleur)??"gray"; } public function setCouleur(?string $couleur): void { $this->couleur = $couleur; } /** @return Formation[] */ public function getFormations(): array { Loading module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Domaine.dcm.xml +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ <field name="libelle" column="libelle" type="string" length="256" /> <field name="description" column="description" type="string" length="9999" /> <field name="ordre" column="ordre" type="integer" /> <field name="couleur" column="couleur" type="string" length="64" /> <many-to-many field="formations" target-entity="Formation\Entity\Db\Formation"> <join-table name="formation_formation_domaine"> Loading module/Formation/src/Formation/Form/Domaine/DomaineForm.php +12 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Formation\Form\Domaine; use Application\Form\HasDescription\HasDescriptionFieldset; use Laminas\Form\Element\Button; use Laminas\Form\Element\Color; use Laminas\Form\Element\Number; use Laminas\Form\Element\Text; use Laminas\Form\Form; Loading Loading @@ -44,6 +45,17 @@ class DomaineForm extends Form 'id' => 'ordre', ], ]); //couleur $this->add([ 'type' => Color::class, 'name' => 'couleur', 'options' => [ 'label' => "Couleur :", ], 'attributes' => [ 'id' => 'couleur', ], ]); //bouton $this->add([ 'type' => Button::class, Loading module/Formation/src/Formation/Form/Domaine/DomaineHydrator.php +4 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ class DomaineHydrator implements HydratorInterface 'libelle' => ($object->getLibelle()) ?: null, 'HasDescription' => ['description' => $object->getDescription()], 'ordre' => ($object->getOrdre() !== null) ? $object->getOrdre(): null, 'couleur' => ($object->getCouleur() !== null) ? $object->getCouleur(): null, ]; return $data; } Loading @@ -24,11 +25,14 @@ class DomaineHydrator implements HydratorInterface $libelle = (isset($data['libelle']) and trim($data['libelle']) !== '') ? trim($data['libelle']) : null; $description = (isset($data['HasDescription']) AND isset($data['HasDescription']['description']) && trim($data['HasDescription']['description']) != '')?trim($data['HasDescription']['description']):null; $ordre = (isset($data['ordre'])) ? $data['ordre'] : null; $couleur = (isset($data['couleur'])) ? $data['couleur'] : null; /** @var Domaine $object */ $object->setLibelle($libelle); $object->setDescription($description); $object->setOrdre($ordre?((int) $ordre):null); $object->setCouleur($couleur); return $object; } Loading Loading
documentation/release/4.2.1.md +3 −0 Original line number Diff line number Diff line Loading @@ -4,12 +4,15 @@ Version 4.2.0 (XX/11/2023) Évolution --- - [Mes Formations] Couleur pour les axes + mise en forme dans les plans de formation - [Mes Formations] Couleur pour les domaines + mise en forme dans les plans de formation Modification en BD --- ```postgresql alter table formation_axe add couleur varchar(64); alter table formation_domaine add couleur varchar(64); ``` Loading
module/Formation/src/Formation/Entity/Db/Domaine.php +11 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ class Domaine implements HistoriqueAwareInterface, HasDescriptionInterface private ?int $id = -1; private ?string $libelle = null; private ?int $ordre = null; private ?string $couleur = null; private Collection $formations; public function __construct() Loading Loading @@ -51,6 +52,16 @@ class Domaine implements HistoriqueAwareInterface, HasDescriptionInterface $this->ordre = $ordre; } public function getCouleur(): ?string { return ($this->couleur)??"gray"; } public function setCouleur(?string $couleur): void { $this->couleur = $couleur; } /** @return Formation[] */ public function getFormations(): array { Loading
module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Domaine.dcm.xml +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ <field name="libelle" column="libelle" type="string" length="256" /> <field name="description" column="description" type="string" length="9999" /> <field name="ordre" column="ordre" type="integer" /> <field name="couleur" column="couleur" type="string" length="64" /> <many-to-many field="formations" target-entity="Formation\Entity\Db\Formation"> <join-table name="formation_formation_domaine"> Loading
module/Formation/src/Formation/Form/Domaine/DomaineForm.php +12 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Formation\Form\Domaine; use Application\Form\HasDescription\HasDescriptionFieldset; use Laminas\Form\Element\Button; use Laminas\Form\Element\Color; use Laminas\Form\Element\Number; use Laminas\Form\Element\Text; use Laminas\Form\Form; Loading Loading @@ -44,6 +45,17 @@ class DomaineForm extends Form 'id' => 'ordre', ], ]); //couleur $this->add([ 'type' => Color::class, 'name' => 'couleur', 'options' => [ 'label' => "Couleur :", ], 'attributes' => [ 'id' => 'couleur', ], ]); //bouton $this->add([ 'type' => Button::class, Loading
module/Formation/src/Formation/Form/Domaine/DomaineHydrator.php +4 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ class DomaineHydrator implements HydratorInterface 'libelle' => ($object->getLibelle()) ?: null, 'HasDescription' => ['description' => $object->getDescription()], 'ordre' => ($object->getOrdre() !== null) ? $object->getOrdre(): null, 'couleur' => ($object->getCouleur() !== null) ? $object->getCouleur(): null, ]; return $data; } Loading @@ -24,11 +25,14 @@ class DomaineHydrator implements HydratorInterface $libelle = (isset($data['libelle']) and trim($data['libelle']) !== '') ? trim($data['libelle']) : null; $description = (isset($data['HasDescription']) AND isset($data['HasDescription']['description']) && trim($data['HasDescription']['description']) != '')?trim($data['HasDescription']['description']):null; $ordre = (isset($data['ordre'])) ? $data['ordre'] : null; $couleur = (isset($data['couleur'])) ? $data['couleur'] : null; /** @var Domaine $object */ $object->setLibelle($libelle); $object->setDescription($description); $object->setOrdre($ordre?((int) $ordre):null); $object->setCouleur($couleur); return $object; } Loading