Skip to content
Snippets Groups Projects
Commit c0d217a9 authored by lecluse's avatar lecluse
Browse files

Finalisation du workflow et travail sur l'application des droits d'accès

parent 068725b0
No related branches found
No related tags found
No related merge requests found
Showing
with 190 additions and 294 deletions
...@@ -283,16 +283,16 @@ ...@@ -283,16 +283,16 @@
}, },
{ {
"name": "doctrine/common", "name": "doctrine/common",
"version": "v2.5.3", "version": "v2.6.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/common.git", "url": "https://github.com/doctrine/common.git",
"reference": "10f1f19651343f87573129ca970aef1a47a6f29e" "reference": "a579557bc689580c19fee4e27487a67fe60defc0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/10f1f19651343f87573129ca970aef1a47a6f29e", "url": "https://api.github.com/repos/doctrine/common/zipball/a579557bc689580c19fee4e27487a67fe60defc0",
"reference": "10f1f19651343f87573129ca970aef1a47a6f29e", "reference": "a579557bc689580c19fee4e27487a67fe60defc0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -301,20 +301,20 @@ ...@@ -301,20 +301,20 @@
"doctrine/collections": "1.*", "doctrine/collections": "1.*",
"doctrine/inflector": "1.*", "doctrine/inflector": "1.*",
"doctrine/lexer": "1.*", "doctrine/lexer": "1.*",
"php": ">=5.3.2" "php": "~5.5|~7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~3.7" "phpunit/phpunit": "~4.8|~5.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.5.x-dev" "dev-master": "2.7.x-dev"
} }
}, },
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Doctrine\\Common\\": "lib/" "Doctrine\\Common\\": "lib/Doctrine/Common"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
...@@ -352,7 +352,7 @@ ...@@ -352,7 +352,7 @@
"persistence", "persistence",
"spl" "spl"
], ],
"time": "2015-12-25 13:10:16" "time": "2015-12-25 13:18:31"
}, },
{ {
"name": "doctrine/dbal", "name": "doctrine/dbal",
...@@ -427,22 +427,22 @@ ...@@ -427,22 +427,22 @@
}, },
{ {
"name": "doctrine/doctrine-module", "name": "doctrine/doctrine-module",
"version": "0.10.0", "version": "1.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/DoctrineModule.git", "url": "https://github.com/doctrine/DoctrineModule.git",
"reference": "3d08edccd7d813246004acee03ed9024e389d48f" "reference": "ade6c1667283e3d8131d40e79c427b8a8100e7d3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/DoctrineModule/zipball/3d08edccd7d813246004acee03ed9024e389d48f", "url": "https://api.github.com/repos/doctrine/DoctrineModule/zipball/ade6c1667283e3d8131d40e79c427b8a8100e7d3",
"reference": "3d08edccd7d813246004acee03ed9024e389d48f", "reference": "ade6c1667283e3d8131d40e79c427b8a8100e7d3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/cache": "~1.5", "doctrine/cache": "~1.5",
"doctrine/common": ">=2.4,<2.6-dev", "doctrine/common": "~2.6",
"php": ">=5.4", "php": "^5.5 || ^7.0",
"symfony/console": "~2.3|~3.0", "symfony/console": "~2.3|~3.0",
"zendframework/zend-authentication": "~2.3", "zendframework/zend-authentication": "~2.3",
"zendframework/zend-cache": "~2.3", "zendframework/zend-cache": "~2.3",
...@@ -501,27 +501,27 @@ ...@@ -501,27 +501,27 @@
"module", "module",
"zf2" "zf2"
], ],
"time": "2015-12-01 22:04:42" "time": "2016-03-21 22:50:01"
}, },
{ {
"name": "doctrine/doctrine-orm-module", "name": "doctrine/doctrine-orm-module",
"version": "0.9.2", "version": "0.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/DoctrineORMModule.git", "url": "https://github.com/doctrine/DoctrineORMModule.git",
"reference": "847db36f0f7ef8d940414e433e8b241aa601a6a7" "reference": "50808eb795d00aac6a551023b1bb379de054f9b5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/DoctrineORMModule/zipball/847db36f0f7ef8d940414e433e8b241aa601a6a7", "url": "https://api.github.com/repos/doctrine/DoctrineORMModule/zipball/50808eb795d00aac6a551023b1bb379de054f9b5",
"reference": "847db36f0f7ef8d940414e433e8b241aa601a6a7", "reference": "50808eb795d00aac6a551023b1bb379de054f9b5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/dbal": ">=2.4,<2.7", "doctrine/dbal": ">=2.4,<2.7",
"doctrine/doctrine-module": "~0.8", "doctrine/doctrine-module": "~1.0",
"doctrine/orm": ">=2.5,<2.7", "doctrine/orm": ">=2.5,<2.7",
"php": ">=5.4", "php": "^5.5 || ^7.0",
"symfony/console": "~2.5|~3.0", "symfony/console": "~2.5|~3.0",
"zendframework/zend-mvc": "~2.3", "zendframework/zend-mvc": "~2.3",
"zendframework/zend-servicemanager": "~2.3", "zendframework/zend-servicemanager": "~2.3",
...@@ -579,7 +579,7 @@ ...@@ -579,7 +579,7 @@
"orm", "orm",
"zf2" "zf2"
], ],
"time": "2015-10-05 23:06:08" "time": "2016-03-22 00:43:08"
}, },
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
...@@ -1005,16 +1005,16 @@ ...@@ -1005,16 +1005,16 @@
}, },
{ {
"name": "rwoverdijk/assetmanager", "name": "rwoverdijk/assetmanager",
"version": "1.5.0", "version": "1.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/RWOverdijk/AssetManager.git", "url": "https://github.com/RWOverdijk/AssetManager.git",
"reference": "ced629631ff612b8b3dd3a2e83ac8e77ac946fcd" "reference": "ef8935a3a033fc681ffd3c21188f12cf8761f677"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/RWOverdijk/AssetManager/zipball/ced629631ff612b8b3dd3a2e83ac8e77ac946fcd", "url": "https://api.github.com/repos/RWOverdijk/AssetManager/zipball/ef8935a3a033fc681ffd3c21188f12cf8761f677",
"reference": "ced629631ff612b8b3dd3a2e83ac8e77ac946fcd", "reference": "ef8935a3a033fc681ffd3c21188f12cf8761f677",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1062,20 +1062,20 @@ ...@@ -1062,20 +1062,20 @@
"zend framework 2", "zend framework 2",
"zf2" "zf2"
], ],
"time": "2016-01-21 09:21:54" "time": "2016-03-03 14:36:07"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v3.0.3", "version": "v3.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04" "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/2ed5e2706ce92313d120b8fe50d1063bcfd12e04", "url": "https://api.github.com/repos/symfony/console/zipball/6b1175135bc2a74c08a28d89761272de8beed8cd",
"reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04", "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1122,11 +1122,11 @@ ...@@ -1122,11 +1122,11 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-28 16:24:34" "time": "2016-03-16 17:00:50"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.1.0", "version": "v1.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
...@@ -1185,16 +1185,16 @@ ...@@ -1185,16 +1185,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v2.8.3", "version": "v2.8.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe" "reference": "fb467471952ef5cf8497c029980e556b47545333"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe", "url": "https://api.github.com/repos/symfony/process/zipball/fb467471952ef5cf8497c029980e556b47545333",
"reference": "7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe", "reference": "fb467471952ef5cf8497c029980e556b47545333",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1230,7 +1230,7 @@ ...@@ -1230,7 +1230,7 @@
], ],
"description": "Symfony Process Component", "description": "Symfony Process Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-02 13:33:15" "time": "2016-03-23 13:11:46"
}, },
{ {
"name": "unicaen/unicaen-app", "name": "unicaen/unicaen-app",
...@@ -1238,7 +1238,7 @@ ...@@ -1238,7 +1238,7 @@
"source": { "source": {
"type": "svn", "type": "svn",
"url": "https://svn.unicaen.fr/svn/UnicaenApp", "url": "https://svn.unicaen.fr/svn/UnicaenApp",
"reference": "/trunk/@681" "reference": "/trunk/@685"
}, },
"require": { "require": {
"doctrine/doctrine-orm-module": ">=0.7", "doctrine/doctrine-orm-module": ">=0.7",
...@@ -1288,7 +1288,7 @@ ...@@ -1288,7 +1288,7 @@
"source": { "source": {
"type": "svn", "type": "svn",
"url": "https://svn.unicaen.fr/svn/UnicaenAuth", "url": "https://svn.unicaen.fr/svn/UnicaenAuth",
"reference": "/trunk/@267" "reference": "/trunk/@269"
}, },
"require": { "require": {
"bjyoungblood/bjy-authorize": ">=1.4", "bjyoungblood/bjy-authorize": ">=1.4",
...@@ -1317,7 +1317,7 @@ ...@@ -1317,7 +1317,7 @@
"source": { "source": {
"type": "svn", "type": "svn",
"url": "https://svn.unicaen.fr/svn/UnicaenCode", "url": "https://svn.unicaen.fr/svn/UnicaenCode",
"reference": "/trunk/@31" "reference": "/trunk/@32"
}, },
"require": { "require": {
"zendframework/zend-developer-tools": "dev-master" "zendframework/zend-developer-tools": "dev-master"
...@@ -3966,16 +3966,16 @@ ...@@ -3966,16 +3966,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "4.8.23", "version": "4.8.24",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483" "reference": "a1066c562c52900a142a0e2bbf0582994671385e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e351261f9cd33daf205a131a1ba61c6d33bd483", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e",
"reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483", "reference": "a1066c562c52900a142a0e2bbf0582994671385e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -4034,7 +4034,7 @@ ...@@ -4034,7 +4034,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2016-02-11 14:56:33" "time": "2016-03-14 06:16:08"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
...@@ -4465,16 +4465,16 @@ ...@@ -4465,16 +4465,16 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.0.3", "version": "v3.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c" "reference": "0047c8366744a16de7516622c5b7355336afae96"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/b5ba64cd67ecd6887f63868fa781ca094bd1377c", "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96",
"reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c", "reference": "0047c8366744a16de7516622c5b7355336afae96",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -4510,7 +4510,7 @@ ...@@ -4510,7 +4510,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-02-23 15:16:06" "time": "2016-03-04 07:55:57"
}, },
{ {
"name": "zendframework/zend-dom", "name": "zendframework/zend-dom",
......
...@@ -232,9 +232,4 @@ return [ ...@@ -232,9 +232,4 @@ return [
'DroitsAffectationForm'=> Form\Droits\AffectationForm::class, 'DroitsAffectationForm'=> Form\Droits\AffectationForm::class,
], ],
], ],
'public_files' => [
'js' => [
'js/droits.js',
],
]
]; ];
\ No newline at end of file
...@@ -479,6 +479,14 @@ return [ ...@@ -479,6 +479,14 @@ return [
Privileges::INTERVENANT_CALCUL_HETD, Privileges::INTERVENANT_CALCUL_HETD,
], ],
], ],
[
'controller' => 'Application\Controller\Intervenant',
'action' => ['cloturer-saisie'],
'privileges' => [
Privileges::ENSEIGNEMENT_CLOTURE,
],
'assertion' => 'assertionIntervenant',
],
[ /// @todo à protéger d'avantage... [ /// @todo à protéger d'avantage...
'controller' => 'Application\Controller\Intervenant', 'controller' => 'Application\Controller\Intervenant',
'action' => ['formule-totaux-hetd'], 'action' => ['formule-totaux-hetd'],
...@@ -516,7 +524,7 @@ return [ ...@@ -516,7 +524,7 @@ return [
'ApplicationCivilite' => Service\Civilite::class, 'ApplicationCivilite' => Service\Civilite::class,
'ApplicationStatutIntervenant' => Service\StatutIntervenant::class, 'ApplicationStatutIntervenant' => Service\StatutIntervenant::class,
'ApplicationTypeIntervenant' => Service\TypeIntervenant::class, 'ApplicationTypeIntervenant' => Service\TypeIntervenant::class,
'IntervenantAssertion' => Assertion\IntervenantAssertion::class, 'assertionIntervenant' => Assertion\IntervenantAssertion::class,
'ModificationServiceDuAssertion' => Assertion\ModificationServiceDuAssertion::class, 'ModificationServiceDuAssertion' => Assertion\ModificationServiceDuAssertion::class,
'PeutSaisirServiceRule' => Rule\Intervenant\PeutSaisirServiceRule::class, 'PeutSaisirServiceRule' => Rule\Intervenant\PeutSaisirServiceRule::class,
'PeutSaisirReferentielRule' => Rule\Intervenant\PeutSaisirReferentielRule::class, 'PeutSaisirReferentielRule' => Rule\Intervenant\PeutSaisirReferentielRule::class,
......
...@@ -6,7 +6,6 @@ const R_ADMINISTRATEUR = Acl\AdministrateurRole::ROLE_ID; ...@@ -6,7 +6,6 @@ const R_ADMINISTRATEUR = Acl\AdministrateurRole::ROLE_ID;
const R_COMPOSANTE = Acl\ComposanteRole::ROLE_ID; const R_COMPOSANTE = Acl\ComposanteRole::ROLE_ID;
const R_ETABLISSEMENT = Acl\EtablissementRole::ROLE_ID; const R_ETABLISSEMENT = Acl\EtablissementRole::ROLE_ID;
const R_INTERVENANT = Acl\IntervenantRole::ROLE_ID; const R_INTERVENANT = Acl\IntervenantRole::ROLE_ID;
const R_INTERVENANT_EXTERIEUR = Acl\IntervenantExterieurRole::ROLE_ID;
$main = [ $main = [
...@@ -161,7 +160,7 @@ $main = [ ...@@ -161,7 +160,7 @@ $main = [
'ApplicationPays' => Service\Pays::class, 'ApplicationPays' => Service\Pays::class,
'ApplicationDepartement' => Service\Departement::class, 'ApplicationDepartement' => Service\Departement::class,
'applicationFichier' => Service\FichierService::class, 'applicationFichier' => Service\FichierService::class,
'UnicaenAuth\Service\Privilege' => Service\PrivilegeService::class, 'UnicaenAuth\Service\Privilege' => Service\PrivilegeService::class
], ],
'factories' => [ 'factories' => [
'navigation' => Service\NavigationFactoryFactory::class, 'navigation' => Service\NavigationFactoryFactory::class,
...@@ -221,28 +220,34 @@ $main = [ ...@@ -221,28 +220,34 @@ $main = [
'layout' => 'layout/layout', // e.g., 'layout/layout' 'layout' => 'layout/layout', // e.g., 'layout/layout'
], ],
'public_files' => [ 'public_files' => [
'head_scripts' => [
'020_jqueryui' => 'https://gest.unicaen.fr/public/jquery-ui-1.11.4.minimal/jquery-ui.min.js',
],
'inline_scripts' => [ 'inline_scripts' => [
10 => 'js/datepicker-fr.js', '001_' => 'js/datepicker-fr.js',
11 => 'js/service.js', '111_' => 'js/service.js',
12 => 'js/service-referentiel.js', '112_' => 'js/service-referentiel.js',
13 => 'js/paiement.js', '113_' => 'js/paiement.js',
14 => 'js/offre-formation.js', '114_' => 'js/offre-formation.js',
15 => 'js/droits.js', '115_' => 'js/droits.js',
16 => 'js/piece-jointe.js', '116_' => 'js/piece-jointe.js',
50 => 'https://gest.unicaen.fr/public/bootstrap-select-1.9.4/dist/js/bootstrap-select.min.js', '117_' => 'https://gest.unicaen.fr/public/bootstrap-select-1.9.4/dist/js/bootstrap-select.min.js',
], ],
'stylesheets' => [ 'stylesheets' => [
10 => 'https://gest.unicaen.fr/public/bootstrap-select-1.9.4/dist/css/bootstrap-select.min.css', '010_jquery-ui' => 'https://gest.unicaen.fr/public/jquery-ui-1.11.4.minimal/jquery-ui.min.css',
11 => 'css/cartridge.css', '020_jquery-ui-structure' => 'https://gest.unicaen.fr/public/jquery-ui-1.11.4.minimal/jquery-ui.structure.min.css',
12 => 'https://gest.unicaen.fr/public/font-awesome-4.5.0/css/font-awesome.min.css', '030_jquery-ui-theme' => 'https://gest.unicaen.fr/public/jquery-ui-1.11.4.minimal/jquery-ui.theme.min.css',
13 => 'https://gest.unicaen.fr/public/open-sans-gh-pages/open-sans.css', '110_' => 'https://gest.unicaen.fr/public/bootstrap-select-1.9.4/dist/css/bootstrap-select.min.css',
14 => 'css/budget.css', '111_' => 'css/cartridge.css',
15 => 'css/paiement.css', '112_' => 'https://gest.unicaen.fr/public/font-awesome-4.5.0/css/font-awesome.min.css',
16 => 'css/agrement.css', '113_' => 'https://gest.unicaen.fr/public/open-sans-gh-pages/open-sans.css',
17 => 'css/service.css', '114_' => 'css/budget.css',
18 => 'css/acceuil.css', '115_' => 'css/paiement.css',
19 => 'css/droits.css', '116_' => 'css/agrement.css',
20 => 'css/callout.css', '117_' => 'css/service.css',
'118_' => 'css/acceuil.css',
'119_' => 'css/droits.css',
'120_' => 'css/callout.css',
], ],
], ],
]; ];
......
...@@ -136,7 +136,6 @@ return [ ...@@ -136,7 +136,6 @@ return [
AdministrateurRole::ROLE_ID, AdministrateurRole::ROLE_ID,
], ],
[ [
Validation::RESOURCE_ID_CLOTURE_REALISE,
Validation::RESOURCE_ID_VALIDATION_ENSEIGNEMENT, Validation::RESOURCE_ID_VALIDATION_ENSEIGNEMENT,
Validation::RESOURCE_ID_VALIDATION_REFERENTIEL, Validation::RESOURCE_ID_VALIDATION_REFERENTIEL,
], ],
...@@ -146,22 +145,6 @@ return [ ...@@ -146,22 +145,6 @@ return [
'ValidationAssertion', 'ValidationAssertion',
], ],
// ------------- Cloture REALISE -------------
[
[
IntervenantRole::ROLE_ID, // <-- Hey!
ComposanteRole::ROLE_ID,
AdministrateurRole::ROLE_ID,
],
[
Validation::RESOURCE_ID_CLOTURE_REALISE,
],
[
OldAbstractAssertion::PRIVILEGE_CREATE,
],
'ValidationAssertion',
],
// ------------- Validation ENSEIGNEMENT et REFERENTIEL ------------- // ------------- Validation ENSEIGNEMENT et REFERENTIEL -------------
[ [
[ [
...@@ -197,7 +180,6 @@ return [ ...@@ -197,7 +180,6 @@ return [
'ValidationAssertion' => Assertion\ValidationAssertionProxy::class, 'ValidationAssertion' => Assertion\ValidationAssertionProxy::class,
'ValidationServiceAssertion' => Assertion\ValidationServiceAssertion::class, 'ValidationServiceAssertion' => Assertion\ValidationServiceAssertion::class,
'ValidationReferentielAssertion' => Assertion\ValidationReferentielAssertion::class, 'ValidationReferentielAssertion' => Assertion\ValidationReferentielAssertion::class,
'ClotureRealiseAssertion' => Assertion\ClotureRealiseAssertion::class,
], ],
'factories' => [ 'factories' => [
'ValidationEnseignementPrevuRule' => Rule\Validation\Enseignement\Prevu\RuleFactory::class, 'ValidationEnseignementPrevuRule' => Rule\Validation\Enseignement\Prevu\RuleFactory::class,
......
...@@ -44,7 +44,7 @@ class AgrementAssertion extends AbstractAssertion ...@@ -44,7 +44,7 @@ class AgrementAssertion extends AbstractAssertion
// Si le rôle n'est pas renseigné alors on s'en va... // Si le rôle n'est pas renseigné alors on s'en va...
if (!$role instanceof Role) return false; if (!$role instanceof Role) return false;
// pareil si le rôle ne possède pas le privilège adéquat // pareil si le rôle ne possède pas le privilège adéquat
if ($privilege && !$this->isAllowed(Privileges::getResourceId($privilege))) return false; if ($privilege && !$role->hasPrivilege($privilege)) return false;
// Si c'est bon alors on affine... // Si c'est bon alors on affine...
switch (true) { switch (true) {
...@@ -93,7 +93,7 @@ class AgrementAssertion extends AbstractAssertion ...@@ -93,7 +93,7 @@ class AgrementAssertion extends AbstractAssertion
// Si le rôle n'est pas renseigné alors on s'en va... // Si le rôle n'est pas renseigné alors on s'en va...
if (!$role instanceof Role) return false; if (!$role instanceof Role) return false;
// pareil si le rôle ne possède pas le privilège adéquat // pareil si le rôle ne possède pas le privilège adéquat
if ($privilege && !$this->isAllowed(Privileges::getResourceId($privilege))) return false; if ($privilege && !$role->hasPrivilege($privilege)) return false;
switch ($action) { switch ($action) {
case 'lister': case 'lister':
...@@ -140,6 +140,7 @@ class AgrementAssertion extends AbstractAssertion ...@@ -140,6 +140,7 @@ class AgrementAssertion extends AbstractAssertion
protected function assertPage(array $page) protected function assertPage(array $page)
{ {
$role = $this->getRole();
$intervenant = $this->getMvcEvent()->getParam('intervenant'); $intervenant = $this->getMvcEvent()->getParam('intervenant');
$wfEtape = null; $wfEtape = null;
...@@ -152,7 +153,8 @@ class AgrementAssertion extends AbstractAssertion ...@@ -152,7 +153,8 @@ class AgrementAssertion extends AbstractAssertion
$privilege = Privileges::AGREMENT_CONSEIL_ACADEMIQUE_VISUALISATION; $privilege = Privileges::AGREMENT_CONSEIL_ACADEMIQUE_VISUALISATION;
} }
if ($privilege && !$this->isAllowed(Privileges::getResourceId($privilege))) return false; if (!$role instanceof Role) return false;
if ($privilege && !$role->hasPrivilege($privilege)) return false;
if ($wfEtape && $intervenant && !$this->isAllowed(WorkflowResource::create($wfEtape, $intervenant))) return false; if ($wfEtape && $intervenant && !$this->isAllowed(WorkflowResource::create($wfEtape, $intervenant))) return false;
return true; return true;
......
...@@ -30,7 +30,7 @@ class BudgetAssertion extends AbstractAssertion ...@@ -30,7 +30,7 @@ class BudgetAssertion extends AbstractAssertion
// Si le rôle n'est pas renseigné alors on s'en va... // Si le rôle n'est pas renseigné alors on s'en va...
if (!$role instanceof Role) return false; if (!$role instanceof Role) return false;
// pareil si le rôle ne possède pas le privilège adéquat // pareil si le rôle ne possède pas le privilège adéquat
if ($privilege && !$this->isAllowed(Privileges::getResourceId($privilege))) return false; if ($privilege && !$role->hasPrivilege($privilege)) return false;
switch (true) { switch (true) {
case $entity instanceof Dotation: case $entity instanceof Dotation:
...@@ -62,7 +62,7 @@ class BudgetAssertion extends AbstractAssertion ...@@ -62,7 +62,7 @@ class BudgetAssertion extends AbstractAssertion
// Si le rôle n'est pas renseigné alors on s'en va... // Si le rôle n'est pas renseigné alors on s'en va...
if (!$role instanceof Role) return false; if (!$role instanceof Role) return false;
// pareil si le rôle ne possède pas le privilège adéquat // pareil si le rôle ne possède pas le privilège adéquat
if ($privilege && !$this->isAllowed(Privileges::getResourceId($privilege))) return false; if ($privilege && !$role->hasPrivilege($privilege)) return false;
if ($controller == 'Application\Controller\Budget' && $action == 'tableau-de-bord'){ if ($controller == 'Application\Controller\Budget' && $action == 'tableau-de-bord'){
return ! $role->getStructure(); // on n'a accès que si on n'est pas dans une structure spécifique!! return ! $role->getStructure(); // on n'a accès que si on n'est pas dans une structure spécifique!!
......
<?php
namespace Application\Assertion;
use Application\Rule\Validation\ClotureRealiseRule;
use Application\Entity\Db\TypeVolumeHoraire as TypeVolumeHoraireEntity;
/**
* Assertions concernant la clôture du réalisé.
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class ClotureRealiseAssertion extends ValidationEnsRefAbstractAssertion
{
use \Application\Service\Traits\TypeVolumeHoraireAwareTrait;
/**
* @return boolean
*/
protected function assertEntityOld()
{return true; // @todo à revoir...
if (! $this->assertCRUD()) {
return false;
}
$rule = $this->getServiceLocator()->get('ClotureRealiseRule') /* @var $rule ClotureRealiseRule */
->setIntervenant($this->resource->getIntervenant())
->setTypeVolumeHoraire($this->getTypeVolumeHoraire())
->setRole($this->role)
->execute();
// var_dump("isAllowed({$this->privilege}) = " . (int)$rule->isAllowed($this->privilege));
return $rule->isAllowed($this->privilege);
}
/**
* @return TypeVolumeHoraireEntity
*/
protected function getTypeVolumeHoraire()
{
return $this->getServiceTypeVolumeHoraire()->getRealise();
}
}
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Application\Assertion; namespace Application\Assertion;
use Application\Acl\Role;
use Application\Entity\Db\Intervenant; use Application\Entity\Db\Intervenant;
use Application\Entity\Db\WfEtape; use Application\Entity\Db\WfEtape;
use Application\Provider\Privilege\Privileges; // sous réserve que vous utilisiez les privilèges d'UnicaenAuth et que vous ayez généré votre fournisseur use Application\Provider\Privilege\Privileges; // sous réserve que vous utilisiez les privilèges d'UnicaenAuth et que vous ayez généré votre fournisseur
...@@ -58,12 +59,12 @@ class DossierPiecesAssertion extends AbstractAssertion ...@@ -58,12 +59,12 @@ class DossierPiecesAssertion extends AbstractAssertion
case 'valider': case 'valider':
if (!$this->assertPriv(Privileges::PIECE_JUSTIFICATIVE_VALIDATION)) return false; if (!$this->assertPriv(Privileges::PIECE_JUSTIFICATIVE_VALIDATION)) return false;
return $this->assertPieceJointeValidationAction($intervenant); return $this->assertPieceJointeAction($intervenant);
break; break;
case 'devalider': case 'devalider':
if (!$this->assertPriv(Privileges::PIECE_JUSTIFICATIVE_DEVALIDATION)) return false; if (!$this->assertPriv(Privileges::PIECE_JUSTIFICATIVE_DEVALIDATION)) return false;
return $this->assertPieceJointeValidationAction($intervenant); return $this->assertPieceJointeAction($intervenant);
break; break;
} }
break; break;
...@@ -145,6 +146,8 @@ class DossierPiecesAssertion extends AbstractAssertion ...@@ -145,6 +146,8 @@ class DossierPiecesAssertion extends AbstractAssertion
protected function assertPriv($privilege) protected function assertPriv($privilege)
{ {
return $this->isAllowed(Privileges::getResourceId($privilege)); $role = $this->getRole();
if (!$role instanceof Role) return false;
return $role->hasPrivilege($privilege);
} }
} }
\ No newline at end of file
...@@ -23,7 +23,7 @@ class GestionAssertion extends AbstractAssertion ...@@ -23,7 +23,7 @@ class GestionAssertion extends AbstractAssertion
// Si le rôle n'est pas renseigné alors on s'en va... // Si le rôle n'est pas renseigné alors on s'en va...
if (!$role instanceof Role) return false; if (!$role instanceof Role) return false;
// pareil si le rôle ne possède pas le privilège adéquat // pareil si le rôle ne possède pas le privilège adéquat
if ($privilege && !$this->isAllowed(Privileges::getResourceId($privilege))) return false; if ($privilege && !$role->hasPrivilege($privilege)) return false;
if ($role->getIntervenant()) return false; // les intervenants n'ont pour le moment pas accès au menu Gestion if ($role->getIntervenant()) return false; // les intervenants n'ont pour le moment pas accès au menu Gestion
......
...@@ -2,35 +2,83 @@ ...@@ -2,35 +2,83 @@
namespace Application\Assertion; namespace Application\Assertion;
use Zend\Permissions\Acl\Acl; use Application\Entity\Db\Intervenant;
use Zend\Permissions\Acl\Resource\ResourceInterface; use Application\Entity\Db\Role;
use Zend\Permissions\Acl\Role\RoleInterface; use Application\Entity\Db\WfEtape;
use UnicaenAuth\Assertion\AbstractAssertion;
/** /**
* *
* *
* @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr> * @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
*/ */
class IntervenantAssertion extends OldAbstractAssertion class IntervenantAssertion extends AbstractAssertion
{ {
/**
* Returns true if and only if the assertion conditions are met /* ---- Routage général ---- */
* public function __invoke(array $page) // gestion des visibilités de menus
* This method is passed the ACL, Role, Resource, and privilege to which the authorization query applies. If the {
* $role, $resource, or $privilege parameters are null, it means that the query applies to all Roles, Resources, or return $this->assertPage($page);
* privileges, respectively. }
*
* @param Acl $acl
* @param RoleInterface $role protected function assertController($controller, $action = null, $privilege = null)
* @param ResourceInterface $resource {
* @param string $privilege $role = $this->getRole();
* @return bool
*/ // Si le rôle n'est pas renseigné alors on s'en va...
public function assert(Acl $acl, RoleInterface $role = null, ResourceInterface $resource = null, $privilege = null) if (!$role instanceof Role) return false;
// pareil si le rôle ne possède pas le privilège adéquat
if ($privilege && !$role->hasPrivilege($privilege)) return false;
$intervenant = $this->getMvcEvent()->getParam('intervenant');
/* @var $intervenant Intervenant */
switch ($action) {
case 'cloturer-saisie':
return $this->assertClotureSaisie($intervenant);
break;
}
return true;
}
protected function assertPage(array $page)
{ {
parent::assert($acl, $role, $resource, $privilege); $role = $this->getRole();
if ($role instanceof Role && isset($page['privilege'])){
return $role->hasPrivilege($page['privilege']);
}
return true; return true;
} }
protected function assertClotureSaisie( Intervenant $intervenant=null )
{
if (!$intervenant) return false;
if (!$this->assertEtapeAtteignable(WfEtape::CODE_CLOTURE_REALISE, $intervenant)){
return false;
}
return true;
}
protected function assertEtapeAtteignable($etape, Intervenant $intervenant = null)
{
if ($intervenant) {
$workflowEtape = $this->getServiceWorkflow()->getEtape($etape, $intervenant);
if (!$workflowEtape || !$workflowEtape->isAtteignable()) { // l'étape doit être atteignable
return false;
}
}
return true;
}
} }
\ No newline at end of file
...@@ -27,7 +27,7 @@ class OffreDeFormationAssertion extends AbstractAssertion ...@@ -27,7 +27,7 @@ class OffreDeFormationAssertion extends AbstractAssertion
// Si le rôle n'est pas renseigné alors on s'en va... // Si le rôle n'est pas renseigné alors on s'en va...
if (!$role instanceof Role) return false; if (!$role instanceof Role) return false;
// pareil si le rôle ne possède pas le privilège adéquat // pareil si le rôle ne possède pas le privilège adéquat
if (!$this->isAllowed(Privileges::getResourceId($privilege))) return false; if ($privilege && !$role->hasPrivilege($privilege)) return false;
// Si c'est bon alors on affine... // Si c'est bon alors on affine...
switch(true){ switch(true){
......
...@@ -44,7 +44,7 @@ class ServiceAssertion extends AbstractAssertion ...@@ -44,7 +44,7 @@ class ServiceAssertion extends AbstractAssertion
// Si le rôle n'est pas renseigné alors on s'en va... // Si le rôle n'est pas renseigné alors on s'en va...
if (!$role instanceof Role) return false; if (!$role instanceof Role) return false;
// pareil si le rôle ne possède pas le privilège adéquat // pareil si le rôle ne possède pas le privilège adéquat
if ($privilege && !$this->isAllowed(Privileges::getResourceId($privilege))) return false; if ($privilege && !$role->hasPrivilege($privilege)) return false;
// Si c'est bon alors on affine... // Si c'est bon alors on affine...
switch (true) { switch (true) {
......
...@@ -46,8 +46,6 @@ class ValidationAssertionProxy extends OldAbstractAssertion ...@@ -46,8 +46,6 @@ class ValidationAssertionProxy extends OldAbstractAssertion
protected function getDelegate() protected function getDelegate()
{ {
switch ($this->resource->getTypeValidation()->getCode()) { switch ($this->resource->getTypeValidation()->getCode()) {
case TypeValidationEntity::CODE_CLOTURE_REALISE:
return $this->getServiceLocator()->get('ClotureRealiseAssertion');
case TypeValidationEntity::CODE_ENSEIGNEMENT: case TypeValidationEntity::CODE_ENSEIGNEMENT:
return $this->getServiceLocator()->get('ValidationServiceAssertion'); return $this->getServiceLocator()->get('ValidationServiceAssertion');
case TypeValidationEntity::CODE_REFERENTIEL: case TypeValidationEntity::CODE_REFERENTIEL:
......
...@@ -150,6 +150,7 @@ class DossierController extends AbstractController ...@@ -150,6 +150,7 @@ class DossierController extends AbstractController
return $this->redirect()->toUrl($url); return $this->redirect()->toUrl($url);
} }
} }
return $this->redirect()->toUrl($this->url()->fromRoute('intervenant/dossier', [], [], true));
} }
} }
......
...@@ -94,8 +94,6 @@ class ValidationController extends AbstractController ...@@ -94,8 +94,6 @@ class ValidationController extends AbstractController
{ {
$this->em()->getFilters()->enable('historique')->init([ $this->em()->getFilters()->enable('historique')->init([
\Application\Entity\Db\Validation::class, \Application\Entity\Db\Validation::class,
\Application\Entity\Db\TypeValidation::class,
\Application\Entity\Db\Dossier::class,
\Application\Entity\Db\Service::class, \Application\Entity\Db\Service::class,
\Application\Entity\Db\VolumeHoraire::class, \Application\Entity\Db\VolumeHoraire::class,
\Application\Entity\Db\ServiceReferentiel::class, \Application\Entity\Db\ServiceReferentiel::class,
...@@ -103,89 +101,7 @@ class ValidationController extends AbstractController ...@@ -103,89 +101,7 @@ class ValidationController extends AbstractController
]); ]);
} }
/**
* Validation ou dévalidation des données personnelles.
* NB : une seule validation pour toutes les composantes.
*
* @return \Zend\Http\Response|ViewModel
*/
public function dossierAction()
{
$prg = $this->prg();
if ($prg instanceof \Zend\Http\Response) {
return $prg;
}
$this->initFilters();
$intervenant = $this->getIntervenant();
$dossier = $intervenant->getDossier();
$role = $this->getServiceContext()->getSelectedIdentityRole();
$serviceValidation = $this->getServiceValidation();
$typeValidation = TypeValidation::CODE_DONNEES_PERSO;
$this->title = "Validation des données personnelles <small>$intervenant</small>";
// recherche validation existante et instanciation si aucune trouvée
$qb = $serviceValidation->finderByType($typeValidation);
$serviceValidation->finderByIntervenant($intervenant, $qb);
$serviceValidation->finderByHistorique($qb);
$this->validation = $qb->getQuery()->getOneOrNullResult();
if (! $this->validation) {
$this->validation = $serviceValidation->newEntity($typeValidation);
$this->validation
->setIntervenant($intervenant)
->setStructure($intervenant->getStructure());
}
$this->formValider = $this->getFormDossier($this->validation);
$canEdit = $dossier &&
($this->isAllowed($this->validation, 'create') || $this->isAllowed($this->validation, 'delete'));
if ($canEdit && is_array($prg)) {
$data = $prg;
$this->formValider->setData($data);
if ($this->formValider->isValid()) {
$complet = (bool) $data['valide'];
$this->updateValidation($complet);
return $this->redirect()->refresh();
}
}
$this->view = new ViewModel([
'intervenant' => $intervenant,
'dossier' => $dossier,
'validation' => $this->validation,
'form' => $this->formValider,
'role' => $role,
'canEdit' => $canEdit,
'title' => $this->title,
]);
$this->view->formModifier = $this->getFormDossierModifier();
return $this->view;
}
/**
* Interrogation du contrôleur Dossier pour obtenir le formulaire de saisie des données personnelles.
*
* @return \Zend\Form\Form
*/
private function getFormDossierModifier()
{
$controller = 'Application\Controller\Dossier';
$params = $this->getEvent()->getRouteMatch()->getParams();
$params['action'] = 'modifier';
$viewModel = $this->forward()->dispatch($controller, $params); /* @var $viewModel ViewModel */
return $viewModel->form;
}
/** /**
* Validation des enseignements prévisionnels par la composante d'affectation de l'intervenant. * Validation des enseignements prévisionnels par la composante d'affectation de l'intervenant.
...@@ -230,7 +146,7 @@ class ValidationController extends AbstractController ...@@ -230,7 +146,7 @@ class ValidationController extends AbstractController
if (!count($servicesNonValides)) { if (!count($servicesNonValides)) {
$this->validation = current($this->validations); $this->validation = current($this->validations);
if ($role instanceof IntervenantRole) { if ($role->getIntervenant()) {
$message = sprintf( $message = sprintf(
"Tous vos enseignements %s ont été validés.", "Tous vos enseignements %s ont été validés.",
$typeVolumeHoraire->isPrevu() ? "prévisionnels" : "réalisés" $typeVolumeHoraire->isPrevu() ? "prévisionnels" : "réalisés"
...@@ -632,25 +548,6 @@ class ValidationController extends AbstractController ...@@ -632,25 +548,6 @@ class ValidationController extends AbstractController
return compact('entity', 'context', 'title', 'form'); return compact('entity', 'context', 'title', 'form');
} }
/**
*
* @param bool $valide
* @return boolean
*/
protected function updateValidation($valide)
{
if ($valide) {
$this->getServiceValidation()->enregistrerValidationDossier($this->validation);
}
else {
$this->getServiceValidation()->supprimer($this->validation);
}
$this->em()->flush();
$this->flashMessenger()->addSuccessMessage(sprintf("Validation <strong>%s</strong> avec succès.", $valide ? "enregistrée" : "supprimée"));
return $this;
}
/** /**
* @return ServiceValidation * @return ServiceValidation
......
...@@ -61,10 +61,8 @@ ...@@ -61,10 +61,8 @@
<join-column name="HISTO_CREATEUR_ID" referenced-column-name="ID"/> <join-column name="HISTO_CREATEUR_ID" referenced-column-name="ID"/>
</join-columns> </join-columns>
</many-to-one> </many-to-one>
<many-to-one field="intervenant" target-entity="Application\Entity\Db\Intervenant"> <one-to-one field="intervenant" target-entity="Application\Entity\Db\Intervenant" inversed-by="dossier">
<join-columns>
<join-column name="INTERVENANT_ID" referenced-column-name="ID"/> <join-column name="INTERVENANT_ID" referenced-column-name="ID"/>
</join-columns> </one-to-one>
</many-to-one>
</entity> </entity>
</doctrine-mapping> </doctrine-mapping>
...@@ -96,11 +96,7 @@ ...@@ -96,11 +96,7 @@
<join-column name="HISTO_CREATEUR_ID" referenced-column-name="ID"/> <join-column name="HISTO_CREATEUR_ID" referenced-column-name="ID"/>
</join-columns> </join-columns>
</many-to-one> </many-to-one>
<many-to-one field="dossier" target-entity="Application\Entity\Db\Dossier"> <one-to-one field="dossier" target-entity="Application\Entity\Db\Dossier" mapped-by="intervenant" />
<join-columns>
<join-column name="DOSSIER_ID" referenced-column-name="ID"/>
</join-columns>
</many-to-one>
<one-to-many field="affectation" target-entity="Application\Entity\Db\AffectationRecherche" mapped-by="intervenant"/> <one-to-many field="affectation" target-entity="Application\Entity\Db\AffectationRecherche" mapped-by="intervenant"/>
<one-to-many field="adresse" target-entity="Application\Entity\Db\AdresseIntervenant" mapped-by="intervenant"/> <one-to-many field="adresse" target-entity="Application\Entity\Db\AdresseIntervenant" mapped-by="intervenant"/>
<one-to-many field="service" target-entity="Application\Entity\Db\Service" mapped-by="intervenant"/> <one-to-many field="service" target-entity="Application\Entity\Db\Service" mapped-by="intervenant"/>
......
...@@ -30,6 +30,11 @@ ...@@ -30,6 +30,11 @@
<join-column name="TYPE_PIECE_JOINTE_ID" referenced-column-name="ID"/> <join-column name="TYPE_PIECE_JOINTE_ID" referenced-column-name="ID"/>
</join-columns> </join-columns>
</many-to-one> </many-to-one>
<many-to-one field="pieceJointe" target-entity="Application\Entity\Db\PieceJointe" fetch="LAZY">
<join-columns>
<join-column name="PIECE_JOINTE_ID" referenced-column-name="ID"/>
</join-columns>
</many-to-one>
<many-to-one field="intervenant" target-entity="Application\Entity\Db\Intervenant" fetch="LAZY"> <many-to-one field="intervenant" target-entity="Application\Entity\Db\Intervenant" fetch="LAZY">
<join-columns> <join-columns>
<join-column name="INTERVENANT_ID" referenced-column-name="ID"/> <join-column name="INTERVENANT_ID" referenced-column-name="ID"/>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<field name="libelleAutres" type="string" column="LIBELLE_AUTRES" length="256" nullable="false"/> <field name="libelleAutres" type="string" column="LIBELLE_AUTRES" length="256" nullable="false"/>
<field name="ordre" type="integer" column="ORDRE" nullable="false" /> <field name="ordre" type="integer" column="ORDRE" nullable="false" />
<field name="route" type="string" column="ROUTE" length="256" nullable="false"/> <field name="route" type="string" column="ROUTE" length="256" nullable="false"/>
<field name="descNonAtteignable" type="string" column="DESC_NON_ATTEIGNABLE" length="256" nullable="false"/> <field name="obligatoire" type="boolean" column="OBLIGATOIRE" nullable="false"/>
<field name="descNonFranchie" type="string" column="DESC_NON_FRANCHIE" length="256" nullable="false"/>
</entity> </entity>
</doctrine-mapping> </doctrine-mapping>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment