Commit 28303e2f authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

CRUD des formations, sessions

parent 4cbc7e8d
Loading
Loading
Loading
Loading
+13
Changes for module/Application/src/Application/Service/Etablissement/EtablissementService.php: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -178,4 +178,17 @@ class EtablissementService extends BaseService
            throw new RuntimeException("Erreur lors de l'enregistrement de l'Etablissement", null, $e);
        }
    }

    /**
     * @return array
     */
    public function getEtablissementInscriptionAsOption() : array
    {
        $etablissements = $this->getRepository()->findAllEtablissementsInscriptions();
        $array = [];
        foreach ($etablissements as $etablissement) {
            $array[$etablissement->getId()] = $etablissement->getLibelle();
        }
        return $array;
    }
}
 No newline at end of file
+15
Changes for module/Application/src/Application/Service/Structure/StructureService.php: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -963,4 +963,19 @@ class StructureService extends BaseService
        $structure = $this->getRepository()->find($id);
        return $structure;
    }

    public function getStructuresFormationsAsOptions()
    {
        $ecoles = $this->getEcoleDoctoraleService()->getRepository()->findAll(true);
        $etablissements = $this->getEtablissementService()->getRepository()->findAllEtablissementsInscriptions();
        //$unites = $this->getUnitesRechercheService()->getRepository()->findAll(true);
        $structures = array_merge($ecoles, $etablissements);
        $array = [];
        foreach ($structures as $structure) {
            if (!$structure->getStructure()->isFerme()) {
                $array[$structure->getStructure()->getId()] = (($structure->getStructure()->getTypeStructure())?$structure->getStructure()->getTypeStructure()->getLibelle():"Non précisé"). " - ".$structure->getSigle(). " - " .$structure->getLibelle();
            }
        }
        return $array;
    }
}
 No newline at end of file
+24
Changes for module/Formation/SQL/001_table.sql: 24 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,7 +21,14 @@ create table FORMATION_SESSION
(
    id number not null constraint formation_instance_pk primary key,
    formation_id integer not null constraint session_id_fk references formation on delete cascade,
    responsable_id integer not null constraint session_responsable_fk references utilisateur,
    modalite varchar2(1),
    etat varchar2(1),
    type varchar2(1),
    type_structure_id integer constraint session_type_structure_fk references structure on delete set null,
    description clob,
    taille_liste_principale integer,
    taille_liste_complementaire integer,
    histo_creation timestamp not null,
    histo_createur_id integer not null constraint session_createur_fk references utilisateur,
    histo_modification timestamp,
@@ -50,6 +57,23 @@ create table formation_seance
);
create sequence FORMATION_SEANCE_ID_SEQ;

-- INSCRIPTION ---------------------------------------------------------------------------------------------------------

create table formation_inscription
(
    id number not null constraint formation_inscription_pk primary key,
    session_id integer not null constraint formation_session_fk references formation_session on delete cascade,
    individu_id integer not null constraint formation_individu_fk references individu on delete cascade,
    liste varchar2(1),
    description clob,
    histo_creation timestamp not null,
    histo_createur_id integer not null constraint inscription_createur_fk references utilisateur,
    histo_modification timestamp,
    histo_modificateur_id integer constraint inscription_modificateur_fk references utilisateur,
    histo_destruction timestamp,
    histo_destructeur_id integer constraint inscription_destructeur_fk references utilisateur
);
create sequence FORMATION_INSCRIPTION_ID_SEQ;


+58 −2
Changes for module/Formation/config/others/formation.config.php: 58 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@ namespace Formation;

use Formation\Controller\FormationController;
use Formation\Controller\FormationControllerFactory;
use Formation\Form\Formation\FormationForm;
use Formation\Form\Formation\FormationFormFactory;
use Formation\Form\Formation\FormationHydrator;
use Formation\Form\Formation\FormationHydratorFactory;
use Formation\Provider\Privilege\IndexPrivileges;
use Formation\Service\Formation\FormationService;
use Formation\Service\Formation\FormationServiceFactory;
@@ -20,6 +24,10 @@ return [
                    'action' => [
                        'index',
                        'ajouter',
                        'modifier',
                        'historiser',
                        'restaurer',
                        'supprimer',
                    ],
                    'privileges' => [
                        IndexPrivileges::INDEX_AFFICHER,
@@ -74,6 +82,50 @@ return [
                                    ],
                                ],
                            ],
                            'modifier' => [
                                'type'  => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route'    => '/modifier/:formation',
                                    'defaults' => [
                                        'controller' => FormationController::class,
                                        'action'     => 'modifier',
                                    ],
                                ],
                            ],
                            'historiser' => [
                                'type'  => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route'    => '/historiser/:formation',
                                    'defaults' => [
                                        'controller' => FormationController::class,
                                        'action'     => 'historiser',
                                    ],
                                ],
                            ],
                            'restaurer' => [
                                'type'  => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route'    => '/restaurer/:formation',
                                    'defaults' => [
                                        'controller' => FormationController::class,
                                        'action'     => 'restaurer',
                                    ],
                                ],
                            ],
                            'supprimer' => [
                                'type'  => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route'    => '/supprimer/:formation',
                                    'defaults' => [
                                        'controller' => FormationController::class,
                                        'action'     => 'supprimer',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
@@ -92,10 +144,14 @@ return [
        ],
    ],
    'form_elements' => [
        'factories' => [],
        'factories' => [
            FormationForm::class => FormationFormFactory::class,
        ],
    ],
    'hydrators' => [
        'factories' => [],
        'factories' => [
            FormationHydrator::class => FormationHydratorFactory::class,
        ],
    ]

];
 No newline at end of file
+101
Changes for module/Formation/config/others/inscription.config.php: 101 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Formation;

use Formation\Controller\InscriptionController;
use Formation\Controller\InscriptionControllerFactory;
use Formation\Provider\Privilege\IndexPrivileges;
use Formation\Service\Inscription\InscriptionService;
use Formation\Service\Inscription\InscriptionServiceFactory;
use UnicaenAuth\Guard\PrivilegeController;
use Zend\Router\Http\Literal;
use Zend\Router\Http\Segment;

return [
    'bjyauthorize' => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => InscriptionController::class,
                    'action' => [
                        'index',
                        'ajouter',
                    ],
                    'privileges' => [
                        IndexPrivileges::INDEX_AFFICHER,
                    ],
                ],
            ],
        ],
    ],

    'navigation' => [
        'default' => [
            'home' => [
                'pages' => [
                    'formation' => [
                        'pages' => [
                            'inscription' => [
                                'label'    => 'Inscriptions',
                                'route'    => 'formation/inscription',
                                'resource' => PrivilegeController::getResourceId(InscriptionController::class, 'index') ,
                                'order'    => 400,
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'router'          => [
        'routes' => [
            'formation' => [
                'child_routes' => [
                    'inscription' => [
                        'type'  => Literal::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/inscription',
                            'defaults' => [
                                'controller' => InscriptionController::class,
                                'action'     => 'index',
                            ],
                        ],
                        'child_routes' => [
                            'ajouter' => [
                                'type'  => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route'    => '/ajouter/:session[/:individu]',
                                    'defaults' => [
                                        'controller' => InscriptionController::class,
                                        'action'     => 'ajouter',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [
            InscriptionService::class => InscriptionServiceFactory::class,
        ],
    ],
    'controllers'     => [
        'factories' => [
            InscriptionController::class => InscriptionControllerFactory::class,
        ],
    ],
    'form_elements' => [
        'factories' => [],
    ],
    'hydrators' => [
        'factories' => [],
    ]

];
 No newline at end of file
Loading