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

WIP

parent 0ea7fc30
Loading
Loading
Loading
Loading
+4 −4
Changes for composer.lock: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "382de094158d4975677bb012c913b745",
    "content-hash": "0fe6b5e477209b3175466316b64e568b",
    "packages": [
        {
            "name": "apereo/phpcas",
@@ -12415,11 +12415,11 @@
        },
        {
            "name": "unicaen/multipage-form",
            "version": "2.1.0",
            "version": "2.1.1",
            "source": {
                "type": "git",
                "url": "https://git.unicaen.fr/lib/unicaen/multipage-form.git",
                "reference": "7c9162b42f27f5547106c0d5449898bac4cf3475"
                "reference": "9e2273b2d50256e9d4855df89a71d3ef1540032b"
            },
            "require": {
                "laminas/laminas-config": "^3.9",
@@ -12445,7 +12445,7 @@
                ]
            },
            "description": "Gestion de formulaire multi-page",
            "time": "2025-11-17T15:01:06+00:00"
            "time": "2026-02-05T15:44:45+00:00"
        },
        {
            "name": "unicaen/parametre",
+122 −7
Changes for doc/release-notes/v11/11.0.0/01_admission.sql: 122 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,30 @@
alter table admission_inscription
    alter column discipline_doctorat type varchar(100) using discipline_doctorat::varchar(100);

alter table admission_type_validation
    alter column code type varchar(128) using code::varchar(128);

----------------

update unicaen_avis_valeur set valeur = 'Avis négatif' where code = 'AVIS_ADMISSION_VALEUR_NEGATIF';

update admission_type_validation set code = 'ATTESTATION_HONNEUR_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT',
                                     libelle = 'Attestation par l''étudiant de la bonne lecture de sa charte du doctorat et de la convention de formation doctorale'
                                 where code = 'ATTESTATION_HONNEUR_CHARTE_DOCTORALE';
UPDATE admission_type_validation SET code = 'ATTESTATION_HONNEUR_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT_DIR_THESE',
                                     libelle = 'Attestation par la direction de thèse de la bonne lecture de la charte du doctorat et de la convention de formation doctorale'
                                 WHERE code = 'VALIDATION_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT_DIR_THESE';
UPDATE admission_type_validation SET code = 'ATTESTATION_HONNEUR_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT_CODIR_THESE',
                                     libelle = 'Attestation par la co-direction de thèse de la bonne lecture de la charte du doctorat et de la convention de formation doctorale'
                                 WHERE code = 'VALIDATION_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT_CODIR_THESE';
UPDATE admission_type_validation SET code = 'ATTESTATION_HONNEUR_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT_DIR_UR',
                                     libelle = 'Attestation par la direction de l''unité de recherche de la bonne lecture de la charte du doctorat et de la convention de formation doctorale'
                                 WHERE code = 'VALIDATION_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT_DIR_UR';
UPDATE admission_type_validation SET code = 'ATTESTATION_HONNEUR_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT_DIR_ED',
                                     libelle = 'Attestation par la direction de l''école doctorale de la bonne lecture de la charte du doctorat et de la convention de formation doctorale'
                                 WHERE code = 'VALIDATION_CHARTE_DOCTORAT_ET_CONVENTION_FORMATION_DOCT_DIR_ED';


-------------------------------------------------- Avis Administratif -------------------------------------------------
-- Nouveau type d'avis
insert into unicaen_avis_type (code, libelle, description, ordre)
@@ -79,9 +103,6 @@ update admission_financement set est_salarie = false where est_salarie is null;

----------------------

alter table admission_type_validation
    alter column code type varchar(100) using code::varchar(100);

update admission_type_validation set libelle = 'Attestation par l''étudiant de la charte doctorale'
                                 where code = 'ATTESTATION_HONNEUR_CHARTE_DOCTORALE';

@@ -98,7 +119,6 @@ UPDATE admission_type_validation SET code = 'VALIDATION_CHARTE_DOCTORAT_ET_CONVE
                                     libelle = 'Validation de la charte du doctorat et de la convention de formation doctorale par la direction de l''école doctorale'
                                 WHERE code = 'VALIDATION_CONVENTION_FORMATION_DOCT_DIR_ED';


----------------------

drop function privilege__grant_privilege_to_profile;
@@ -138,9 +158,7 @@ create procedure privilege__grant_privileges_to_profiles(categorycode character
as
$$declare
    v_priv_code varchar;
    v_priv unicaen_privilege_privilege;
    v_prof_role_id varchar;
    v_prof profil;
BEGIN
    -- création des 'profil_privilege' :
    foreach v_priv_code in ARRAY privilegecodes loop
@@ -168,6 +186,59 @@ BEGIN
END;
$$;

create procedure privilege__grant_privilege_to_role(categorycode character varying, privilegecode character varying, rolecode character varying)
    language plpgsql
as
$$
BEGIN
    if not exists (select from unicaen_privilege_privilege p
                                   join unicaen_privilege_categorie c on p.categorie_id = c.id and c.code = categorycode
                   where p.code = privilegecode) then
        raise exception '[ERROR] Privilège ''%'' introuvable dans la catégorie ''%''.', privilegecode, categorycode;
    end if;
    if not exists (select from role where code = rolecode) then
        raise exception '[ERROR] Role introuvable avec le code ''%''.', rolecode;
    end if;

    insert into role_privilege (role_id, privilege_id)
    select r.id, p.id
    from role r, unicaen_privilege_privilege p, unicaen_privilege_categorie c
    where r.code = rolecode
      and p.code = privilegecode and c.code = categorycode and p.categorie_id = c.id ;
END;
$$;

create procedure privilege__grant_privileges_to_roles(categorycode character varying, privilegecodes character varying[], rolecodes character varying[])
    language plpgsql
as
$$declare
    v_priv_code varchar;
    v_role_code varchar;
BEGIN
    foreach v_priv_code in ARRAY privilegecodes loop
            if not exists (select from unicaen_privilege_privilege p
                                           join unicaen_privilege_categorie c on p.categorie_id = c.id and c.code = categorycode
                           where p.code = v_priv_code) then
                raise exception '[ERROR] Privilège ''%'' introuvable dans la catégorie ''%''.', v_priv_code, categorycode;
            end if;
            foreach v_role_code in ARRAY rolecodes loop
                    if not exists (select from role where code = v_role_code) then
                        raise exception '[ERROR] Role introuvable avec le code ''%''.', v_role_code;
                    end if;

                    insert into role_privilege (role_id, privilege_id)
                    select r.id, p.id
                    from role r, unicaen_privilege_privilege p, unicaen_privilege_categorie c
                    where r.code = v_role_code
                      and p.code = v_priv_code and c.code = categorycode and p.categorie_id = c.id
                    on conflict do nothing;
                end loop;
        end loop;
END;
$$;

-------------------

WITH d(code, lib, ordre) AS (
    select 'admission-charte-doctorat-visualiser', 'Visualiser la charte du doctorat du dossier d''admission', 100 union
    select 'admission-charte-doctorat-generer', 'Générer la charte du doctorat du dossier d''admission', 110 union
@@ -187,13 +258,37 @@ call privilege__grant_privileges_to_profiles(
call privilege__grant_privileges_to_profiles(
        'admission',
        ARRAY['admission-charte-doctorat-signee-televerser'],
        ARRAY['ADMIN_TECH', 'DOCTORANT', 'GEST_ED', 'RESP_ED']
        ARRAY['ADMIN_TECH', 'GEST_ED', 'RESP_ED',
            'DOCTORANT', 'D', 'K']
     );
call privilege__grant_privileges_to_profiles(
        'admission',
        ARRAY['admission-charte-doctorat-visualiser'],
        ARRAY['ADMIN_TECH', 'GEST_ED', 'RESP_ED', 'GEST_UR', 'RESP_UR',
            'DOCTORANT', 'D', 'K']
     );
call privilege__grant_privileges_to_roles(
        'admission',
        ARRAY['admission-charte-doctorat-generer', 'admission-charte-doctorat-visualiser', 'admission-charte-doctorat-signee-televerser'],
        ARRAY['ADMISSION_CANDIDAT', 'ADMISSION_DIRECTEUR_THESE', 'ADMISSION_CODIRECTEUR_THESE']
     );

delete from unicaen_privilege_privilege
       where code = 'admission-notifier-dossier-incomplet'
         and categorie_id = (select id from unicaen_privilege_categorie where code = 'admission');

update unicaen_privilege_privilege
set code = 'admission-convention-formation-signee-televerser',
    libelle = 'Téléverser la convention de formation doctorale signée'
       where code = 'admission-convention-formation-modifier'
         and categorie_id = (select id from unicaen_privilege_categorie where code = 'admission');

call privilege__grant_privileges_to_profiles(
        'admission',
        ARRAY['admission-convention-formation-signee-televerser'],
        ARRAY['ADMIN_TECH', 'DOCTORANT', 'GEST_ED', 'RESP_ED']
     );

---------

INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, namespace, engine,
@@ -1046,3 +1141,23 @@ update unicaen_renderer_template set document_css = e'
        font-size: 9px;
    }'
where code = 'ADMISSION_CHARTE_DOCTORAT';

-------------

-- INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#AdmissionSignature', '<p>Url de l''étape Validations/Signatures du dossier d''admission d''un étudiant</p>', 'Url', 'getAdmissionSignature');

-- UPDATE unicaen_renderer_template SET document_corps = e'<p>Bonjour,</p>
-- <p>Ceci est un mail envoyé automatiquement par l\'application ESUP-SyGAL.</p>
-- <p>L\'<strong>VAR[AdmissionOperation#LibelleType]</strong> du <strong>dossier d\'admission</strong> de <strong>VAR[Individu#Denomination]</strong> datant du VAR[AdmissionAvis#Date] a été <strong>supprimé </strong>VAR[AdmissionAvis#Destructeur]</p>
-- <p>Afin de suivre l\'avancée du dossier, connectez-vous sur la plateforme ESUP-SyGAL via le lien suivant : VAR[Url#AdmissionSignature]</p>'
-- WHERE code = 'ADMISSION_AVIS_SUPPRIME';
-- UPDATE unicaen_renderer_template SET document_corps = e'<p>Bonjour,</p>
-- <p>Ceci est un mail envoyé automatiquement par l\'application ESUP-SyGAL.</p>
-- <p>L\'<strong>VAR[AdmissionOperation#LibelleType]</strong> du <strong>dossier d\'admission</strong> de <strong>VAR[Individu#Denomination]</strong> datant du VAR[AdmissionAvis#Date] a été modifié<strong> </strong>VAR[AdmissionAvis#Modificateur]</p>
-- <p>Afin de suivre l\'avancée du dossier, connectez-vous sur la plateforme ESUP-SyGAL via le lien suivant : VAR[Url#AdmissionSignature]</p>'
-- WHERE code = 'ADMISSION_AVIS_MODIFIE';
-- UPDATE unicaen_renderer_template SET document_corps = e'<p>Bonjour,</p>
-- <p>Ceci est un mail envoyé automatiquement par l\'application ESUP-SyGAL.</p>
-- <p>Un avis a été ajouté au <strong>dossier d\'admission</strong> de <strong>VAR[Individu#Denomination]</strong> par VAR[AdmissionAvis#Auteur], le VAR[AdmissionAvis#Date]</p>
-- <p>Afin de suivre l\'avancée du dossier, connectez-vous sur la plateforme ESUP-SyGAL via le lien suivant : VAR[Url#AdmissionSignature]</p>'
-- WHERE code = 'ADMISSION_AVIS_AJOUTE';
+3 −22
Changes for module/Admission/config/module.config.php: 3 added lines, 22 removed lines.
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ use Admission\Service\Admission\AdmissionService;
use Admission\Service\Admission\AdmissionServiceFactory;
use Admission\Service\Document\DocumentService;
use Admission\Service\Document\DocumentServiceFactory;
use Admission\Service\Etat\EtatService;
use Admission\Service\Etat\EtatServiceFactory;
use Admission\Service\Etudiant\EtudiantService;
use Admission\Service\Etudiant\EtudiantServiceFactory;
use Admission\Service\Exporter\Admission\AdmissionExporter;
@@ -68,8 +70,6 @@ use Admission\Service\Url\UrlService;
use Admission\Service\Url\UrlServiceFactory;
use Admission\Service\Verification\VerificationService;
use Admission\Service\Verification\VerificationServiceFactory;
use Admission\Validator\Inscription\EtablissementInscriptionValidator;
use Admission\Validator\Inscription\EtablissementInscriptionValidatorFactory;
use Application\Navigation\ApplicationNavigationFactory;
use Doctrine\ORM\Mapping\Driver\XmlDriver;
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
@@ -258,20 +258,6 @@ return array(
                            ],
                        ],
                    ],
                    'notifier-dossier-incomplet' => [
                        'type' => Segment::class,
                        'options' => [
                            'route' => '/notifier-dossier-incomplet/:admission',
                            'constraints' => [
                                'admission' => '[0-9]*'
                            ],
                            'defaults' => [
                                'controller' => AdmissionController::class,
                                'action' => 'notifier-dossier-incomplet',
                                /* @see AdmissionController::notifierDossierIncompletAction() */
                            ],
                        ],
                    ],
                    'generer-recapitulatif' => [
                        'type'  => Segment::class,
                        'may_terminate' => true,
@@ -438,6 +424,7 @@ return array(
    'service_manager' => [
        'factories' => [
            AdmissionService::class => AdmissionServiceFactory::class,
            EtatService::class => EtatServiceFactory::class,
            FinancementService::class => FinancementServiceFactory::class,
            EtudiantService::class => EtudiantServiceFactory::class,
            InscriptionService::class => InscriptionServiceFactory::class,
@@ -459,12 +446,6 @@ return array(
        ],
    ],

    'validators' => [
        'factories' => [
            EtablissementInscriptionValidator::class => EtablissementInscriptionValidatorFactory::class,
        ],
    ],

    'view_manager' => [
        'template_path_stack' => [
            __DIR__ . '/../view',
+16 −0
Changes for module/Admission/config/others/charte.config.php: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -11,9 +11,25 @@ use Admission\Service\Exporter\CharteDoctorat\CharteDoctoratExporter;
use Admission\Service\Exporter\CharteDoctorat\CharteDoctoratExporterFactory;
use Laminas\Router\Http\Segment;
use UnicaenPrivilege\Guard\PrivilegeController;
use UnicaenPrivilege\Provider\Rule\PrivilegeRuleProvider;

return [
    'bjyauthorize' => [
        'rule_providers'     => [
            PrivilegeRuleProvider::class => [
                'allow' => [
                    [
                        'privileges' => [
                            AdmissionPrivileges::ADMISSION_CHARTE_DOCTORAT_GENERER,
                            AdmissionPrivileges::ADMISSION_CHARTE_DOCTORAT_SIGNEE_TELEVERSER,
                            AdmissionPrivileges::ADMISSION_CHARTE_DOCTORAT_VISUALISER,
                        ],
                        'resources'  => ['Admission'],
                        'assertion'  => CharteDoctoratAssertion::class,
                    ],
                ],
            ],
        ],
        'guards' => [
            PrivilegeController::class => [
                [
+2 −46
Changes for module/Admission/config/others/convention.config.php: 2 added lines, 46 removed lines.
Original line number Diff line number Diff line
@@ -6,8 +6,6 @@ use Admission\Assertion\ConventionFormationDoctorale\ConventionFormationDoctoral
use Admission\Assertion\ConventionFormationDoctorale\ConventionFormationDoctoraleAssertionFactory;
use Admission\Controller\ConventionFormationDoctorale\ConventionFormationDoctoraleController;
use Admission\Controller\ConventionFormationDoctorale\ConventionFormationDoctoraleControllerFactory;
use Admission\Form\ConventionFormationDoctorale\ConventionFormationDoctoraleForm;
use Admission\Form\ConventionFormationDoctorale\ConventionFormationDoctoraleFormFactory;
use Admission\Hydrator\ConventionFormationDoctorale\ConventionFormationDoctoraleHydrator;
use Admission\Hydrator\ConventionFormationDoctorale\ConventionFormationDoctoraleHydratorFactory;
use Admission\Provider\Privilege\AdmissionPrivileges;
@@ -31,9 +29,9 @@ return array(
                'allow' => [
                    [
                        'privileges' => [
                            AdmissionPrivileges::ADMISSION_CONVENTION_FORMATION_MODIFIER,
                            AdmissionPrivileges::ADMISSION_CONVENTION_FORMATION_VISUALISER,
                            AdmissionPrivileges::ADMISSION_CONVENTION_FORMATION_GENERER,
                            AdmissionPrivileges::ADMISSION_CONVENTION_FORMATION_SIGNEE_TELEVERSER,
                            AdmissionPrivileges::ADMISSION_CONVENTION_FORMATION_VISUALISER,
                        ],
                        'resources' => ['ConventionFormationDoctorale'],
                        'assertion' => ConventionFormationDoctoraleAssertion::class,
@@ -43,18 +41,6 @@ return array(
        ],
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => ConventionFormationDoctoraleController::class,
                    'action' => [
                        'modifier-convention-formation',
                        'ajouter-convention-formation',
                    ],
                    'privileges' => [
                        AdmissionPrivileges::ADMISSION_CONVENTION_FORMATION_MODIFIER,
                        AdmissionPrivileges::ADMISSION_CONVENTION_FORMATION_VISUALISER,
                    ],
                    'assertion' => ConventionFormationDoctoraleAssertion::class,
                ],
                [
                    'controller' => ConventionFormationDoctoraleController::class,
                    'action' => [
@@ -84,30 +70,6 @@ return array(
                            ],
                        ],
                    ],
                    'ajouter-convention-formation' => [
                        'type'  => Segment::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/convention-formation/ajouter/:admission',
                            'defaults' => [
                                'controller' => ConventionFormationDoctoraleController::class,
                                'action'     => 'ajouter-convention-formation',
                                /* @see ConventionFormationDoctoraleController::ajouterConventionFormationAction() */
                            ],
                        ],
                    ],
                    'modifier-convention-formation' => [
                        'type'  => Segment::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/convention-formation/modifier/:admission',
                            'defaults' => [
                                'controller' => ConventionFormationDoctoraleController::class,
                                'action'     => 'modifier-convention-formation',
                                /* @see ConventionFormationDoctoraleController::modifierConventionFormationAction() */
                            ],
                        ],
                    ],
                ]
            ]
        ]
@@ -119,12 +81,6 @@ return array(
        ],
    ],

    'form_elements' => [
        'factories' => [
            ConventionFormationDoctoraleForm::class => ConventionFormationDoctoraleFormFactory::class
        ],
    ],

    'service_manager' => [
        'factories' => [
            ConventionFormationDoctoraleService::class => ConventionFormationDoctoraleServiceFactory::class,
Loading