Commit 79d469b5 authored by Thomas Hamel's avatar Thomas Hamel
Browse files

Thèse/HDR saisie dans SyGAL : Gestion de l'état de l'entité selon des règles spécifiques

parent a1bf7d9e
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ Journal des modifications
- Soutenance : déplacement sous "Soutenance" du menu "Dépôt du rapport" et renommage en "Accès rapide Rapporteur".
- Indicateur au format Thèse : inclusion de la colonne 'etat_these' et d'une colonne facultative 'extra'.
- Soutenance Thèse : ajout d'une alerte quand une association membre=>acteur est incorrecte en raison du rôle inadéquat de l'acteur.
- Thèse/HDR saisie dans SyGAL : Gestion de l'état de l'entité selon des règles spécifiques
- [FIX] Dépôt de thèse : plantage de la génération de la convention de mise en ligne.
- [FIX] Step-Star : prise en compte des thèses écartées dans le comptage des fichiers TEF générés.
- [FIX] Formation : plantage lors de l'ouverture de la page de modification d'une Formation.
+60 −0
Changes for doc/release-notes/v10/10.5.0/02_divers.sql: 60 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -93,3 +93,63 @@ where resume is not null
   or mots_cles_rameau is not null
order by id;


--
-- These saisie dans SyGAL / HDR
--

insert into unicaen_privilege_privilege(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
with d(ordre, code, lib) as (select 100,
                                    'gerer-dates-these',
                                    'Gérer la date d''abandon et de transfert d''une thèse')
select nextval('privilege_id_seq'), cp.id, d.code, d.lib, d.ordre
from d
         join unicaen_privilege_categorie cp on cp.CODE = 'these'
WHERE NOT EXISTS (SELECT 1
                  FROM unicaen_privilege_privilege p
                  WHERE p.CODE = d.code);

-- Ajout du privilège pour le Gestionnaire d'ED/Admin tech pour gérer la date d'abandon et de transfert d'une thèse
INSERT INTO PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID)
with data(categ, priv) as (select 'these', 'gerer-dates-these')
select p.id as PRIVILEGE_ID, profil.id as PROFIL_ID
from data
         join PROFIL on profil.ROLE_ID in (
                                           'GEST_ED',
                                           'BDD',
                                           'ADMIN_TECH'
    )
         join unicaen_privilege_categorie cp on cp.CODE = data.categ
         join unicaen_privilege_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);

-- Ajout du privilège pour le Gestionnaire HDR/Admin tech pour gérer la date d'abandon d'une HDR
insert into unicaen_privilege_privilege(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
with d(ordre, code, lib) as (select 100,
                                    'gerer-dates-hdr',
                                    'Gérer la date d''abandon d''une HDR')
select nextval('privilege_id_seq'), cp.id, d.code, d.lib, d.ordre
from d
         join unicaen_privilege_categorie cp on cp.CODE = 'hdr'
WHERE NOT EXISTS (SELECT 1
                  FROM unicaen_privilege_privilege p
                  WHERE p.CODE = d.code);

INSERT INTO PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID)
with data(categ, priv) as (select 'hdr', 'gerer-dates-hdr')
select p.id as PRIVILEGE_ID, profil.id as PROFIL_ID
from data
         join PROFIL on profil.ROLE_ID in (
                                           'HDR_GEST',
                                           'ADMIN_TECH'
    )
         join unicaen_privilege_categorie cp on cp.CODE = data.categ
         join unicaen_privilege_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 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)
 No newline at end of file
+4 −0
Changes for module/HDR/config/module.config.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@ use HDR\Controller\Factory\HDRRechercheControllerFactory;
use HDR\Controller\HDRController;
use HDR\Controller\HDRRechercheController;
use HDR\Provider\Privileges\HDRPrivileges;
use HDR\Rule\HDREtatRule;
use HDR\Rule\HDREtatRuleFactory;
use HDR\Service\HDRSearchService;
use HDR\Service\HDRSearchServiceFactory;
use HDR\Service\HDRService;
@@ -386,6 +388,8 @@ return [
            HDRService::class => HDRServiceFactory::class,
            HDRSearchService::class => HDRSearchServiceFactory::class,
            HDRAssertion::class => HDRAssertionFactory::class,

            HDREtatRule::class => HDREtatRuleFactory::class
        ],
    ],
    'view_manager' => [
+26 −0
Changes for module/HDR/config/others/hdr-saisie.config.php: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ use HDR\Fieldset\Generalites\GeneralitesHydrator;
use HDR\Fieldset\Generalites\GeneralitesHydratorFactory;
use HDR\Fieldset\Structures\StructuresFieldset;
use HDR\Fieldset\Structures\StructuresFieldsetFactory;
use HDR\Form\HDRDateMouvementsForm\HDRDateMouvementsForm;
use HDR\Form\HDRDateMouvementsForm\HDRDateMouvementsFormFactory;
use HDR\Form\HDRSaisie\HDRSaisieForm;
use HDR\Form\HDRSaisie\HDRSaisieFormFactory;
use HDR\Form\HDRSaisie\HDRSaisieHydrator;
@@ -34,6 +36,7 @@ return [
                        'privileges' => [
                            HDRPrivileges::HDR_MODIFICATION_SES_HDRS,
                            HDRPrivileges::HDR_MODIFICATION_TOUTES_HDRS,
                            HDRPrivileges::HDR_GERER_DATES_HDR,
                        ],
                        'resources' => ['HDR'],
                        'assertion' => HDRAssertion::class,
@@ -60,6 +63,17 @@ return [
                    'assertion' => HDRAssertion::class,
                    'resources' => ['HDR'],
                ],
                [
                    'controller' => HDRSaisieController::class,
                    'action' => [
                        'gestion-dates'
                    ],
                    'privileges' => [
                        HDRPrivileges::HDR_GERER_DATES_HDR,
                    ],
                    'assertion' => HDRAssertion::class,
                    'resources' => ['HDR'],
                ],
            ],
        ],
    ],
@@ -124,6 +138,16 @@ return [
                                    ],
                                ],
                            ],
                            'gestion-dates' => [
                                'type' => Literal::class,
                                'options' => [
                                    'route' => '/gestion-dates',
                                    'defaults' => [
                                        /** @see HDRSaisieController::gestionDatesAction() */
                                        'action' => 'gestion-dates',
                                    ],
                                ],
                            ],
                        ],
                    ],
                    'supprimer' => [
@@ -156,6 +180,8 @@ return [
            GeneralitesFieldset::class => GeneralitesFieldsetFactory::class,
            DirectionFieldset::class => DirectionFieldsetFactory::class,
            StructuresFieldset::class => StructuresFieldsetFactory::class,

            HDRDateMouvementsForm::class => HDRDateMouvementsFormFactory::class,
        ],
    ],
    'hydrators' => [
+2 −0
Changes for module/HDR/src/HDR/Assertion/HDRAssertion.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ class HDRAssertion extends AbstractAssertion
            case $privilege === HDRPrivileges::HDR_MODIFICATION_SES_HDRS || $privilege === HDRPrivileges::HDR_MODIFICATION_TOUTES_HDRS :
                if ($hdr->getEtatHDR() === HDR::ETAT_SOUTENUE || $hdr->getEtatHDR() === HDR::ETAT_ABANDONNEE) return false;
                return $this->userContextService->isStructureDuRoleRespecteeForHDR($this->hdr);
            case $privilege === HDRPrivileges::HDR_GERER_DATES_HDR :
                return $this->userContextService->isStructureDuRoleRespecteeForHDR($this->hdr);
        }

        return true;
Loading