Commit 8996cb84 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Netoyage

parent 436091dc
Loading
Loading
Loading
Loading
+134 −82
Original line number Diff line number Diff line
**CHANGES version 3.1.6**
===

-----------

**Changements**
Changements
---

* Début du remplacement du système de synchronisation 

@@ -40,9 +42,30 @@ return [
    ],
];
```
* Importation des postes

```php
/** @file config/autoload/import.local.php ajouter une nouvelle synchronisation **/
'AGENT_POSTE' => [
    'order' => 5500,
    'source' => 'OCTOPUS',
    'orm_source' => 'orm_octopus',
    'orm_destination' => 'orm_default',
    'table_source' => 'V_EMC2_POSTE',
    'table_destination' => 'agent_poste',
    'correspondance' => [
        'ID' => 'id',
        'AGENT_ID' => 'agent_id',
        'CODE_POSTE' => 'code_poste',
        'LIBELLE_POSTE' => 'intitule',
    ],
    'id' => 'ID',
],
```

* Simplification de la gestion des missions principales
* Correction du calcul des chaînes hiérarchiques
* Changement Système de routing des mails (et de la configuration associé)
* Changement système de routing des mails (et de la configuration associée)

```php
/** @see config/autoload/unicaen-mail.local.php **/
@@ -72,10 +95,93 @@ return [
```

----------------
Modification de la base de données
---
**Changement système de synchro et sunchro des postes**

```postgresql
-- --------------------------------------------------------------------------
-- MODIFICATION DES TALES SYNCHRONISER --------------------------------------
-- --------------------------------------------------------------------------
-- Source ID est maintenant une chaine de caractère plus facile à interpréter

alter table formation drop constraint formation_source_id_fk;
alter table formation alter column source_id type varchar(128);
alter table formation_groupe drop constraint formation_groupe_source_id_fk;
alter table formation_groupe alter column source_id type varchar(128);
alter table formation_seance drop constraint fformation_seance_source_id_fk;
alter table formation_seance alter column source_id type varchar(128);
alter table formation_presence drop constraint formation_presence_source_id_fk;
alter table formation_presence alter column source_id type varchar(128);
alter table formation_instance drop constraint formation_instance_source_id_fk;
alter table formation_instance alter column source_id type varchar(128);
alter table formation_instance_inscrit drop constraint formation_instance_inscrit_source_id_fk;
alter table formation_instance_inscrit alter column source_id type varchar(128);
alter table formation_instance_frais drop constraint formation_instance_frais_source_id_fk;
alter table formation_instance_frais alter column source_id type varchar(128);
alter table structure_responsable drop constraint structure_responsable_source_id_fk;
alter table structure_responsable alter column source_id type varchar(128);
alter table structure_gestionnaire drop constraint structure_gestionnaire_source_id_fk;
alter table structure_gestionnaire alter column source_id type varchar(128);
alter table carriere_correspondance_type  alter column source_id type varchar(128)
alter table carriere_correspondance  alter column source_id type varchar(128);
alter table carriere_corps  alter column source_id type varchar(128);
alter table carriere_grade  alter column source_id type varchar(128);
alter table structure_type  alter column source_id type varchar(128);
alter table structure  alter column source_id type varchar(128);
alter table structure_responsable  alter column source_id type varchar(128);
alter table structure_gestionnaire  alter column source_id type varchar(128);
alter table agent  alter column source_id type varchar(128);
alter table agent_carriere_affectation  alter column source_id type varchar(128);
alter table agent_carriere_echelon  alter column source_id type varchar(128);
alter table agent_carriere_grade  alter column source_id type varchar(128);
alter table agent_carriere_quotite  alter column source_id type varchar(128);
alter table agent_carriere_statut  alter column source_id type varchar(128);

alter table agent_carriere_affectation drop constraint agent_affectation_pk;
alter table agent_carriere_affectation add constraint agent_carriere_affectation_pk primary key (id);
alter table agent_carriere_affectation drop column affectation_id;


-- ----------------------------------------------------------
-- RETRAIT DES PRIVILEGE DE DB IMPORT DEVENU NON UTILISE
-- ----------------------------------------------------------

delete from unicaen_privilege_privilege p
where p.id in (
    select p.id
    from unicaen_privilege_privilege p
             join unicaen_privilege_categorie upc on p.categorie_id = upc.id
    where upc.code  like 'unicaen-db-import-%'
);

delete from unicaen_privilege_categorie upc
where upc.code  like 'unicaen-db-import-%';

-- -------------------------------------------------------------------------------
-- CHANGEMENT DE LA GESTION DES POSTES -------------------------------------------
-- -------------------------------------------------------------------------------

drop table ficheposte_poste;
create table agent_poste
(
    id         serial
        constraint agent_poste_pk primary key,
    agent_id   varchar(40)             not null
        constraint agent_poste_agent_c_individu_fk references agent,
    code_poste varchar(128)            not null,
    intitule   varchar(1024)           not null,
    created_on timestamp default now() not null,
    updated_on timestamp,
    deleted_on timestamp,
    source_id  varchar(128),
    id_source  varchar(256)
);
```
    
**Modification de la base de données**
**Simplification de la gesion des missions principales**

```sql
```postgresql
-- ----------------------------------------------------------------------------
-- NOUVEAUX PRIVILEGES (gestion des missions principales)
-- ----------------------------------------------------------------------------
@@ -291,7 +397,11 @@ drop table activite_formation;
drop table fichemetier_activite;
drop table ficheposte_activite_specifique;
drop table activite;
```

**Nettoyage** 

```postgresql
-- ------------------------------------------------------------------------------
-- NETTOYAGE DE CODE MORT -------------------------------------------------------
-- ------------------------------------------------------------------------------
@@ -301,92 +411,30 @@ delete from unicaen_privilege_privilege where code='formation_questionnaire_modi
delete from unicaen_privilege_privilege where code='formation_questionnaire_visualiser';
alter table formation_instance_inscrit drop column questionnaire_id;

-- -------------------------------------------------------------------------------
-- CHANGEMENT DE LA GESTION DES POSTES -------------------------------------------
-- -------------------------------------------------------------------------------
alter table formation drop column theme_id;
drop table formation_theme cascade;

drop table ficheposte_poste;
create table agent_poste
(
    id         serial
        constraint agent_poste_pk primary key,
    agent_id   varchar(40)             not null
        constraint agent_poste_agent_c_individu_fk references agent,
    code_poste varchar(128)            not null,
    intitule   varchar(1024)           not null,
    created_on timestamp default now() not null,
    updated_on timestamp,
    deleted_on timestamp,
    source_id  varchar(128),
    id_source  varchar(256)
);

-- -----------------------------------
-- ADAPTATION NOUVELLE SYNCHRO
-- ------------------------------------

alter table agent_carriere_affectation drop constraint agent_affectation_pk;
alter table agent_carriere_affectation add constraint agent_carriere_affectation_pk primary key (id);
alter table agent_carriere_affectation drop column affectation_id;
```

-- ----------------------------------------------------------
-- RETRAIT DES PRIVILEGE DE DB IMPORT DEVENU NON UTILISE
-- ----------------------------------------------------------
**Table associé à instadia**

delete from unicaen_privilege_privilege p
where p.id in (
    select p.id
    from unicaen_privilege_privilege p
    join unicaen_privilege_categorie upc on p.categorie_id = upc.id
    where upc.code  like 'unicaen-db-import-%'
```postgresql
create table public.unicaen_instadia
(
    id            serial                  constraint unicaen_instadia_pk primary key,
    user_id       integer                 not null constraint unicaen_instadia_redacteur_fk references public.unicaen_utilisateur_user,
    rubrique      varchar(80)             not null,
    sous_rubrique varchar(80),
    horodatage    timestamp default now() not null,
    contenu       text                    not null
);

delete from unicaen_privilege_categorie upc
where upc.code  like 'unicaen-db-import-%';

-- RETRAIT DES REF VERS L'ANCIEN DB IMPORT --

alter table formation drop constraint formation_source_id_fk;
alter table formation alter column source_id type varchar(128);
alter table formation_groupe drop constraint formation_groupe_source_id_fk;
alter table formation_groupe alter column source_id type varchar(128);
alter table formation_seance drop constraint fformation_seance_source_id_fk;
alter table formation_seance alter column source_id type varchar(128);
alter table formation_presence drop constraint formation_presence_source_id_fk;
alter table formation_presence alter column source_id type varchar(128);
alter table formation_instance drop constraint formation_instance_source_id_fk;
alter table formation_instance alter column source_id type varchar(128);
alter table formation_instance_inscrit drop constraint formation_instance_inscrit_source_id_fk;
alter table formation_instance_inscrit alter column source_id type varchar(128);
alter table formation_instance_frais drop constraint formation_instance_frais_source_id_fk;
alter table formation_instance_frais alter column source_id type varchar(128);

alter table structure_responsable drop constraint structure_responsable_source_id_fk;
alter table structure_responsable alter column source_id type varchar(128);
alter table structure_gestionnaire drop constraint structure_gestionnaire_source_id_fk;
alter table structure_gestionnaire alter column source_id type varchar(128);

alter table formation drop column theme_id;
drop table formation_theme cascade;

alter table carriere_correspondance_type  alter column source_id type varchar(128)
alter table carriere_correspondance  alter column source_id type varchar(128);
alter table carriere_corps  alter column source_id type varchar(128);
alter table carriere_grade  alter column source_id type varchar(128);
alter table structure_type  alter column source_id type varchar(128);
alter table structure  alter column source_id type varchar(128);
alter table structure_responsable  alter column source_id type varchar(128);
alter table structure_gestionnaire  alter column source_id type varchar(128);
alter table agent  alter column source_id type varchar(128);
alter table agent_carriere_affectation  alter column source_id type varchar(128);
alter table agent_carriere_echelon  alter column source_id type varchar(128);
alter table agent_carriere_grade  alter column source_id type varchar(128);
alter table agent_carriere_quotite  alter column source_id type varchar(128);
alter table agent_carriere_statut  alter column source_id type varchar(128);
```
-------------

**Mise à jours de bibliothèque**
Mise à jours de bibliothèque
---

```bash
composer update unicaen/renderer
@@ -395,4 +443,8 @@ composer update unicaen/authentification
composer update unicaen/mail
composer remove unicaen/octopus
composer remove unicaen/db-import

## Instalation de UnicaenInstadia 
composer require unicaen/instadia
cp vendor/unicaen/instadia public/unicaen
```
 No newline at end of file