Commit 5ca59185 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Mise à jour des notes de versions

parent bb148dcc
Loading
Loading
Loading
Loading
+4 −0
Changes for CHANGELOG.md: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,10 @@ auquel cas elle est redemandée à l'utilisateur.
Idem pour les attestations et le privilège "Modification des attestations concernant la version corrigée".
- Masquage du complément de financement dans la fiche d'identité de la thèse
- Optimisation de l'export CSV des thèses
- Pages de téléversement et de recherche des rapports annuels.
- Correction d'un bug dans la recherche de thèses par nom du doctorant.
- Possibilité d'attribuer un "identifiant permanent" à un fichier (ex: 'RAPPORT_ANNUEL_MODELE') facilitant l'intégration
  de lien de téléchargement de ce fichier dans une page.

1.4.6 (29/05/2020)
------------------
+96 −1
Changes for doc/release-notes/v1.4.7.md: 96 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -16,9 +16,104 @@ bash ./install.sh

## 2. Dans la base de données

- Exécutez les instructions SQL suivantes :
- Exécutez les instructions SQL suivantes une à une :

```sql
alter table ATTESTATION add CREATION_AUTO number(1) default 0 not null ;
alter table DIFFUSION add CREATION_AUTO number(1) default 0 not null ;

insert into NATURE_FICHIER (ID, CODE, LIBELLE)
    select NATURE_FICHIER_ID_SEQ.nextval, 'RAPPORT_ANNUEL', 'Rapport annuel' from dual ;

alter table CATEGORIE_PRIVILEGE rename constraint SYS_C0061037 to CATEGORIE_PRIVILEGE_PK; -- pas grave si échoue

create sequence categorie_privilege_id_seq start with 3000;

insert into CATEGORIE_PRIVILEGE(ID, CODE, LIBELLE, ORDRE)
    select categorie_privilege_id_seq.nextval, 'rapport-annuel', 'Rapport annuel', 25 from dual ; -- si échoue, retenter jusqu'au succès

insert into PRIVILEGE(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
    select privilege_id_seq.nextval, cp.id, 'consulter', 'Consulter les rapports annuels d''une thèse', 250
    from CATEGORIE_PRIVILEGE cp
    where cp.CODE = 'rapport-annuel';
insert into PRIVILEGE(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
    select privilege_id_seq.nextval, cp.id, 'televerser', 'Téléverser un rapport annuel de thèse', 300
    from CATEGORIE_PRIVILEGE cp
    where cp.CODE = 'rapport-annuel';
insert into PRIVILEGE(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
    select privilege_id_seq.nextval, cp.id, 'supprimer', 'Supprimer un rapport annuel de thèse', 350
    from CATEGORIE_PRIVILEGE cp
    where cp.CODE = 'rapport-annuel';
insert into PRIVILEGE(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
    select privilege_id_seq.nextval, cp.id, 'telecharger', 'Télécharger un rapport annuel de thèse', 400
    from CATEGORIE_PRIVILEGE cp
    where cp.CODE = 'rapport-annuel';
insert into PRIVILEGE(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
    select privilege_id_seq.nextval, cp.id, 'telecharger-zip', 'Télécharger des rapports annuels de thèse sous la forme d''une archive compressée (.zip)', 410
    from CATEGORIE_PRIVILEGE cp
    where cp.CODE = 'rapport-annuel';
insert into PRIVILEGE(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
    select privilege_id_seq.nextval, cp.id, 'rechercher', 'Rechercher des rapports annuels de thèse', 500
    from CATEGORIE_PRIVILEGE cp
    where cp.CODE = 'rapport-annuel';
--
-- ATTENTION >>> Dans l'interface graphique, accorder ces nouveaux privilèges aux profils voulus (a minima Doctorant et AdminTech).
--

create table RAPPORT_ANNUEL (
    ID NUMBER not null constraint RAPPORT_ANNUEL_PK primary key,
    THESE_ID NUMBER not null constraint RAPPORT_ANNUEL_THESE_FK references THESE on delete cascade,
    FICHIER_ID NUMBER not null constraint RAPPORT_ANNUEL_FICHIER_FK references FICHIER on delete cascade,
    ANNEE_UNIV smallint not null,
    EST_FINAL NUMBER(1) default 0 not null,

    HISTO_CREATEUR_ID     NUMBER not null constraint RAPPORT_ANNUEL_HC_FK references UTILISATEUR on delete cascade,
    HISTO_MODIFICATEUR_ID NUMBER constraint RAPPORT_ANNUEL_HM_FK references UTILISATEUR on delete cascade,
    HISTO_DESTRUCTEUR_ID  NUMBER constraint RAPPORT_ANNUEL_HD_FK references UTILISATEUR on delete cascade,
    HISTO_CREATION     DATE default SYSDATE not null,
    HISTO_MODIFICATION DATE,
    HISTO_DESTRUCTION  DATE
);

create sequence RAPPORT_ANNUEL_ID_SEQ;

alter table FICHIER add PERMANENT_ID varchar2(50) ;
create unique index FICHIER_PERMANENT_ID_UINDEX on FICHIER (PERMANENT_ID) ;


drop materialized view MV_RECHERCHE_THESE;
create materialized view MV_RECHERCHE_THESE
    refresh force on demand
as
with acteurs as (
    select a.these_id, i.nom_usuel, INDIVIDU_ID
    from individu i
             join acteur a on i.id = a.individu_id
             join these t on t.id = a.these_id
             join role r on a.role_id = r.id and r.CODE in ('D', 'K') -- (co)directeur de thèse
)
select
    t.source_code code_these,
    d.source_code code_doctorant,
    ed.source_code code_ecole_doct,
    trim(UNICAEN_ORACLE.str_reduce(
                'code-ed{' || eds.code || '} ' ||
                'code-ur{' || urs.code || '} ' ||
                'titre{' || t.TITRE || '} ' ||
                'doctorant-numero{' || substr(d.SOURCE_CODE, instr(d.SOURCE_CODE, '::')+2) || '} ' ||
                'doctorant-nom{' || id.NOM_PATRONYMIQUE || ' ' || id.NOM_USUEL || '} ' ||
                'doctorant-prenom{' || id.PRENOM1 || '} ' ||
                'directeur-nom{' || a.nom_usuel || '} '
        )) as haystack
from these t
         join doctorant d on d.id = t.doctorant_id
         join individu id on id.id = d.INDIVIDU_ID
         join these th on th.source_code = t.source_code
         left join ecole_doct ed on t.ecole_doct_id = ed.id
         left join structure eds on ed.STRUCTURE_ID = eds.id
         left join UNITE_RECH ur on t.UNITE_RECH_ID = ur.id
         left join structure urs on ur.STRUCTURE_ID = urs.id
         left join acteurs a on a.these_id = t.id
         left join individu ia on ia.id = a.INDIVIDU_ID
;
```