diff --git a/config/autoload/synchro.local.php.dist b/config/autoload/synchro.local.php.dist index 878b9d37f4c9299cc4f18686da80856fd9c3f09a..9908d43f9ab4f143b0a3fc320b03e96cc62a82de 100644 --- a/config/autoload/synchro.local.php.dist +++ b/config/autoload/synchro.local.php.dist @@ -223,39 +223,6 @@ return [ ], 'id' => 'id', ], - 'AGENT_ECHELON' => [ - 'order' => 5200, - 'source' => 'OCTOPUS', - 'orm_source' => 'orm_octopus', - 'orm_destination' => 'orm_default', - 'table_source' => 'V_EMC2_AGENT_ECHELON', - 'table_destination' => 'agent_carriere_echelon', - 'correspondance' => [ - 'id' => 'id', - 'agent_id' => 'agent_id', - 'echelon' => 'echelon', - 'date_debut' => 'd_debut', - 'date_fin' => 'd_fin', - ], - 'id' => 'id', - ], - 'AGENT_QUOTITE' => [ - 'order' => 5300, - 'source' => 'OCTOPUS', - 'orm_source' => 'orm_octopus', - 'orm_destination' => 'orm_default', - 'table_source' => 'V_EMC2_AGENT_QUOTITE', - 'table_destination' => 'agent_carriere_quotite', - 'correspondance' => [ - 'id' => 'id', - 'agent_id' => 'agent_id', - 'quotite' => 'quotite', - 'date_debut' => 'd_debut', - 'date_fin' => 'd_fin', - 'modalite' => 'modalite_de_service', - ], - 'id' => 'id', - ], 'AGENT_POSTE' => [ 'order' => 5500, 'source' => 'OCTOPUS', diff --git a/config/autoload/synchro.local.php.save b/config/autoload/synchro.local.php.save index 3205a368df0561a02147a6f7cca639efab4fa232..1695e40c071fc8bc87518f7a800a3124c91efa78 100644 --- a/config/autoload/synchro.local.php.save +++ b/config/autoload/synchro.local.php.save @@ -227,24 +227,6 @@ return [ 'id' => 'ID', 'separator' => 'STRUCTURE_ID' ], - 'AGENT_QUOTITE' => [ - 'order' => 5300, - 'source' => 'OCTOPUS', - 'orm_source' => 'orm_octopus', - 'orm_destination' => 'orm_default', - 'table_source' => 'V_MESFORMATIONS_AGENT_QUOTITE', - 'table_destination' => 'agent_carriere_quotite', - 'correspondance' => [ - 'ID_ORIG' => 'id', - 'AGENT_ID' => 'agent_id', - 'QUOTITE' => 'quotite', - 'DATE_DEBUT' => 'd_debut', - 'DATE_FIN' => 'd_fin', - //'MODALITE' => 'modalite_de_service', - ], - 'id' => 'ID_ORIG', - 'separator' => 'QUOTITE' - ], 'AGENT_STATUT' => [ 'order' => 5400, 'source' => 'OCTOPUS', @@ -276,23 +258,6 @@ return [ 'id' => 'ID_ORIG', 'separator' => 'STRUCTURE_ID', ], - 'AGENT_ECHELON' => [ - 'order' => 5200, - 'source' => 'OCTOPUS', - 'orm_source' => 'orm_octopus', - 'orm_destination' => 'orm_default', - 'table_source' => 'V_MESFORMATIONS_AGENT_ECHELON', - 'table_destination' => 'agent_carriere_echelon', - 'correspondance' => [ - 'ID_ORIG' => 'id', - 'AGENT_ID' => 'agent_id', - 'ECHELON' => 'echelon', - 'DATE_DEBUT' => 'd_debut', - 'DATE_FIN' => 'd_fin', - ], - 'id' => 'ID_ORIG', - 'separator' => 'ECHELON' - ], 'AGENT_VALIDATEUR' => [ 'order' => 5200, 'source' => 'OCTOPUS', diff --git a/documentation/docs/connecteurs.md b/documentation/docs/connecteurs.md new file mode 100644 index 0000000000000000000000000000000000000000..86e85b57fe5c4718601bbbdf843187d0167614a0 --- /dev/null +++ b/documentation/docs/connecteurs.md @@ -0,0 +1,285 @@ +Connecteurs +==== + +**Mes Formations** est alimentée via des synchronisations exploitant des données exposées dans le SI de l'établissement qui l'instale. +Ces données sont présentés : +- soient depuis le SIRH (SIHAM, HARPEGE, ...) +- soient depuis un concentrateur de données (par exemple *OCTOPUS* à Caen) + +Nous aborderons tout d'abord la composition des vues puis le moyen de déclencher ces synchronisations et finalement comment adapter les vues et la configuration de la synchronisation. + +---- + +Vues +===== + +## Données liées aux référentiels RH + +1. CORRESPONDANCE_TYPE +1. CORRESPONDANCE +2. CORPS +3. GRADE +4. EMPLOITYPE + + +## Données liées aux structures + +On retrouve dans cette catégorie les vues : +1. V_MESFORMATIONS_STRUCTURE_TYPE +1. V_MESFORMATIONS_STRUCTURE + +### La vue listant les types de structures V_MESFORMATIONS_STRUCTURE_TYPE + +Cette vue présente directement la liste des types de structures + +| Nom de la colonne | Type | Obligatoire | Commentaire | +|-------------------|---------------|-------------|---------------| +| ID | integer | Oui | Clef primaire | +| CODE | varchar(64) | Oui | | +| LIBELLE | varchar(256) | Oui | | +| DESCRIPTION | text | Non | | + +Exemple depuis l'instance de démonstration. +```csv +'id';'code';'libelle';'description' +1,"ETAB","Établissement","Établissement" +2,"COMP","Composante","Composante" +3,"SREC","Structure de recherche","Structure de recherche" +... +``` + +### La vue listant les types de structures V_MESFORMATIONS_STRUCTURE + +Cette vue présente la liste des structures + +| Nom de la colonne | Type | Obligatoire | Commentaire | +|-------------------|---------------|-------------|----------------------------------------------------| +| ID | integer | Oui | Clef primaire | +| CODE | varchar(64) | Oui | | +| LIBELLE_COURT | varchar(256) | Oui | | +| LIBELLE_LONG | varchar(2048) | Oui | | +| SIGLE | varchar(64) | Non | | +| TYPE_ID | integer | Oui | Clef étrangère vers V_MESFORMATIONS_STRUCTURE_TYPE | +| EMAIL_GENERIQUE | varchar(2048) | Non | | +| DATE_OUVERTURE | DateTime | Oui | | +| DATE_FERMETURE | DateTime | Non | | +| PARENT_ID | integer | Non | Clef étrangère vers V_MESFORMATIONS_STRUCTURE | +| NIV2_ID | integer | Non | Clef étrangère vers V_MESFORMATIONS_STRUCTURE | + +**N.B.**: +Dans cette vue vous pouvez limiter le liste des structures que vous voulez présenter. +Attention toutefois a bien remonter les structures référencées par les colonnes parent_id et niv2_id + +## Données liées aux référentiels Agent·es + +1. AGENT +3. AGENT_AFFECTATION +7. AGENT_GRADE +7. AGENT_STATUT + +2. STRUCTURE_RESPONSABLE +3. STRUCTURE_GESTIONNAIRE +3. AGENT_VALIDEUR + +Configuration de la biliothèque +=== + +## L'accés aux bases de données sources + +Les bases de données sources doivent être déclaré comme ORM pour cela, il est nécessaire de les déclarer comme fichier de configuration local (non synchronisé dans le dépôt). +Dans la suite je présente la configuration faite à Caen exploitant deux bases de données sources : +1. OCTOPUS qui est un concentrateur de données +2. UNIFORMSUP qui regroupe des informations sur les étapes et diplômes + +**Ajout de l'ORM pour OCTOPUS** + +Dans cet exemple, octopus est une base de donnée pgsql (penser à installer le drivers associé). + +Fichier 'config/autoload/database-octopus.local.php' +```php +<?php +use Doctrine\DBAL\Driver\PDO\PgSQL\Driver; +use Doctrine\ORM\Mapping\Driver\XmlDriver; +use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; + +return [ + 'doctrine' => [ + 'driver' => [ + 'orm_octopus' => [ + 'class' => MappingDriverChain::class, + 'drivers' => [ + 'Application\Entity\Db' => 'orm_octopus_xml_driver', + ], + ], + 'orm_octopus_xml_driver' => [ + 'class' => XmlDriver::class, + 'cache' => 'apc', + 'paths' => [ + __DIR__ . '/../src/Application/Entity/Db/Mapping', + ], + ], + ], + 'connection' => [ + 'orm_octopus' => [ + 'driverClass' => OCI8::class, + 'params' => [ + 'host' => #####, + 'user' => #####, + 'password' => #####, + 'charset' => 'AL32UTF8', + 'port' => ####, + 'service' => ####, + 'servicename' => ####, + ], + ], + ], + + + 'entitymanager' => [ + 'orm_octopus' => [ + 'connection' => 'orm_octopus', + 'configuration' => 'orm_octopus', + ], + ], + + 'configuration' => [ + 'orm_octopus' => [ + 'metadata_cache' => 'array', + 'query_cache' => 'array', + 'result_cache' => 'array', + 'hydration_cache' => 'array', + 'generate_proxies' => true, + 'driver' => 'orm_octopus', + ], + ], + ], + +]; + + +``` +**Ajout de l'ORM pour UNIFORMSUP** + +Dans cet exemple, uniformsup est une base de donnée oracle (penser à installer le drivers OCI8). + +Fichier 'config/autoload/database-uniform.local.php' +```php +<?php +use Doctrine\DBAL\Driver\OCI8\Driver as OCI8; +use Doctrine\ORM\Mapping\Driver\XmlDriver; +use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; + +return [ + 'doctrine' => [ + 'driver' => [ + 'orm_uniform' => [ + 'class' => MappingDriverChain::class, + 'drivers' => [ + 'Application\Entity\Db' => 'orm_octopus_xml_driver', + ], + ], + 'orm_uniform_xml_driver' => [ + 'class' => XmlDriver::class, + 'cache' => 'apc', + 'paths' => [ + __DIR__ . '/../src/Application/Entity/Db/Mapping', + ], + ], + ], + 'connection' => [ + 'orm_uniform' => [ + 'driverClass' => OCI8::class, + 'params' => [ + 'host' => #####, + 'user' => #####, + 'password' => #####, + 'charset' => 'AL32UTF8', + 'port' => ####, + 'service' => ####, + 'servicename' => ####, + ], + ], + ], + + + 'entitymanager' => [ + 'orm_uniform' => [ + 'connection' => 'orm_uniform', + 'configuration' => 'orm_uniform', + ], + ], + 'configuration' => [ + 'orm_uniform' => [ + 'metadata_cache' => 'array', + 'query_cache' => 'array', + 'result_cache' => 'array', + 'hydration_cache' => 'array', + 'generate_proxies' => true, + 'driver' => 'orm_uniform', + ], + ], + ], +]; + +``` + +## Configurer une synchronisation + +Le fichier configurant les synchronisations est composé de deux blocs : +1. data_sources la liste des ORM utilisables +2. la liste des synchronisation (les tables de correspondance) + +La liste des ORM utilisables est un simple table référencant les ORM précédemment définis. + +Le synchronisation on la structure suivante : +```php + 'NOM_DE_LA_SYNCHRONISATION' => [ + 'order' => ORDRE DE PRIORITE, + 'source' => LIBELLE DE LA SOURCE (sera copié tel que en base de donnée dans la colonne SOURCE_ID), + 'orm_source' => ORM SOURCE (clef définie précédemment orm_octopus ou orm_uniform) + 'orm_destination' => 'orm_default', + 'table_source' => NOM DE LA TABLE OU VUE SOURCE, + 'table_destination' => NOM De LA TABLE DESTINATION + 'correspondance' => [ + LIBELLE DE LA COLONNE 1 SOURCE => LIBELLE DE LA COLONNE 1 DESTINATION, + LIBELLE DE LA COLONNE 2 SOURCE => LIBELLE DE LA COLONNE 2 DESTINATION + ], + 'id' => COLONNE A UTILISEE COMME CLEF PRIMAIRE DANS LA SOURCE, +], +``` + +Les synchronisations utilisées à Caen sont fourni comme exemple : +1. La synchronisation de l'instance de démonstration `config/autoload/synchro.local.php.demo` +2. La synchronisation des instances de préproduction et production `config/autoload/synchro.local.php.octopus` + +## Lancer une synchronisation + +La synchronisation est lancé en ligne de commande il est possible de lancer l'ensemble des synchronisations ou une synchronisation + +```bash +/var/www/html$ php public/index.php synchroniser-all +/var/www/html$ php public/index.php synchroniser --name=NOM_DE_LA_SYNCHRONISATION +``` + +Cette même commande peut être lancer via un cron ou un service pour rendre récurrent/automatique celle-ci. + +## Astuces + +Les synchronisations peuvent être accélérées par un spérateur divisant le volume de données en des morceaux plus petits. + +```php + 'NOM_DE_LA_SYNCHRONISATION' => [ + 'order' => ORDRE DE PRIORITE, + 'source' => LIBELLE DE LA SOURCE (sera copié tel que en base de donnée dans la colonne SOURCE_ID), + 'orm_source' => ORM SOURCE (clef définie précédemment orm_octopus ou orm_uniform) + 'orm_destination' => 'orm_default', + 'table_source' => NOM DE LA TABLE OU VUE SOURCE, + 'table_destination' => NOM De LA TABLE DESTINATION + 'correspondance' => [ + LIBELLE DE LA COLONNE 1 SOURCE => LIBELLE DE LA COLONNE 1 DESTINATION, + LIBELLE DE LA COLONNE 2 SOURCE => LIBELLE DE LA COLONNE 2 DESTINATION + ], + 'id' => COLONNE A UTILISEE COMME CLEF PRIMAIRE DANS LA SOURCE, + 'separator' => COLONNE SOURCE QUI DIVISERA LES DONNEES, +], +``` diff --git a/documentation/docs/indicateurs.md b/documentation/docs/indicateurs.md index 0450beec6787c75837bfba77be3a7c52e16fae0c..174d1d69ed6d889220c712f3ddf139ebab763287 100644 --- a/documentation/docs/indicateurs.md +++ b/documentation/docs/indicateurs.md @@ -24,4 +24,10 @@ L'exemple suivant rafraichit les indicateurs le lundi à 8:00. 0 8 * * 1 /usr/bin/php/var/www/html/vendor/laminas indicateur-refresh ``` -**N.B.:** Ici la supposition faite est que php est installé dans le répertoire par défaut et que Mes Formations est installé dans le repertoire `/var/www/html`. \ No newline at end of file +**N.B.:** Ici la supposition faite est que php est installé dans le répertoire par défaut et que Mes Formations est installé dans le repertoire `/var/www/html`. + +# Indicateurs partagés + +--- + + diff --git a/documentation/docs/install.md b/documentation/docs/install.md index c019eefb27a03e10a6e3ee9046fcbab9da3a5128..64fa9d6f07c6dc66fa89480fb195b1188e9f5f78 100644 --- a/documentation/docs/install.md +++ b/documentation/docs/install.md @@ -1,4 +1,92 @@ -* Cloner le projet -* Déplacer et configurer les fichiers locaux -* Installer les biliothèque -* Lancer une synchro +# Documentation pour l'installation et la configuration du projet + +## Clonage du projet + +Clonez le projet dans le répertoire `/var/www/html/` : + +```bash +git clone https://git.unicaen.fr/open-source/mes-formations.git /var/www/html/ +``` + +**Note :** À partir de cette étape, toutes les commandes et chemins supposent que vous êtes dans le répertoire +/var/www/html/. + +## Mise à jour avec Composer + +Rendez-vous dans le répertoire du projet et exécutez la commande suivante pour mettre à jour les dépendances : + +```bash +composer update +``` + +**Note :** Attention à la configuration de votre proxy + +## Configuration + +La configuration à la charge de l'établissement est contenue dans les fichiers `local.dist` contenu dans le répertoire +`./config/autoload`. +Ces configurations doivent être adaptées aux besoins spécifiques de l'établissement, et l'extension `.dist` doit être +retirée. + +Liste des fichiers distants : + +- `database.local.php.dist` +- `local.php.dist` +- `synchro.local.php` +- `unicaen-app.local.php.dist` +- `unicaen-authentification.local.php.dist` +- `unicaen-evenement.local.php.dist` +- `unicaen-fichier.local.php.dist` +- `unicaen-ldap.local.php.dist` +- `unicaen-mail.local.php.dist` + +## Installation sur le serveur + +Lancez la commande suivante pour exécuter le processus d'installation : + +```bash +./vendor/bin/laminas bddadmin:install +``` + +Après l'installation, vérifiez que les données ont été correctement insérées par la mise à jour. + +## Création des répertoires nécessaires + +Créez les répertoires suivants si ce n'est pas déjà fait : + +```bash +mkdir -p ./data/DoctrineORMModule/Proxy +mkdir -p ./upload +``` + +Assurez-vous que ces répertoires ont les permissions appropriées. + +## Configuration des paramètres PHP + +Vérifiez que les paramètres suivants dans PHP sont correctement configurés à 0 : + + session.cookie_lifetime + session.gc_maxlifetime + +Pour vérifier, consultez la configuration PHP : + +php -i | grep session.cookie_lifetime +php -i | grep session.gc_maxlifetime + +Modification des paramètres + +Si les valeurs ne sont pas correctes, modifiez le fichier /etc/php/8.2/fpm/php.ini et assurez-vous que les lignes +suivantes sont définies : + +session.cookie_lifetime = 0 +session.gc_maxlifetime = 0 + +Redémarrez le service PHP-FPM pour appliquer les modifications : + +systemctl restart php-fpm + +## Mise en place de la synchronisation et execution de celle-ci + +Configurez le fichier de synchronisation selon les besoins du projet et les fichiers de base de données sources comme +décrit dans [la documentation sur les connecteurs](connecteurs.md). +Pour lancer la synchronisation suivez les dernières étapes de la documentation associée. diff --git a/module/Agent/config/merged/agent-quotite.config.php b/module/Agent/config/merged/agent-quotite.config.php deleted file mode 100644 index 86595034308b7c607bbd0f5b2a8d44fb0eaaad2b..0000000000000000000000000000000000000000 --- a/module/Agent/config/merged/agent-quotite.config.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Agent; - -use Agent\Service\AgentQuotite\AgentQuotiteService; -use Agent\Service\AgentQuotite\AgentQuotiteServiceFactory; - -return [ - - 'service_manager' => [ - 'factories' => [ - AgentQuotiteService::class => AgentQuotiteServiceFactory::class, - ], - ], - 'controllers' => [ - 'factories' => [ - ], - ], - 'form_elements' => [ - 'factories' => [ - ], - ], - 'hydrators' => [ - 'factories' => [ - ], - ], - 'view_helpers' => [ - 'invokables' => [ - ], - ], - -]; diff --git a/module/Agent/src/Entity/Db/Agent.php b/module/Agent/src/Entity/Db/Agent.php index 5a94523d35721f6ef084c40156b6138aa82be09c..1b53e8b1230144367592fcb84d803578ce30cefe 100644 --- a/module/Agent/src/Entity/Db/Agent.php +++ b/module/Agent/src/Entity/Db/Agent.php @@ -54,9 +54,7 @@ class Agent implements private ?string $email = null; private Collection $affectations; - private Collection $echelons; private Collection $grades; - private Collection $quotites; private Collection $statuts; private Collection $validateurs; @@ -78,7 +76,6 @@ class Agent implements $this->statuts = new ArrayCollection(); $this->missionsSpecifiques = new ArrayCollection(); $this->fichiers = new ArrayCollection(); - $this->echelons = new ArrayCollection(); $this->grades = new ArrayCollection(); $this->structuresForcees = new ArrayCollection(); @@ -200,30 +197,6 @@ class Agent implements return $libelle; } - /** @return AgentEchelon[] */ - public function getEchelons(?DateTime $date = null, bool $histo = false): array - { - $echelons = $this->echelons->toArray(); - if ($histo === false) $echelons = array_filter($echelons, function (AgentEchelon $ae) { - return !$ae->isDeleted(); - }); - if ($date !== null) $echelons = array_filter($echelons, function (AgentEchelon $ae) use ($date) { - return ($ae->estEnCours($date)); - }); - - usort($echelons, function (AgentEchelon $a, AgentEchelon $b) { - return $a->getDateDebut() <=> $b->getDateDebut(); - }); - return $echelons; - } - - /** @return AgentEchelon[] */ - public function getEchelonsActifs(?DateTime $date = null): array - { - if ($date === null) $date = (new DateTime()); - return $this->getEchelons($date); - } - /** @return AgentGrade[] */ public function getGrades(?DateTime $date = null, bool $histo = false): array { @@ -248,30 +221,6 @@ class Agent implements return $this->getGrades($date); } - /** @return AgentQuotite[] */ - public function getQuotites(?DateTime $date = null, bool $histo = false): array - { - $quotites = $this->quotites->toArray(); - if ($histo === false) $quotites = array_filter($quotites, function (AgentQuotite $q) { - return !$q->isDeleted(); - }); - if ($date !== null) $quotites = array_filter($quotites, function (AgentQuotite $q) use ($date) { - return ($q->estEnCours($date)); - }); - - usort($quotites, function (AgentQuotite $a, AgentQuotite $b) { - return $a->getDateDebut() <=> $b->getDateDebut(); - }); - return $quotites; - } - - /** @return AgentQuotite[] */ - public function getQuotitesActives(?DateTime $date = null): array - { - if ($date === null) $date = (new DateTime()); - return $this->getQuotites($date); - } - /** @return AgentStatut[] */ public function getStatuts(?DateTime $date = null, bool $histo = false): array { diff --git a/module/Agent/src/Entity/Db/AgentEchelon.php b/module/Agent/src/Entity/Db/AgentEchelon.php deleted file mode 100644 index f0eb4e3ce3e799592622b8d50ffaa4d84cf7c949..0000000000000000000000000000000000000000 --- a/module/Agent/src/Entity/Db/AgentEchelon.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Agent\Entity\Db; - -use Application\Entity\Db\Interfaces\HasPeriodeInterface; -use Application\Entity\Db\Traits\HasPeriodeTrait; -use UnicaenSynchro\Entity\Db\IsSynchronisableInterface; -use UnicaenSynchro\Entity\Db\IsSynchronisableTrait; - -class AgentEchelon implements HasPeriodeInterface, IsSynchronisableInterface -{ - use IsSynchronisableTrait; - use HasPeriodeTrait; - - private ?string $id = null; - private ?Agent $agent = null; - private ?int $echelon = null; - - public function getId(): ?string - { - return $this->id; - } - - public function getAgent(): ?Agent - { - return $this->agent; - } - - public function getEchelon(): ?int - { - return $this->echelon; - } - -} \ No newline at end of file diff --git a/module/Agent/src/Entity/Db/AgentQuotite.php b/module/Agent/src/Entity/Db/AgentQuotite.php deleted file mode 100644 index 6c95f2acb249e448ba2c4a26c9808492def8aa3d..0000000000000000000000000000000000000000 --- a/module/Agent/src/Entity/Db/AgentQuotite.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Agent\Entity\Db; - -use Application\Entity\Db\Interfaces\HasPeriodeInterface; -use Application\Entity\Db\Traits\HasPeriodeTrait; -use UnicaenSynchro\Entity\Db\IsSynchronisableInterface; -use UnicaenSynchro\Entity\Db\IsSynchronisableTrait; - -class AgentQuotite implements HasPeriodeInterface, IsSynchronisableInterface -{ - use HasPeriodeTrait; - use IsSynchronisableTrait; - - private ?string $id = null; - private ?Agent $agent = null; - private ?int $quotite = null; - private ?string $modaliteDeService = null; - - public function getId(): ?string - { - return $this->id; - } - - public function getAgent(): Agent - { - return $this->agent; - } - - public function setAgent(Agent $agent): AgentQuotite - { - $this->agent = $agent; - return $this; - } - - public function getQuotite(): ?int - { - return $this->quotite; - } - - public function setQuotite(?int $quotite): void - { - $this->quotite = $quotite; - } - - public function getModaliteDeService(): ?string - { - return $this->modaliteDeService; - } - -} \ No newline at end of file diff --git a/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.Agent.dcm.xml b/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.Agent.dcm.xml index 5787ae2fb8e5ca1c9da7e6e3efa379d263118f8e..0fd68513453eb8558fb04b3c9fc865fa1674ec3e 100644 --- a/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.Agent.dcm.xml +++ b/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.Agent.dcm.xml @@ -15,9 +15,7 @@ <field name="login" column="login" length="256"/> <field name="email" column="email" length="1024"/> - <one-to-many target-entity="Agent\Entity\Db\AgentQuotite" mapped-by="agent" field="quotites"/> <one-to-many target-entity="Agent\Entity\Db\AgentAffectation" mapped-by="agent" field="affectations"/> - <one-to-many target-entity="Agent\Entity\Db\AgentEchelon" mapped-by="agent" field="echelons"/> <one-to-many target-entity="Agent\Entity\Db\AgentGrade" mapped-by="agent" field="grades"/> <one-to-many target-entity="Agent\Entity\Db\AgentStatut" mapped-by="agent" field="statuts"/> <one-to-many field="validateurs" target-entity="Agent\Entity\Db\AgentValidateur" mapped-by="agent"/> diff --git a/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.AgentEchelon.dcm.xml b/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.AgentEchelon.dcm.xml deleted file mode 100644 index 3269d0c309544eaf7d8509ec63a64ac925ceed53..0000000000000000000000000000000000000000 --- a/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.AgentEchelon.dcm.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - <entity name="Agent\Entity\Db\AgentEchelon" table="agent_carriere_echelon"> - - <id name="id" type="string" column="id"/> - - <many-to-one target-entity="Agent\Entity\Db\Agent" field="agent"> - <join-column name="agent_id" referenced-column-name="c_individu"/> - </many-to-one> - - <field name="echelon" type="integer" column="echelon"/> - <field name="dateDebut" type="datetime" column="d_debut"/> - <field name="dateFin" type="datetime" column="d_fin" nullable="true"/> - - <!-- DB IMPORT ############################# --> - <field name="createdOn" column="created_on" type="datetime"/> - <field name="updatedOn" column="updated_on" type="datetime"/> - <field name="deletedOn" column="deleted_on" type="datetime"/> - <field name="sourceId" column="source_id" length="128"/> - - </entity> -</doctrine-mapping> diff --git a/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.AgentQuotite.dcm.xml b/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.AgentQuotite.dcm.xml deleted file mode 100644 index 461e78943b62473f0e1cec9ef8b1661648629bb9..0000000000000000000000000000000000000000 --- a/module/Agent/src/Entity/Db/Mapping/Agent.Entity.Db.AgentQuotite.dcm.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - <entity name="Agent\Entity\Db\AgentQuotite" table="agent_carriere_quotite"> - - <id name="id" type="string" column="id"/> - - <many-to-one target-entity="Agent\Entity\Db\Agent" field="agent"> - <join-column name="agent_id" referenced-column-name="c_individu"/> - </many-to-one> - - <field name="dateDebut" type="datetime" column="d_debut"/> - <field name="dateFin" type="datetime" column="d_fin"/> - <field name="quotite" type="integer" column="quotite"/> - <field name="modaliteDeService" length="1024" column="modalite_de_service"/> - - <!-- DB IMPORT ############################# --> - <field name="createdOn" column="created_on" type="datetime"/> - <field name="updatedOn" column="updated_on" type="datetime"/> - <field name="deletedOn" column="deleted_on" type="datetime"/> - <field name="sourceId" column="source_id" length="128"/> - - </entity> -</doctrine-mapping> diff --git a/module/Agent/src/Service/Agent/AgentService.php b/module/Agent/src/Service/Agent/AgentService.php index ef739346f77330279d0b0fa856f0b2e4263f6a82..16c61927f790c8becf33ffb0d05c3caa3145722e 100644 --- a/module/Agent/src/Service/Agent/AgentService.php +++ b/module/Agent/src/Service/Agent/AgentService.php @@ -49,8 +49,6 @@ class AgentService //affectations ->addSelect('affectation')->leftJoin('agent.affectations', 'affectation') ->addSelect('affectation_structure')->leftJoin('affectation.structure', 'affectation_structure') - //quotite de l'agent - ->addSelect('quotite')->leftJoin('agent.quotites', 'quotite') ->addSelect('utilisateur')->leftJoin('agent.utilisateur', 'utilisateur') ->andWhere('agent.deletedOn IS NULL'); diff --git a/module/Agent/src/Service/AgentQuotite/AgentQuotiteService.php b/module/Agent/src/Service/AgentQuotite/AgentQuotiteService.php deleted file mode 100644 index 424622579da6c09b99dcefc736bed2f4b6388ac1..0000000000000000000000000000000000000000 --- a/module/Agent/src/Service/AgentQuotite/AgentQuotiteService.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Agent\Service\AgentQuotite; - -use Agent\Entity\Db\Agent; -use Agent\Entity\Db\AgentQuotite; -use Doctrine\ORM\QueryBuilder; -use DoctrineModule\Persistence\ProvidesObjectManager; - -class AgentQuotiteService -{ - use ProvidesObjectManager; - - /** GESTION ENTITE ************************************************************************************************/ - // Complétement importées et jamais modifiées - - /** REQUETAGE *****************************************************************************************************/ - - public function createQueryBuilder(): QueryBuilder - { - $qb = $this->getObjectManager()->getRepository(AgentQuotite::class)->createQueryBuilder('agentquotite') - ->join('agentquotite.agent', 'agent')->addSelect('agent') - ->andWhere('agentquotite.deletedOn IS NULL'); - return $qb; - } - - /** - * @param Agent $agent - * @param bool $actif - * @return array - */ - public function getAgentQuotitesByAgent(Agent $agent, bool $actif = true): array - { - $qb = $this->createQueryBuilder() - ->andWhere('agentquotite.agent = :agent') - ->andWhere('agentquotite.deletedOn IS NULL') - ->setParameter('agent', $agent); - - if ($actif === true) $qb = AgentQuotite::decorateWithActif($qb, 'agentquotite'); - - $result = $qb->getQuery()->getResult(); - return $result; - } - - -} \ No newline at end of file diff --git a/module/Agent/src/Service/AgentQuotite/AgentQuotiteServiceAwareTrait.php b/module/Agent/src/Service/AgentQuotite/AgentQuotiteServiceAwareTrait.php deleted file mode 100644 index 00edcd87bf576ad5a86d04b6832b14a989f548de..0000000000000000000000000000000000000000 --- a/module/Agent/src/Service/AgentQuotite/AgentQuotiteServiceAwareTrait.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Agent\Service\AgentQuotite; - -trait AgentQuotiteServiceAwareTrait { - - private AgentQuotiteService $agentQuotiteService; - - public function getAgentQuotiteService(): AgentQuotiteService - { - return $this->agentQuotiteService; - } - - public function setAgentQuotiteService(AgentQuotiteService $agentQuotiteService): void - { - $this->agentQuotiteService = $agentQuotiteService; - } - - -} \ No newline at end of file diff --git a/module/Agent/src/Service/AgentQuotite/AgentQuotiteServiceFactory.php b/module/Agent/src/Service/AgentQuotite/AgentQuotiteServiceFactory.php deleted file mode 100644 index 8f1865839e8c899d22542b552cc72a2a8b9aed94..0000000000000000000000000000000000000000 --- a/module/Agent/src/Service/AgentQuotite/AgentQuotiteServiceFactory.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Agent\Service\AgentQuotite; - -use Doctrine\ORM\EntityManager; -use Interop\Container\ContainerInterface; -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; - -class AgentQuotiteServiceFactory { - - /** - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface - */ - public function __invoke(ContainerInterface $container) : AgentQuotiteService - { - /** - * @var EntityManager $entityManager - */ - $entityManager = $container->get('doctrine.entitymanager.orm_default'); - - $service = new AgentQuotiteService(); - $service->setObjectManager($entityManager); - return $service; - } -} \ No newline at end of file diff --git a/module/Agent/src/View/Helper/partial/agent-grade.phtml b/module/Agent/src/View/Helper/partial/agent-grade.phtml index 4bec9d2483a3164d51a94fbda7a2701a59b8e89e..3d102784cfb369b1cb14d58d4cf65a85e35559de 100644 --- a/module/Agent/src/View/Helper/partial/agent-grade.phtml +++ b/module/Agent/src/View/Helper/partial/agent-grade.phtml @@ -8,13 +8,8 @@ */ use Agent\Entity\Db\AgentGrade; -use Agent\Entity\Db\AgentEchelon; -$debug = false; - -/** @var AgentEchelon[] $echelons */ -$echelons = ($options['echelons']) ?? []; -$echelons = array_filter($echelons, function (AgentEchelon $a) { return $a->getEchelon() !== 0 ;}); +$debug = false; //todo parametre !!! $displayStructure = (isset($options['structure']) and $options['structure'] !== false); $displayPeriode = (isset($options['periode']) and $options['periode'] !== false); @@ -103,15 +98,6 @@ $displayCorrespondance = (isset($options['correspondance']) and $options['corres <?php endif; ?> </dd> - <?php if (!empty($echelons)) : ?> - <dt class="col-md-3"> Échelon</dt> - <dd class="col-md-9"> - <?php foreach ($echelons as $echelon) : ?> - <?php echo $echelon->getEchelon(); ?> (date de passage : <?php echo $echelon->getDateDebut()->format('d/m/Y'); ?>) - <?php endforeach; ?> - </dd> - <?php endif; ?> - <dt class="col-md-3"> Emploi Type</dt> <dd class="col-md-9"> <?php if ($grade->getEmploiType()) : ?> diff --git a/module/Application/src/Application/Entity/Db/MacroContent/AgentMacroTrait.php b/module/Application/src/Application/Entity/Db/MacroContent/AgentMacroTrait.php index 41db5d4cfbe98ee6aad46335cb48321092d54e26..be9cddbf4c9590d528cfd0d6a0234c30c1f8dc17 100644 --- a/module/Application/src/Application/Entity/Db/MacroContent/AgentMacroTrait.php +++ b/module/Application/src/Application/Entity/Db/MacroContent/AgentMacroTrait.php @@ -2,8 +2,6 @@ namespace Application\Entity\Db\MacroContent; -use Agent\Entity\Db\AgentEchelon; -use Agent\Entity\Db\AgentQuotite; /** * Trait AgentMacroTrait @@ -138,31 +136,6 @@ trait AgentMacroTrait return $texte; } - public function toStringModaliteDeService() : string - { - $agent = $this; - $quotites = $agent->getQuotitesActives(); - if (empty($quotites)) { - $quotite = new AgentQuotite(); - $quotite->setAgent($agent); - $quotite->setQuotite(100); - $quotites[] = $quotite; - } - - $array = []; - foreach ($quotites as $quotite) { - $modalite = $quotite->getModaliteDeService(); - $pourcentage = $quotite->getQuotite()??100; - if ($modalite === null) { - $array[] = $pourcentage."% "; - } else { - $array[] = "$modalite (". $pourcentage. "%)"; - } - } - $texte = implode("<br>",$array); - return $texte; - } - public function toStringQuotiteAffectation() : string { $agent = $this; @@ -317,24 +290,6 @@ trait AgentMacroTrait return $this->toStringModaliteDeService(); } - public function toStringEchelon() : string - { - $agent = $this; - $echelons = $agent->getEchelonsActifs(); - - $texte = implode("<br>", array_map(function (AgentEchelon $a) { return $a->getEchelon();}, $echelons)); - return $texte; - } - - public function toStringEchelonPassage() : string - { - $agent = $this; - $echelons = $agent->getEchelonsActifs(); - - $texte = implode("<br>", array_map(function (AgentEchelon $a) { return $a->getDateDebutToString();}, $echelons)); - return $texte; - } - /** @noinspection PhpUnused */ public function getDateNaissanceAsString() : string { diff --git a/public/img/logo-universite.png b/public/img/logo-universite.png index a399add5324b2c393bb1e3d40e4d89fdfc63eaba..484c89e851839f33647ff63c8711b3cb249cb969 100644 Binary files a/public/img/logo-universite.png and b/public/img/logo-universite.png differ