Commit 6528f595 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'release_6.0.3'

parents 6c874f46 ce927c43
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
Journal des modifications
=========================

6.0.3
-----
- [FIX] Signature de méthode setObject() modifiée en PHP8 dans Doctrine\Laminas\Hydrator\Strategy\AbstractCollectionStrategy.
- [FIX] Page de couverture : utilisation de mb_strtoupper pour mettre les noms en majuscules même si elles sont accentuées.
- [FIX] Rapports CSI : les filtres de recherche Etablissement, ED et UR ne tenaient pas compte des substitutions de structures.
- [FIX] Le menu 'Mes thèses' incluait les thèses historisées.
- Annuaire des thèses : nouveau filtre de recherche 'Année de financement'.
- Mise en place d'une zone de dépot du pv de soutenance sur la page de présoutenance
- Rapport d'activité : implémentation pour les rapports de fin de contrat du même circuit de validation/avis que les annuels.
- Affichage du nom complet d'un individu : choc de simplification en supprimant 2 options d'affichage dans le formatteur.
- Rapport activité : augmentation à 10 min du timeout CSRF dans le formulaire de création/modification.
- Possibilité de déclarer des missions d'enseignement
- Les avis de soutenance deviennent des FichierThese afin de pouvoir être afficher sur la page des fichiers divers
- Possibilité de saisir l'établissement du co-encadrant (si différent de l'établissement d'inscription)
- Validation du rapport d'activité par le doctorant : avertissement indiquant que le rapport n'est plus modifiable après validation.

6.0.2
-----
- [SQL] Amélioration des libellés des 2 paramètres du module Rapport d'activité.
+3 −4
Original line number Diff line number Diff line
@@ -41,8 +41,6 @@
        "twig/twig": "^3.0",
        "webmozart/assert": "^1.3",

        "unicaen/pdf": "5.0.1",

        "unicaen/alerte": "^2.0",
        "unicaen/app": "^6.0",
        "unicaen/auth": "^6.0",
@@ -56,7 +54,7 @@
        "unicaen/livelog": "^2.0",
        "unicaen/parametre": "^6.0",
        "unicaen/renderer": "^6.0",
        "unicaen/pdf": "dev-bg-php8"
        "unicaen/pdf": "^6.0"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
@@ -95,7 +93,8 @@
            "mkdir -p public/unicaen && cp -r vendor/unicaen/app/public/unicaen public/",
            "mkdir -p public/unicaen && cp -r vendor/unicaen/db-import/public/unicaen public/",
            "mkdir -p public/unicaen && cp -r vendor/unicaen/idref/public/unicaen public/",
            "mkdir -p vendor/mpdf/mpdf/ttfontdata && chmod -R 777 vendor/mpdf/mpdf/ttfontdata"
            "mkdir -p vendor/mpdf/mpdf/ttfontdata && chmod -R 777 vendor/mpdf/mpdf/ttfontdata",
            "rm -rf data/cache/*"
        ]
    },
    "config": {
+246 −338

File changed.

Preview size limit exceeded, changes collapsed.

+145 −0
Original line number Diff line number Diff line
# Version 6.0.3

## 1. Sur le serveur d'application

*Rappel : depuis la version 6.0.0, la version de PHP requise est la 8.0.*

- Placez-vous dans le répertoire de l'application puis lancez la commande suivante
  pour installer la nouvelle version :

```bash
git fetch --tags && git checkout --force 6.0.3 && bash ./install.sh
```

- Rechargez le moteur PHP, exemple :

```bash
systemctl reload php8.0-fpm
```

## 2. Dans la base de données

```postgresql

-- creation de la table de stockage
create table doctorant_mission_enseignement
(
    id                    serial                  not null
        constraint doctorant_mission_enseignement_pk
            primary key,
    doctorant_id          integer                 not null
        constraint doctorant_mission_enseignement_doctorant_id_fk
            references doctorant
            on delete cascade,
    annee_univ            integer                 not null,
    histo_creation        timestamp default now() not null,
    histo_createur_id     integer   default 1     not null
        constraint doctorant_mission_enseignement_utilisateur_id_fk
            references utilisateur,
    histo_modification    timestamp,
    histo_modificateur_id integer
        constraint doctorant_mission_enseignement_utilisateur_id_fk2
            references utilisateur,
    histo_destruction     timestamp,
    histo_destructeur_id  integer
        constraint doctorant_mission_enseignement_utilisateur_id_fk3
            references utilisateur
);

-- Ajout des privilèges
insert into categorie_privilege (code, libelle, ordre) values ('missionenseignement', 'Gestion des missions d''enseignement', 1000);
INSERT INTO privilege (categorie_id, code, libelle, ordre)
WITH d(code, lib, ordre) AS (
    SELECT 'missionenseignement_visualiser', 'Visualiser les missions d''enseignement', 10 UNION
    SELECT 'missionenseignement_modifier', 'Ajouter/Retirer des missions d''enseignement', 20
)
SELECT cp.id, d.code, d.lib, d.ordre
FROM d
JOIN categorie_privilege cp ON cp.CODE = 'missionenseignement'
;

-- Affectation aux profils

INSERT INTO PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID)
with data(categ, priv) as (
  select 'missionenseignement', 'missionenseignement_visualiser' 
)
select p.id as PRIVILEGE_ID, profil.id as PROFIL_ID
from data
       join PROFIL on profil.ROLE_ID in ('ADMIN_TECH', 'GEST_FORMATION', 'BDD', 'DOCTORANT', 'D', 'K', 'ADMIN', 'OBSERV', 'OBSERVATOIRE')
       join CATEGORIE_PRIVILEGE cp on cp.CODE = data.categ
       join PRIVILEGE p on p.CATEGORIE_ID = cp.id and p.code = data.priv
where not exists (
  select * from PROFIL_PRIVILEGE where PRIVILEGE_ID = p.id and PROFIL_ID = profil.id
) ;

INSERT INTO PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID)
with data(categ, priv) as (
  select 'missionenseignement', 'missionenseignement_modifier'
)
select p.id as PRIVILEGE_ID, profil.id as PROFIL_ID
from data
       join PROFIL on profil.ROLE_ID in ('ADMIN_TECH', 'GEST_FORMATION', 'BDD', 'ADMIN')
       join CATEGORIE_PRIVILEGE cp on cp.CODE = data.categ
       join PRIVILEGE p on p.CATEGORIE_ID = cp.id and p.code = data.priv
where not exists (
  select * from PROFIL_PRIVILEGE where PRIVILEGE_ID = p.id and PROFIL_ID = profil.id
) ;

-- Rebascule des privilèges depuis les profils vers les roles


insert into ROLE_PRIVILEGE (ROLE_ID, PRIVILEGE_ID)
select p2r.ROLE_ID, pp.PRIVILEGE_ID
from PROFIL_TO_ROLE p2r
       join profil pr on pr.id = p2r.PROFIL_ID
       join PROFIL_PRIVILEGE pp on pp.PROFIL_ID = pr.id
where not exists (
  select * from role_privilege where role_id = p2r.role_id and privilege_id = pp.privilege_id
)
;

delete from profil_privilege pp1
where exists (
  select *
  from profil_privilege pp
         join profil on pp.profil_id = profil.id and role_id in ('RESP_ED', 'GEST_ED')
         join privilege p on pp.privilege_id = p.id
  where p.code in ('valider-sien', 'valider-tout', 'devalider-sien', 'devalider-tout')
    and pp.profil_id = pp1.profil_id and pp.privilege_id = pp1.privilege_id
);

delete from ROLE_PRIVILEGE rp
where not exists (
  select *
  from PROFIL_TO_ROLE p2r
         join PROFIL_PRIVILEGE pp on pp.PROFIL_ID = p2r.PROFIL_ID
  where rp.role_id = p2r.role_id and rp.privilege_id = pp.privilege_id
);

---------------------------------------------------------
-- Les avis deviennent des FichierThese                --
---------------------------------------------------------

-- ajout de la colonne qui recevra le FichierThese à la place du Fichier
alter table soutenance_avis add fichierthese_id integer;
alter table soutenance_avis add constraint soutenance_avis_fichier_these_id_fk foreign key (fichierthese_id) references fichier_these;

-- ajout de la sequence sur la colonne id de la table
--create sequence fichier_these_id_seq;
alter table fichier_these alter column id set default nextval('fichier_these_id_seq');
alter sequence fichier_these_id_seq owned by fichier_these.id;
alter sequence fichier_these_id_seq restart with 200000;

-- creation des FichierThese pour les Avis existant
insert into fichier_these (fichier_id, these_id, est_conforme, retraitement)
select sa.fichier_id, sp.these_id, false, false  from soutenance_avis sa
                                                        join soutenance_proposition sp on sa.proposition_id = sp.id;
-- ajout dans la table soutenance_avis
update soutenance_avis as sa set fichierthese_id = ft.id
from fichier_these ft
where ft.fichier_id = sa.fichier_id and sa.fichierthese_id is null;

-- drop colonne devenu inutile ( /!\ après avoir vérifier /!\ )
alter table soutenance_avis drop column fichier_id;
```
 No newline at end of file
+19 −36
Original line number Diff line number Diff line
@@ -2,11 +2,11 @@

namespace Application\Filter;

use Application\Entity\Db\Utilisateur;
use Doctorant\Entity\Db\Doctorant;
use Individu\Entity\Db\Individu;
use Laminas\Filter\AbstractFilter;
use UnicaenApp\Entity\Ldap\People;
use Application\Entity\Db\Utilisateur;

/**
 * Formatte le nom complet d'un individu (nom usuel, patronymique, etc.)
@@ -15,13 +15,11 @@ use Application\Entity\Db\Utilisateur;
 */
class NomCompletFormatter extends AbstractFilter
{
    protected $nomEnMajuscule = true;
    protected $avecCivilite   = false;
    protected $avecNomPatro   = false;
    protected $prenomDabord   = false;
    protected $tousLesPrenoms = false;
    protected $court = false;
    protected $patroPlutotQueUsuel = false;
    protected bool $nomEnMajuscule = true;
    protected bool $avecCivilite   = false;
    protected bool $avecNomPatro   = false;
    protected bool $prenomDabord   = false;
    protected bool $tousLesPrenoms = false;

    /**
     * Constructeur.
@@ -32,15 +30,18 @@ class NomCompletFormatter extends AbstractFilter
     * @param bool $prenomDabord
     * @param bool $tousLesPrenoms
     */
    public function __construct($nomEnMajuscule = true, $avecCivilite = false, $avecNomPatro = false, $prenomDabord = false, $tousLesPrenoms = false, $court = false, $patroPlutotQueUsuel=false)
    public function __construct(
        bool $nomEnMajuscule = true,
        bool $avecCivilite = false,
        bool $avecNomPatro = false,
        bool $prenomDabord = false,
        bool $tousLesPrenoms = false)
    {
        $this->nomEnMajuscule       = $nomEnMajuscule;
        $this->avecCivilite         = $avecCivilite;
        $this->avecNomPatro         = $avecNomPatro;
        $this->prenomDabord         = $prenomDabord;
        $this->tousLesPrenoms       = $tousLesPrenoms;
        $this->court                = $court;
        $this->patroPlutotQueUsuel  = $patroPlutotQueUsuel;
    }

    /**
@@ -48,9 +49,8 @@ class NomCompletFormatter extends AbstractFilter
     *
     * @param  mixed $value
     * @throws \RuntimeException If filtering $value is impossible
     * @return mixed
     */
    public function filter($value)
    public function filter($value): string
    {
        // normalisation
        if ($value instanceof Individu) {
@@ -113,32 +113,15 @@ class NomCompletFormatter extends AbstractFilter
        $nomPatro = ucfirst($this->nomEnMajuscule ? mb_strtoupper($nomPatro) : $nomPatro);
        $civilite = $this->avecCivilite ? $civilite : null;

        if ($this->patroPlutotQueUsuel && $nomPatro != '') {
            $parts = [
                $civilite,
                $this->prenomDabord ? "$prenom $nomPatro" : "$nomPatro $prenom",
            ];
        } else {
        $parts = [
            $civilite,
            $this->prenomDabord ? "$prenom $nomUsuel" : "$nomUsuel $prenom",
        ];
        }

        $result = implode(' ', array_filter($parts));

        if (! $this->patroPlutotQueUsuel) {
        if ($this->avecNomPatro && $nomPatro !== $nomUsuel) {
                if ($this->court) {
                    $result = "";
                    if ($this->avecCivilite) $result .= "$civilite";
                    if ($this->prenomDabord) $result .= " $prenom";
                    $result .= " $nomPatro-$nomUsuel";
                    if (!$this->prenomDabord) $result .= " $prenom";
                } else {
                    $result .= ", née $nomPatro";
                }
            }
            $result .= ", né·e $nomPatro";
        }

	    return $result;
Loading