Commit 4601d712 authored by lecluse's avatar lecluse
Browse files

Refonte des entités pour la gestion nouvelle des disciplines

possibilité de gérer les dicciplines dans OSE.
Nouvelle vague de Refactoring
parent 93021c58
......@@ -52,7 +52,7 @@ trait <class>
$serviceLocator = $serviceLocator->getServiceLocator();
}
}
$this-><variable> = $serviceLocator->getServiceLocator('FormElementManager')->get('<name>');
$this-><variable> = $serviceLocator->get('FormElementManager')->get('<name>');
}
return $this-><variable>;
}
......
select id from etape where source_code = 'DUNEU1_201';
SELECT
t1.*,
CASE
WHEN etr_id IS NULL THEN
'
INSERT INTO ELEMENT_TAUX_REGIMES (
ID,
ELEMENT_PEDAGOGIQUE_ID,
TAUX_FI,
TAUX_FC,
TAUX_FA,
SOURCE_ID,
SOURCE_CODE,
HISTO_CREATION, HISTO_CREATEUR_ID,
HISTO_MODIFICATION, HISTO_MODIFICATEUR_ID
) VALUES (
ELEMENT_TAUX_REGIMES_ID_SEQ.NEXTVAL,
' || ep_id || ',
' || TRIM(TO_CHAR(n_taux_fi,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
' || TRIM(TO_CHAR(n_taux_fc,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
' || TRIM(TO_CHAR(n_taux_fa,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
(SELECT id FROM source WHERE code = ''OSE''),
q''[' || annee || '-' || ep_code || ']'',
SYSDATE, (SELECT id FROM utilisateur WHERE username=''lecluse''),
SYSDATE, (SELECT id FROM utilisateur WHERE username=''lecluse'')
);'
WHEN etr_id IS NOT NULL AND 1 = etr_actif THEN
'
UPDATE ELEMENT_TAUX_REGIMES SET
SOURCE_ID = (SELECT id FROM source WHERE code = ''OSE''),
TAUX_FI = ' || TRIM(TO_CHAR(n_taux_fi,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
TAUX_FA = ' || TRIM(TO_CHAR(n_taux_fa,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
TAUX_FC = ' || TRIM(TO_CHAR(n_taux_fc,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || '
WHERE id = ' || etr_id || ';'
WHEN etr_id IS NOT NULL AND 0 = etr_actif THEN
'
UPDATE ELEMENT_TAUX_REGIMES SET
SOURCE_ID = (SELECT id FROM source WHERE code = ''OSE''),
TAUX_FI = ' || TRIM(TO_CHAR(n_taux_fi,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
TAUX_FA = ' || TRIM(TO_CHAR(n_taux_fa,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
TAUX_FC = ' || TRIM(TO_CHAR(n_taux_fc,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
HISTO_DESTRUCTEUR_ID = NULL,
HISTO_DESTRUCTION = NULL
WHERE id = ' || etr_id || ';'
END rsql_etr,
CASE WHEN annee <> ose_parametre.get_annee_import THEN
'
UPDATE element_pedagogique SET
TAUX_FI = ' || TRIM(TO_CHAR(n_taux_fi,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
TAUX_FA = ' || TRIM(TO_CHAR(n_taux_fa,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || ',
TAUX_FC = ' || TRIM(TO_CHAR(n_taux_fc,'00000000000000.00000000', 'NLS_NUMERIC_CHARACTERS=''. ''')) || '
WHERE id = ' || ep_id || ';'
ELSE
''
END rsql_ep
FROM (
SELECT
ep.id ep_id,
e.id e_id,
etr.id etr_id,
CASE WHEN 1 = ose_divers.comprise_entre( etr.histo_creation,etr.histo_destruction ) THEN 1 ELSE 0 END etr_actif,
s.libelle s_libelle,
ep.annee_id annee,
ep.source_code ep_code,
str.libelle_court structure,
e.source_code e_code,
e.libelle e_libelle,
ep.fi,ep.taux_fi,
ep.fa,ep.taux_fa,
ep.fc,ep.taux_fc,
-- NOUVEAUX TAUX FI FA FC
100 /100 n_taux_fi,
0 /100 n_taux_fa,
0 /100 n_taux_fc
-- FIN DES NOUVEAUX TAUX FI FA FC
FROM
element_pedagogique ep
JOIN source s ON s.id = ep.source_id
JOIN etape e ON e.id = ep.etape_id
JOIN structure str ON str.id = ep.structure_id
LEFT JOIN element_taux_regimes etr ON etr.element_pedagogique_id = ep.id
WHERE
-- FILTRES
1 = ose_divers.comprise_entre( ep.histo_creation,ep.histo_destruction )
--AND s.code <> 'OSE'
AND e.source_code like 'DU2DG%201'
AND ep.annee_id = 2015
-- FIN DES FILTRES
) t1
WHERE
taux_fi <> n_taux_fi
OR taux_fa <> n_taux_fa
OR taux_fc <> n_taux_fc; -- Que s'il y a des différences
--select * from element_taux_regimes where element_pedagogique_id IN (
select * from element_pedagogique where etape_id IN (
select id from etape where source_code = 'DUNEU1_201'
--)
);
select * from element_taux_regimes where id = 44174;
select
dep.id,
dep.source_code,
dep.annee_id,
CASE WHEN dep.fi = 1 THEN 'Oui' ELSE ' ' END fi,
CASE WHEN dep.fa = 1 THEN 'Oui' ELSE ' ' END fa,
CASE WHEN dep.fc = 1 THEN 'Oui' ELSE ' ' END fc,
ROUND(ep.taux_fi*100,2) || '%' o_taux_fi,
ROUND(ep.taux_fa*100,2) || '%' o_taux_fa,
ROUND(ep.taux_fc*100,2) || '%' o_taux_fc,
ROUND(dep.taux_fi*100,2) || '%' n_taux_fi,
ROUND(dep.taux_fa*100,2) || '%' n_taux_fa,
ROUND(dep.taux_fc*100,2) || '%' n_taux_fc,
eff.fi eff_fi,
eff.fa eff_fa,
eff.fc eff_fc
from
v_diff_element_pedagogique dep
JOIN ELEMENT_PEDAGOGIQUE ep on ep.id = dep.id
LEFT JOIN effectifs eff on eff.source_code = ep.annee_id-1 || '-' || ep.source_code
where
1=1
AND dep.source_code like '%DUUE%';
SELECT * FROM ELEMENT_PEDAGOGIQUE WHERE source_code like '%DUUE%';
/*
UPDATE element_pedagogique
SET
taux_fi = 0,
taux_fc = 1,
taux_fa = 0
WHERE
id IN (
select id from element_pedagogique where etape_id IN (
select id from etape where source_code = 'DUNEU1_201'
)
)
AND annee_id = 2014
*/;
select source_code from etape where source_code in (
'C2I2E', -- à trouver
'DU1DG_201',
'DU1DG_202',
'DU1DG_203',
'DU2DG_201',
'M1DOC1_201',
'M1EE01_201',
'M1EPS1_201',
'M1HIG1_201',
'M1LMO1_201',
'M1LVE1_201',
'M1MAT1_201',
'M1PCH1_201',
'M1SES1_201',
'M1SVT1_201',
'M1S2I1_202',
'M2DOC2_211',
'M2EE02_211',
'M2EPS2_211',
'M2HIG2_211',
'M2INGM_211',
'M2LMO2_211',
'M2MAT2_211',
'M2PCH2_211',
'M2PD02_211',
'M2PD02_212',
'M2PD02_213',
'M2SES2_211',
'M2SVT2_211'
) order by source_code
\ No newline at end of file
......@@ -25,6 +25,8 @@ from
LEFT JOIN structure sa ON sa.id = a.structure_id AND sa.niveau = 2
where
NVL(ni.structure_id,0) <> NVL(a.structure_id,0)
ORDER BY
personnel, indicateur
;
delete from NOTIFICATION_INDICATEUR where
......
/*
INSERT INTO CATEGORIE_PRIVILEGE (
ID,
CODE,
LIBELLE
) VALUES (
CATEGORIE_PRIVILEGE_ID_SEQ.nextval,
'droit',
'Gestion des droits d''accès'
'discipline',
'Gestion des disciplines'
);
INSERT INTO PRIVILEGE (
......@@ -27,12 +27,11 @@ FROM (
-- SELECT 'droit' c, 'role-visualisation' p, 'Rôles - Visualisation' l FROM dual
--UNION SELECT 'droit' c, 'role-edition' p, 'Rôles - Édition' l FROM dual
SELECT 'droit' c, 'privilege-visualisation' p, 'Privilèges - Visualisation' l FROM dual
UNION SELECT 'droit' c, 'privilege-edition' p, 'Privilèges - Édition' l FROM dual
UNION SELECT 'droit' c, 'affectation-visualisation' p, 'Affectations - Visualisation' l FROM dual
UNION SELECT 'droit' c, 'affectation-edition' p, 'Affectations - Édition' l FROM dual
SELECT 'discipline' c, 'gestion' p, 'Gestion' l FROM dual
UNION SELECT 'discipline' c, 'visualisation' p, 'Visualisation' l FROM dual
UNION SELECT 'discipline' c, 'edition' p, 'Édition' l FROM dual
) t1;
) t1;*/
select
/*/
......@@ -49,13 +48,9 @@ order by
update privilege set ordre = 3 where id = 37;
update privilege set ordre = 4 where id = 36;
update privilege set ordre = 5 where id = 35;
update privilege set ordre = 6 where id = 34;
UPDATE CATEGORIE_PRIVILEGE SET CODE = 'droit' WHERE CODE = 'privilege';
update privilege set code = 'role-visualisation' where code = 'visualisation' AND categorie_id = (SELECT id FROM categorie_privilege WHERE code='droit');
update privilege set code = 'role-edition' where code = 'edition' AND categorie_id = (SELECT id FROM categorie_privilege WHERE code='droit');
--UPDATE CATEGORIE_PRIVILEGE SET CODE = 'droit' WHERE CODE = 'privilege';
--update privilege set code = 'role-visualisation' where code = 'visualisation' AND categorie_id = (SELECT id FROM categorie_privilege WHERE code='droit');
--update privilege set code = 'role-edition' where code = 'edition' AND categorie_id = (SELECT id FROM categorie_privilege WHERE code='droit');
......@@ -5,38 +5,99 @@ namespace Application;
use Application\Entity\Db\Privilege;
return [
'router' => [
'router' => [
'routes' => [
'gestion' => [
'type' => 'Literal',
'options' => [
'route' => '/gestion',
'type' => 'Literal',
'options' => [
'route' => '/gestion',
'defaults' => [
'__NAMESPACE__' => 'Application\Controller',
'controller' => 'Gestion',
'action' => 'index',
'controller' => 'Gestion',
'action' => 'index',
],
],
'may_terminate' => true,
],
'discipline' => [
'type' => 'Literal',
'options' => [
'route' => '/discipline',
'defaults' => [
'__NAMESPACE__' => 'Application\Controller',
'controller' => 'Discipline',
'action' => 'index',
],
],
'may_terminate' => true,
'child_routes' => [
'voir' => [
'type' => 'Segment',
'options' => [
'route' => '/voir/:discipline',
'constraints' => [
'discipline' => '[0-9]*',
],
'defaults' => [
'action' => 'voir',
],
],
'may_terminate' => true,
],
'saisir' => [
'type' => 'Segment',
'options' => [
'route' => '/saisir[/:discipline]',
'constraints' => [
'discipline' => '[0-9]*',
],
'defaults' => [
'action' => 'saisir',
],
],
'may_terminate' => true,
],
'supprimer' => [
'type' => 'Segment',
'options' => [
'route' => '/supprimer/:discipline',
'constraints' => [
'discipline' => '[0-9]*',
],
'defaults' => [
'action' => 'supprimer',
],
],
'may_terminate' => true,
],
],
],
],
],
'navigation' => [
'navigation' => [
'default' => [
'home' => [
'pages' => [
'gestion' => [
'label' => "Gestion",
'route' => 'gestion',
'label' => "Gestion",
'route' => 'gestion',
'resource' => 'controller/Application\Controller\Gestion:index',
'pages' => [
'discipline' => [
'label' => "Disciplines",
'title' => "Gestion des disciplines",
'route' => 'discipline',
'resource' => 'privilege/'.Privilege::DISCIPLINE_GESTION
],
],
],
],
],
],
],
'bjyauthorize' => [
'bjyauthorize' => [
'guards' => [
'Application\Guard\PrivilegeController' => [
Guard\PrivilegeController::class => [
[
'controller' => 'Application\Controller\Gestion',
'action' => ['index'],
......@@ -49,12 +110,44 @@ return [
Privilege::DROIT_AFFECTATION_VISUALISATION,
],
],
[
'controller' => 'Application\Controller\Discipline',
'action' => ['index'],
'privileges' => [
Privilege::DISCIPLINE_GESTION,
],
],
[
'controller' => 'Application\Controller\Discipline',
'action' => ['voir'],
'privileges' => [
Privilege::DISCIPLINE_VISUALISATION,
],
],
[
'controller' => 'Application\Controller\Discipline',
'action' => ['saisir','supprimer'],
'privileges' => [
Privilege::DISCIPLINE_EDITION,
],
],
],
],
],
'controllers' => [
'controllers' => [
'invokables' => [
'Application\Controller\Gestion' => Controller\GestionController::class,
'Application\Controller\Discipline' => Controller\DisciplineController::class,
],
],
'service_manager' => [
'invokables' => [
'ApplicationDiscipline' => Service\DisciplineService::class,
],
],
'form_elements' => [
'invokables' => [
'Application\Controller\Gestion' => 'Application\Controller\GestionController',
'DisciplineForm' => Form\DisciplineForm::class,
],
],
];
\ No newline at end of file
......@@ -116,27 +116,10 @@ return [
'result-item-donnees-perso-modif',
'purger-indicateur-donnees-perso-modif'
],
'roles' => [R_ROLE, ComposanteRole::ROLE_ID, DrhRole::ROLE_ID, AdministrateurRole::ROLE_ID],
'roles' => ['user', ComposanteRole::ROLE_ID, DrhRole::ROLE_ID, AdministrateurRole::ROLE_ID],
],
],
],
// 'resource_providers' => array(
// 'BjyAuthorize\Provider\Resource\Config' => array(
// 'Intervenant' => [],
// ),
// ),
// 'rule_providers' => array(
// 'BjyAuthorize\Provider\Rule\Config' => array(
// 'allow' => array(
// array(
// $R_ALL,
// 'Intervenant',
// array('total-heures-comp'),
// 'IntervenantAssertion',
// ),
// ),
// ),
// ),
],
'controllers' => [
'invokables' => [
......
......@@ -511,7 +511,7 @@ return [
[
'controller' => 'Application\Controller\Intervenant',
'action' => ['apercevoir',],
'roles' => [R_ROLE],
'roles' => ['user'],
],
[
'controller' => 'Application\Controller\Intervenant',
......
......@@ -2,19 +2,15 @@
namespace Application;
const R_ROLE = 'user';
const R_ADMINISTRATEUR = Acl\AdministrateurRole::ROLE_ID;
const R_COMPOSANTE = Acl\ComposanteRole::ROLE_ID;
const R_DRH = Acl\DrhRole::ROLE_ID;
const R_ETABLISSEMENT = Acl\EtablissementRole::ROLE_ID;
const R_INTERVENANT = Acl\IntervenantRole::ROLE_ID;
const R_INTERVENANT_PERMANENT = Acl\IntervenantPermanentRole::ROLE_ID;
const R_INTERVENANT_EXTERIEUR = Acl\IntervenantExterieurRole::ROLE_ID;
$R_ALL = [R_ADMINISTRATEUR, R_COMPOSANTE, R_DRH, R_ETABLISSEMENT, R_INTERVENANT];
$R_NOT_INTERVENANT = [R_ADMINISTRATEUR, R_COMPOSANTE, R_DRH, R_ETABLISSEMENT];
$R_COMMUN = [R_ADMINISTRATEUR, R_DRH, R_ETABLISSEMENT];
$main = [
'doctrine' => [
......@@ -142,7 +138,7 @@ $main = [
'identity_providers' => [
// 200 => 'UnicaenAuth\Provider\Identity\Db',
// 100 => 'UnicaenAuth\Provider\Identity\Ldap',
50 => 'ApplicationIdentityProvider',
50 => 'ApplicationIdentityProvider',
],
],
'bjyauthorize' => [
......
......@@ -129,23 +129,6 @@ return [
],
],
],
// 'resource_providers' => array(
// 'BjyAuthorize\Provider\Resource\Config' => array(
// 'Intervenant' => [],
// ),
// ),
// 'rule_providers' => array(
// 'BjyAuthorize\Provider\Rule\Config' => array(
// 'allow' => array(
// array(
// $R_ALL,
// 'Intervenant',
// array('total-heures-comp'),
// 'IntervenantAssertion',
// ),
// ),
// ),
// ),
],
'controllers' => [
'invokables' => [
......
......@@ -265,7 +265,7 @@ return [
[
'controller' => 'Application\Controller\Service',
'action' => ['index', 'export', 'saisie', 'suppression', 'rafraichir-ligne', 'volumes-horaires-refresh', 'initialisation', 'constatation', 'cloturer-saisie','horodatage'],
'roles' => [R_ROLE],
'roles' => ['user'],
], [
'controller' => 'Application\Controller\Service',
'action' => ['resume','resume-refresh','recherche'],
......@@ -273,7 +273,7 @@ return [
], [
'controller' => 'Application\Controller\ServiceReferentiel',
'action' => ['index', 'saisie', 'suppression', 'rafraichir-ligne', 'initialisation', 'constatation'],
'roles' => [R_ROLE],
'roles' => ['user'],
],
],
],
......@@ -289,7 +289,7 @@ return [
'BjyAuthorize\Provider\Rule\Config' => [
'allow' => [
[
[R_ROLE],
['user'],
'Service',
['create', 'read', 'delete', 'update'],
'ServiceAssertion',
......@@ -307,7 +307,7 @@ return [
'ServiceAssertion',
],
[
[R_INTERVENANT, /*R_INTERVENANT_PERMANENT,*/ R_COMPOSANTE, R_ADMINISTRATEUR],
[R_INTERVENANT, R_COMPOSANTE, R_ADMINISTRATEUR],
'ServiceReferentiel',
['create', 'read', 'delete', 'update'],
'ServiceReferentielAssertion'
......@@ -318,49 +318,49 @@ return [
],
'controllers' => [
'invokables' => [
'Application\Controller\Service' => Application\Controller\ServiceController::class,
'Application\Controller\ServiceReferentiel' => Application\Controller\ServiceReferentielController::class,
'Application\Controller\Service' => Controller\ServiceController::class,
'Application\Controller\ServiceReferentiel' => Controller\ServiceReferentielController::class,
],
],
'service_manager' => [
'invokables' => [
'ApplicationService' => Application\Service\Service::class,
'ApplicationServiceReferentiel' => Application\Service\ServiceReferentiel::class,
'ApplicationFonctionReferentiel' => Application\Service\FonctionReferentiel::class,
'ApplicationPeriode' => Application\Service\Periode::class,
'ApplicationMotifNonPaiement' => Application\Service\MotifNonPaiement::class,
'ApplicationModificationServiceDu' => Application\Service\ModificationServiceDu::class,
'ServiceRechercheHydrator' => Application\Entity\Service\RechercheHydrator::class,
'ServiceRechercheFormHydrator' => Application\Form\Service\RechercheFormHydrator::class,
'FormServiceSaisieFieldsetHydrator' => Application\Form\Service\SaisieFieldsetHydrator::class,
'FormServiceSaisieHydrator' => Application\Form\Service\SaisieHydrator::class,
'FormServiceReferentielSaisieFieldsetHydrator' => Application\Form\ServiceReferentiel\SaisieFieldsetHydrator::class,
'FormServiceReferentielSaisieHydrator' => Application\Form\ServiceReferentiel\SaisieHydrator::class,
'ServiceAssertion' => Application\Assertion\ServiceAssertion::class,
'ServiceReferentielAssertion' => Application\Assertion\ServiceReferentielAssertion::class,
'ApplicationService' => Service\ServiceService::class,
'ApplicationServiceReferentiel' => Service\ServiceReferentiel::class,
'ApplicationFonctionReferentiel' => Service\FonctionReferentiel::class,
'ApplicationPeriode' => Service\Periode::class,
'ApplicationMotifNonPaiement' => Service\MotifNonPaiement::class,
'ApplicationModificationServiceDu' => Service\ModificationServiceDu::class,
'ServiceRechercheHydrator' => Entity\Service\RechercheHydrator::class,
'ServiceRechercheFormHydrator' => Form\Service\RechercheFormHydrator::class,
'FormServiceSaisieFieldsetHydrator' => Form\Service\SaisieFieldsetHydrator::class,
'FormServiceSaisieHydrator' => Form\Service\SaisieHydrator::class,
'FormServiceReferentielSaisieFieldsetHydrator' => Form\ServiceReferentiel\SaisieFieldsetHydrator::class,
'FormServiceReferentielSaisieHydrator' => Form\ServiceReferentiel\SaisieHydrator::class,
'ServiceAssertion' => Assertion\ServiceAssertion::class,
'ServiceReferentielAssertion' => Assertion\ServiceReferentielAssertion::class,
],
],
'form_elements' => [
'invokables' => [
'ServiceSaisie' => Application\Form\Service\Saisie::class,
'ServiceSaisieFieldset' => Application\Form\Service\SaisieFieldset::class,
'ServiceReferentielSaisie' => Application\Form\ServiceReferentiel\Saisie::class,
'ServiceReferentielSaisieFieldset' => Application\Form\ServiceReferentiel\SaisieFieldset::class,
'ServiceRechercheForm' => Application\Form\Service\RechercheForm::class,
'ServiceSaisie' => Form\Service\Saisie::class,
'ServiceSaisieFieldset' => Form\Service\SaisieFieldset::class,
'ServiceReferentielSaisie' => Form\ServiceReferentiel\Saisie::class,
'ServiceReferentielSaisieFieldset' => Form\ServiceReferentiel\SaisieFieldset::class,
'ServiceRechercheForm' => Form\Service\RechercheForm::class,
],