Commit be197528 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

WIP Saisie infos de base cotutelle

parent 2614b821
Loading
Loading
Loading
Loading
+1 −1
Changes for composer.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@
            "Substitution\\": "module/Substitution/src",
            "SygalApi\\": "vendor/unicaen/sygal-api/src",
            "These\\": "module/These/src",
            "UnicaenAvis\\": "module/UnicaenAvis/src",
            "TheseCotutelle\\": "module/TheseCotutelle/src",
            "Validation\\": "module/Validation/src",
            "Tx\\": "module/Tx/src"
        },
+1 −0
Changes for config/application.config.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ return [
        'Structure',
        'Acteur',
        'These',
        'TheseCotutelle',
        'Fichier',
        'Import',
        'Indicateur',
+242 −0
Changes for doc/release-notes/v14/14.0.0/01_these_cotutelle.sql: 242 added lines, 0 removed lines.
Original line number Diff line number Diff line

select etab_cotut_id, pays_cotut_id, lib_etab_cotut, lib_pays_cotut from these where id=67573;
select id, these.etablissement_id, etab_cotut_id, pays_cotut_id, lib_etab_cotut, lib_pays_cotut from these where etab_cotut_id is not null and histo_destruction is null;
select id, these.etablissement_id, etab_cotut_id, pays_cotut_id, lib_etab_cotut, lib_pays_cotut from these where pays_cotut_id is null and lib_etab_cotut is not null and histo_destruction is null;
select id, these.etablissement_id, etab_cotut_id, pays_cotut_id, lib_etab_cotut, lib_pays_cotut from these where lib_etab_cotut is not null and histo_destruction is null;

select id, these.doctorant_id, etab_cotut_id, pays_cotut_id, lib_etab_cotut, lib_pays_cotut from these where id=82213;
select id, etab_cotut_id, pays_cotut_id, lib_etab_cotut, lib_pays_cotut from these where id=82213;
select * from these_cotutelle where these_id=82213;

/*
drop table these_cotutelle_fichier;
drop table these_cotutelle_avenant;
drop table these_cotutelle_presence;
drop table these_cotutelle;
drop table these_cotutelle_motif_fin;
drop type these_cotutelle_etat_enum;
*/

-- alter table these drop column etab_cotut_id;

create type these_cotutelle_etat_enum as enum (
    'En cours de négociation',
    'En cours de signature',
    'Signé',
    'Projet abandonné');

create table these_cotutelle_motif_fin
(
    id      bigserial
        constraint these_cotutelle_motif_fin_pkey
            primary key,

    code    varchar(64) not null unique,
    libelle varchar(128) not null,
    ordre smallint default 1 not null
);

create table these_cotutelle
(
    id                    bigserial
        constraint these_cotutelle_pkey
            primary key,

    these_id              bigint                                                       not null
        constraint these_cotutelle_these_fk
            references these,

    etablissement_id      bigint
        constraint these_cotutelle_etab_id_fk
            references etablissement,

    motif_fin_cotutelle_id     bigint
        constraint these_cotutelle_motif_fin_id_fk
            references these_cotutelle_motif_fin,

    date_debut            date                                                         not null,
    date_fin              date                                                         not null,
    date_signature        date,
    etat_administratif    these_cotutelle_etat_enum                                    not null,
    --soutenance_dans_etablissement_etranger bool default false not null,
    commentaire           text,

    histo_createur_id     bigint                                                       not null
        constraint these_cotutelle_hc_fk
            references utilisateur,
    histo_creation        timestamp default ('now'::text)::timestamp without time zone not null,
    histo_modificateur_id bigint
        constraint these_cotutelle_hm_fk
            references utilisateur,
    histo_modification    timestamp,
    histo_destructeur_id  bigint
        constraint these_cotutelle_hd_fk
            references utilisateur,
    histo_destruction     timestamp
);

create table these_cotutelle_fichier
(
    id                    bigserial
        constraint these_cotutelle_fichier_pkey
            primary key,

    these_cotutelle_id    bigint                                                       not null
        constraint these_cotutelle_fichier_cotutelle_fk
            references these_cotutelle,

    fichier_id            bigint                                                       not null
        constraint these_cotutelle_fichier_fichier_fk
            references fichier,

    histo_createur_id     bigint                                                       not null
        constraint these_cotutelle_fichier_hc_fk
            references utilisateur,
    histo_creation        timestamp default ('now'::text)::timestamp without time zone not null,
    histo_modificateur_id bigint
        constraint these_cotutelle_fichier_hm_fk
            references utilisateur,
    histo_modification    timestamp,
    histo_destructeur_id  bigint
        constraint these_cotutelle_fichier_hd_fk
            references utilisateur,
    histo_destruction     timestamp
);

create table these_cotutelle_avenant
(
    id                          bigserial
        constraint these_cotutelle_avenant_pkey
            primary key,

    these_cotutelle_id          bigint                                                       not null
        constraint these_cotutelle_avenant_cotutelle_fk
            references these_cotutelle,

    modifie_date_fin_cotutelle  boolean   default false                                      not null,
    nouvelle_date_fin_cotutelle date,

    -- document correspondant à l'avenant
    -- (si le dépôt de plusieurs fichiers devient nécessaire pour un même avenant, cf. table commentée ci-dessous)
    fichier_id                  bigint                                                       not null
        constraint these_cotutelle_avenant_fichier_fichier_fk
            references fichier,

    histo_createur_id           bigint                                                       not null
        constraint these_cotutelle_avenant_hc_fk
            references utilisateur,
    histo_creation              timestamp default ('now'::text)::timestamp without time zone not null,
    histo_modificateur_id       bigint
        constraint these_cotutelle_avenant_hm_fk
            references utilisateur,
    histo_modification          timestamp,
    histo_destructeur_id        bigint
        constraint these_cotutelle_avenant_hd_fk
            references utilisateur,
    histo_destruction           timestamp
);
/*
create table these_cotutelle_avenant_fichier
(
    id                         bigserial
        constraint these_cotutelle_avenant_fichier_pkey
            primary key,

    these_cotutelle_avenant_id bigint                                                       not null
        constraint these_cotutelle_avenant_fichier_avenant_fk
            references these_cotutelle_avenant,

    fichier_id                 bigint                                                       not null
        constraint these_cotutelle_avenant_fichier_fichier_fk
            references fichier,

    histo_createur_id          bigint                                                       not null
        constraint these_cotutelle_avenant_fichier_hc_fk
            references utilisateur,
    histo_creation             timestamp default ('now'::text)::timestamp without time zone not null,
    histo_modificateur_id      bigint
        constraint these_cotutelle_avenant_fichier_hm_fk
            references utilisateur,
    histo_modification         timestamp,
    histo_destructeur_id       bigint
        constraint these_cotutelle_avenant_fichier_hd_fk
            references utilisateur,
    histo_destruction          timestamp
);
*/


create table these_cotutelle_presence
(
    id                         bigserial
        constraint these_cotutelle_presence_pkey
            primary key,

    these_cotutelle_id         bigint                                                       not null
        constraint these_cotutelle_presence_cotutelle_fk
            references these_cotutelle,

    etablissement_id           bigint
        constraint these_cotutelle_presence_etab_id_fk
            references etablissement,

    date_debut                 date                                                         not null,
    date_fin                   date                                                         not null,

    justif_presence_fichier_id bigint                                                       not null
        constraint these_cotutelle_presence_justif_presence_fichier_fk
            references fichier,

    histo_createur_id          bigint                                                       not null
        constraint these_cotutelle_presence_hc_fk
            references utilisateur,
    histo_creation             timestamp default ('now'::text)::timestamp without time zone not null,
    histo_modificateur_id      bigint
        constraint these_cotutelle_presence_hm_fk
            references utilisateur,
    histo_modification         timestamp,
    histo_destructeur_id       bigint
        constraint these_cotutelle_presence_hd_fk
            references utilisateur,
    histo_destruction          timestamp
);


insert into these_cotutelle_motif_fin(ordre, code, libelle)
select 10, 'non_reinsc_etranger', 'Non réinscription dans l''établissement étranger' union
select 20, 'non_reinsc_francais', 'Non réinscription ds l''établissement français' union
select 30, 'abandon', 'Abandon de la cotutelle' union
select 40, 'sans_financement', 'Sans financement' union
select 50, 'non_respect_convention', 'Non-respect des clauses de la convention (à préciser dans les commentaires, svp)' union
select 90, 'autre', 'Autres (à préciser dans les commentaires, svp)'
;


insert into unicaen_privilege_categorie(id, code, libelle)
select nextval('categorie_privilege_id_seq'), 'these-cotutelle', 'Cotutelle de thèse';


insert into unicaen_privilege_privilege(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
with d(ordre, code, lib) as (
    select 10, 'consulter-toutes', 'Consulter une cotutelle sur n''importe quelle thèse' union
    select 20, 'consulter-miennes', 'Consulter une cotutelle sur une thèse me concernant' union
    select 30, 'ajouter-toutes', 'Ajouter une cotutelle sur n''importe quelle thèse' union
    select 40, 'ajouter-miennes', 'Ajouter une cotutelle sur une thèse me concernant' union
    select 30, 'modifier-toutes', 'Modifier une cotutelle sur n''importe quelle thèse' union
    select 40, 'modifier-miennes', 'Modifier une cotutelle sur une thèse me concernant' union
    select 50, 'supprimer-toutes', 'Supprimer une cotutelle sur n''importe quelle thèse' union
    select 60, 'supprimer-miennes', 'Supprimer une cotutelle sur une thèse me concernant'
)
select nextval('privilege_id_seq'), cp.id, d.code, d.lib, d.ordre
from d join unicaen_privilege_categorie cp on cp.CODE = 'these-cotutelle'
;

call privilege__grant_privileges_to_profiles('these-cotutelle',
                                             ARRAY['consulter-toutes', 'ajouter-toutes', 'modifier-toutes', 'supprimer-toutes'],
                                             ARRAY['ADMIN_TECH', 'BDD']);
call privilege__grant_privileges_to_profiles('these-cotutelle',
                                             ARRAY['consulter-miennes', 'ajouter-miennes', 'modifier-miennes', 'supprimer-miennes'],
                                             ARRAY['GEST_ED']);
call privilege__grant_privileges_to_profiles('these-cotutelle',
                                             ARRAY['consulter-miennes'],
                                             ARRAY['DOCTORANT']);
+17 −0
Changes for doc/release-notes/v14/v14.0.0.md: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
Version 14.0.0
==============

## 1. Dans la base de données

- Exécutez dans l'ordre les scripts SQL présents dans le répertoire correspondant à la présente version.

## 2. Sur le serveur d'application

- 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 14.0.0 && bash ./install.sh
  ```

NB : Pas grave si le message "[ERROR] Aucune donnée dans le cache pour la clé 'privileges_roles' !" apparaît.
+3 −1
Changes for module/Application/src/Application/Assertion/Exception/FailedAssertionException.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@

namespace Application\Assertion\Exception;

class FailedAssertionException extends \DomainException
use Exception;

class FailedAssertionException extends Exception
{

}
 No newline at end of file
Loading