Loading documentation/release/3.0.1.md +5 −1 Changes for documentation/release/3.0.1.md: 5 added lines, 1 removed line. Original line number Diff line number Diff line **CHANGES version 3.0.1** * Ajout d'éléments descriptifs des actions de formation : type, objectifs, programme * Ajout de date de début et de fin pour les volumes horaires de formation * Ajout d'un état annulé aux événements afin de faciliter la gestion * Ajout d'un filtre sur les événements pour réduire l'affichage. * Ajout de mots clefs aux événements pour les lier à des entités de la même façon que les mails ou les rendus. ```sql -- partie SESSION -- partie ACTION alter table formation add type varchar(64); alter table formation add objectifs text; alter table formation add programme text; -- partie SEANCE alter table formation_seance add volume_debut timestamp; alter table formation_seance add volume_fin timestamp; -- partie EVENEMENT INSERT INTO unicaen_evenement_etat (CODE, LIBELLE, DESCRIPTION) VALUES ('annule', 'Événement dont le traitement a été annulé', null); Loading module/Formation/src/Formation/Entity/Db/FormationInstance.php +17 −2 Changes for module/Formation/src/Formation/Entity/Db/FormationInstance.php: 17 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -243,12 +243,19 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, public function getDebut(bool $datetime = false) : ?string { $minimum = null; /** @var Seance $journee */ foreach ($this->journees as $journee) { if ($journee->estNonHistorise() AND $journee->getType() === Seance::TYPE_SEANCE) { if ($journee->estNonHistorise()) { if ($journee->getType() === Seance::TYPE_SEANCE) { $split = explode("/", $journee->getJour()->format('d/m/Y')); $reversed = $split[2] . "/" . $split[1] . "/" . $split[0]; if ($minimum === null or $reversed < $minimum) $minimum = $reversed; } if ($journee->getType() === Seance::TYPE_VOLUME) { $debut = $journee->getVolumeDebut()->format("Y/m/d"); if ($minimum === null or $debut < $minimum) $minimum = $debut; } } } if ($minimum !== null) { $split = explode("/", $minimum); Loading @@ -269,11 +276,17 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, $maximum = null; /** @var Seance $journee */ foreach ($this->journees as $journee) { if ($journee->estNonHistorise() AND $journee->getType() === Seance::TYPE_SEANCE) { if ($journee->estNonHistorise()) { if ($journee->getType() === Seance::TYPE_SEANCE) { $split = explode("/", $journee->getJour()->format('d/m/Y')); $reversed = $split[2] . "/" . $split[1] . "/" . $split[0]; if ($maximum === null or $reversed > $maximum) $maximum = $reversed; } if ($journee->getType() === Seance::TYPE_VOLUME) { $fin = $journee->getVolumeFin()->format("Y/m/d"); if ($maximum === null or $fin > $maximum) $maximum = $fin; } } } if ($maximum !== null) { $split = explode("/", $maximum); Loading Loading @@ -587,9 +600,11 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, if ($journee->getType() === Seance::TYPE_SEANCE) { $debut = DateTime::createFromFormat('d/m/Y H:i', $journee->getJour()->format('d/m/Y') . " " . $journee->getDebut()); $fin = DateTime::createFromFormat('d/m/Y H:i', $journee->getJour()->format('d/m/Y') . " " . $journee->getFin()); if ($debut instanceof DateTime AND $fin instanceof DateTime) { $duree = $debut->diff($fin); $sum->add($duree); } } if ($journee->getType() === Seance::TYPE_VOLUME) { $volume = $journee->getVolume(); if ($volume) { Loading module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Seance.dcm.xml +2 Changes for module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Seance.dcm.xml: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ <field name="lieu" column="lieu" type="string" length="1024" nullable="true"/> <field name="volume" column="volume" type="float" nullable="true"/> <field name="volumeDebut" column="volume_debut" type="datetime" nullable="true"/> <field name="volumeFin" column="volume_fin" type="datetime" nullable="true"/> <field name="remarque" column="remarque" type="string" length="4096" nullable="false"/> Loading module/Formation/src/Formation/Entity/Db/Seance.php +32 −1 Changes for module/Formation/src/Formation/Entity/Db/Seance.php: 32 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -15,15 +15,26 @@ class Seance implements HistoriqueAwareInterface, HasSourceInterface const TYPE_SEANCE = "SEANCE"; const TYPE_VOLUME = "VOLUME"; const TYPES = [ Seance::TYPE_SEANCE => "Séance de formation", Seance::TYPE_VOLUME => "Volume horaire", ]; private ?int $id = null; private ?FormationInstance $instance = null; private string $type = self::TYPE_SEANCE; //seance private ?DateTime $jour = null; private ?string $debut = null; private ?string $fin = null; private ?float $volume = null; private ?string $lieu = null; //volume private ?float $volume = null; private ?DateTime $volumeDebut = null; private ?DateTime $volumeFin = null; private ?string $remarque = null; public function getId() : ?int Loading Loading @@ -104,6 +115,26 @@ class Seance implements HistoriqueAwareInterface, HasSourceInterface $this->volume = $volume; } public function getVolumeDebut(): ?DateTime { return $this->volumeDebut; } public function setVolumeDebut(?DateTime $volumeDebut): void { $this->volumeDebut = $volumeDebut; } public function getVolumeFin(): ?DateTime { return $this->volumeFin; } public function setVolumeFin(?DateTime $volumeFin): void { $this->volumeFin = $volumeFin; } /** AUTRE ****************************************************** */ public function getRemarque() : ?string Loading module/Formation/src/Formation/Form/Seance/SeanceForm.php +33 −2 Changes for module/Formation/src/Formation/Form/Seance/SeanceForm.php: 33 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Formation\Entity\Db\Seance; use Laminas\Form\Element\Button; use Laminas\Form\Element\DateTime; use Laminas\Form\Element\Number; use Laminas\Form\Element\Radio; use Laminas\Form\Element\Select; use Laminas\Form\Element\Text; use Laminas\Form\Form; Loading Loading @@ -38,6 +37,8 @@ class SeanceForm extends Form ); /* SEANCE *********************************************************************/ //jour $this->add([ 'type' => Date::class, Loading Loading @@ -74,6 +75,9 @@ class SeanceForm extends Form 'id' => 'fin', ], ]); /* VOLUME *********************************************************************/ //number $this->add([ 'type' => Number::class, Loading @@ -86,6 +90,31 @@ class SeanceForm extends Form 'id' => 'volume', ], ]); //jour $this->add([ 'type' => Date::class, 'name' => 'volume_debut', 'options' => [ 'label' => "Date d'ouverture du volume * :", 'format' => 'd/m/Y', ], 'attributes' => [ 'id' => 'volume_debut', ], ]); //jour $this->add([ 'type' => Date::class, 'name' => 'volume_fin', 'options' => [ 'label' => "Date de fermeture du volume * :", 'format' => 'd/m/Y', ], 'attributes' => [ 'id' => 'volume_fin', ], ]); //salle $this->add([ 'type' => Text::class, Loading Loading @@ -124,7 +153,7 @@ class SeanceForm extends Form Callback::INVALID_VALUE => "Une information obligatoire est manquante", ], 'callback' => function ($value, $context = []) { if($context['type'] === Seance::TYPE_VOLUME) return $context['volume'] !== ''; if($context['type'] === Seance::TYPE_VOLUME) return ($context['volume'] !== '' AND $context['volume_debut'] AND $context['volume_fin'] !== ''); if($context['type'] === Seance::TYPE_SEANCE) return ($context['jour'] !== '' AND $context['debut'] !== '' AND $context['fin'] !== ''); return true; }, Loading @@ -137,6 +166,8 @@ class SeanceForm extends Form 'debut' => ['required' => false,], 'fin' => ['required' => false,], 'volume' => ['required' => false,], 'volume_debut' => ['required' => false,], 'volume_fin' => ['required' => false,], 'lieu' => ['required' => true,], ])); } Loading Loading
documentation/release/3.0.1.md +5 −1 Changes for documentation/release/3.0.1.md: 5 added lines, 1 removed line. Original line number Diff line number Diff line **CHANGES version 3.0.1** * Ajout d'éléments descriptifs des actions de formation : type, objectifs, programme * Ajout de date de début et de fin pour les volumes horaires de formation * Ajout d'un état annulé aux événements afin de faciliter la gestion * Ajout d'un filtre sur les événements pour réduire l'affichage. * Ajout de mots clefs aux événements pour les lier à des entités de la même façon que les mails ou les rendus. ```sql -- partie SESSION -- partie ACTION alter table formation add type varchar(64); alter table formation add objectifs text; alter table formation add programme text; -- partie SEANCE alter table formation_seance add volume_debut timestamp; alter table formation_seance add volume_fin timestamp; -- partie EVENEMENT INSERT INTO unicaen_evenement_etat (CODE, LIBELLE, DESCRIPTION) VALUES ('annule', 'Événement dont le traitement a été annulé', null); Loading
module/Formation/src/Formation/Entity/Db/FormationInstance.php +17 −2 Changes for module/Formation/src/Formation/Entity/Db/FormationInstance.php: 17 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -243,12 +243,19 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, public function getDebut(bool $datetime = false) : ?string { $minimum = null; /** @var Seance $journee */ foreach ($this->journees as $journee) { if ($journee->estNonHistorise() AND $journee->getType() === Seance::TYPE_SEANCE) { if ($journee->estNonHistorise()) { if ($journee->getType() === Seance::TYPE_SEANCE) { $split = explode("/", $journee->getJour()->format('d/m/Y')); $reversed = $split[2] . "/" . $split[1] . "/" . $split[0]; if ($minimum === null or $reversed < $minimum) $minimum = $reversed; } if ($journee->getType() === Seance::TYPE_VOLUME) { $debut = $journee->getVolumeDebut()->format("Y/m/d"); if ($minimum === null or $debut < $minimum) $minimum = $debut; } } } if ($minimum !== null) { $split = explode("/", $minimum); Loading @@ -269,11 +276,17 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, $maximum = null; /** @var Seance $journee */ foreach ($this->journees as $journee) { if ($journee->estNonHistorise() AND $journee->getType() === Seance::TYPE_SEANCE) { if ($journee->estNonHistorise()) { if ($journee->getType() === Seance::TYPE_SEANCE) { $split = explode("/", $journee->getJour()->format('d/m/Y')); $reversed = $split[2] . "/" . $split[1] . "/" . $split[0]; if ($maximum === null or $reversed > $maximum) $maximum = $reversed; } if ($journee->getType() === Seance::TYPE_VOLUME) { $fin = $journee->getVolumeFin()->format("Y/m/d"); if ($maximum === null or $fin > $maximum) $maximum = $fin; } } } if ($maximum !== null) { $split = explode("/", $maximum); Loading Loading @@ -587,9 +600,11 @@ class FormationInstance implements HistoriqueAwareInterface, HasSourceInterface, if ($journee->getType() === Seance::TYPE_SEANCE) { $debut = DateTime::createFromFormat('d/m/Y H:i', $journee->getJour()->format('d/m/Y') . " " . $journee->getDebut()); $fin = DateTime::createFromFormat('d/m/Y H:i', $journee->getJour()->format('d/m/Y') . " " . $journee->getFin()); if ($debut instanceof DateTime AND $fin instanceof DateTime) { $duree = $debut->diff($fin); $sum->add($duree); } } if ($journee->getType() === Seance::TYPE_VOLUME) { $volume = $journee->getVolume(); if ($volume) { Loading
module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Seance.dcm.xml +2 Changes for module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Seance.dcm.xml: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ <field name="lieu" column="lieu" type="string" length="1024" nullable="true"/> <field name="volume" column="volume" type="float" nullable="true"/> <field name="volumeDebut" column="volume_debut" type="datetime" nullable="true"/> <field name="volumeFin" column="volume_fin" type="datetime" nullable="true"/> <field name="remarque" column="remarque" type="string" length="4096" nullable="false"/> Loading
module/Formation/src/Formation/Entity/Db/Seance.php +32 −1 Changes for module/Formation/src/Formation/Entity/Db/Seance.php: 32 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -15,15 +15,26 @@ class Seance implements HistoriqueAwareInterface, HasSourceInterface const TYPE_SEANCE = "SEANCE"; const TYPE_VOLUME = "VOLUME"; const TYPES = [ Seance::TYPE_SEANCE => "Séance de formation", Seance::TYPE_VOLUME => "Volume horaire", ]; private ?int $id = null; private ?FormationInstance $instance = null; private string $type = self::TYPE_SEANCE; //seance private ?DateTime $jour = null; private ?string $debut = null; private ?string $fin = null; private ?float $volume = null; private ?string $lieu = null; //volume private ?float $volume = null; private ?DateTime $volumeDebut = null; private ?DateTime $volumeFin = null; private ?string $remarque = null; public function getId() : ?int Loading Loading @@ -104,6 +115,26 @@ class Seance implements HistoriqueAwareInterface, HasSourceInterface $this->volume = $volume; } public function getVolumeDebut(): ?DateTime { return $this->volumeDebut; } public function setVolumeDebut(?DateTime $volumeDebut): void { $this->volumeDebut = $volumeDebut; } public function getVolumeFin(): ?DateTime { return $this->volumeFin; } public function setVolumeFin(?DateTime $volumeFin): void { $this->volumeFin = $volumeFin; } /** AUTRE ****************************************************** */ public function getRemarque() : ?string Loading
module/Formation/src/Formation/Form/Seance/SeanceForm.php +33 −2 Changes for module/Formation/src/Formation/Form/Seance/SeanceForm.php: 33 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Formation\Entity\Db\Seance; use Laminas\Form\Element\Button; use Laminas\Form\Element\DateTime; use Laminas\Form\Element\Number; use Laminas\Form\Element\Radio; use Laminas\Form\Element\Select; use Laminas\Form\Element\Text; use Laminas\Form\Form; Loading Loading @@ -38,6 +37,8 @@ class SeanceForm extends Form ); /* SEANCE *********************************************************************/ //jour $this->add([ 'type' => Date::class, Loading Loading @@ -74,6 +75,9 @@ class SeanceForm extends Form 'id' => 'fin', ], ]); /* VOLUME *********************************************************************/ //number $this->add([ 'type' => Number::class, Loading @@ -86,6 +90,31 @@ class SeanceForm extends Form 'id' => 'volume', ], ]); //jour $this->add([ 'type' => Date::class, 'name' => 'volume_debut', 'options' => [ 'label' => "Date d'ouverture du volume * :", 'format' => 'd/m/Y', ], 'attributes' => [ 'id' => 'volume_debut', ], ]); //jour $this->add([ 'type' => Date::class, 'name' => 'volume_fin', 'options' => [ 'label' => "Date de fermeture du volume * :", 'format' => 'd/m/Y', ], 'attributes' => [ 'id' => 'volume_fin', ], ]); //salle $this->add([ 'type' => Text::class, Loading Loading @@ -124,7 +153,7 @@ class SeanceForm extends Form Callback::INVALID_VALUE => "Une information obligatoire est manquante", ], 'callback' => function ($value, $context = []) { if($context['type'] === Seance::TYPE_VOLUME) return $context['volume'] !== ''; if($context['type'] === Seance::TYPE_VOLUME) return ($context['volume'] !== '' AND $context['volume_debut'] AND $context['volume_fin'] !== ''); if($context['type'] === Seance::TYPE_SEANCE) return ($context['jour'] !== '' AND $context['debut'] !== '' AND $context['fin'] !== ''); return true; }, Loading @@ -137,6 +166,8 @@ class SeanceForm extends Form 'debut' => ['required' => false,], 'fin' => ['required' => false,], 'volume' => ['required' => false,], 'volume_debut' => ['required' => false,], 'volume_fin' => ['required' => false,], 'lieu' => ['required' => true,], ])); } Loading