diff --git a/composer.lock b/composer.lock index 4da12536add745918d8c9a363243b9e0276a2bc6..c03167a25b9e34d917b62008884acac18cffb7a5 100644 --- a/composer.lock +++ b/composer.lock @@ -356,16 +356,16 @@ }, { "name": "doctrine/dbal", - "version": "v2.5.4", + "version": "v2.5.5", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769" + "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/abbdfd1cff43a7b99d027af3be709bc8fc7d4769", - "reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9", + "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9", "shasum": "" }, "require": { @@ -374,7 +374,7 @@ }, "require-dev": { "phpunit/phpunit": "4.*", - "symfony/console": "2.*" + "symfony/console": "2.*||^3.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -423,7 +423,7 @@ "persistence", "queryobject" ], - "time": "2016-01-05 22:11:12" + "time": "2016-09-09 19:13:33" }, { "name": "doctrine/doctrine-module", @@ -758,16 +758,16 @@ }, { "name": "doctrine/orm", - "version": "v2.5.4", + "version": "v2.5.5", "source": { "type": "git", "url": "https://github.com/doctrine/doctrine2.git", - "reference": "bc4ddbfb0114cb33438cc811c9a740d8aa304aab" + "reference": "73e4be7c7b3ba26f96b781a40b33feba4dfa6d45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/bc4ddbfb0114cb33438cc811c9a740d8aa304aab", - "reference": "bc4ddbfb0114cb33438cc811c9a740d8aa304aab", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/73e4be7c7b3ba26f96b781a40b33feba4dfa6d45", + "reference": "73e4be7c7b3ba26f96b781a40b33feba4dfa6d45", "shasum": "" }, "require": { @@ -830,7 +830,7 @@ "database", "orm" ], - "time": "2016-01-05 21:34:58" + "time": "2016-09-10 18:51:13" }, { "name": "jasig/phpcas", @@ -1066,16 +1066,16 @@ }, { "name": "symfony/console", - "version": "v3.1.2", + "version": "v3.1.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "747154aa69b0f83cd02fc9aa554836dee417631a" + "reference": "8ea494c34f0f772c3954b5fbe00bffc5a435e563" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/747154aa69b0f83cd02fc9aa554836dee417631a", - "reference": "747154aa69b0f83cd02fc9aa554836dee417631a", + "url": "https://api.github.com/repos/symfony/console/zipball/8ea494c34f0f772c3954b5fbe00bffc5a435e563", + "reference": "8ea494c34f0f772c3954b5fbe00bffc5a435e563", "shasum": "" }, "require": { @@ -1122,7 +1122,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-06-29 07:02:31" + "time": "2016-08-19 06:48:39" }, { "name": "symfony/polyfill-mbstring", @@ -1185,16 +1185,16 @@ }, { "name": "symfony/process", - "version": "v2.8.8", + "version": "v2.8.11", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "89f33c16796415ccfd8bb3cf8d520cbb79899bfe" + "reference": "05a03ed27073638658cab9405d99a67dd1014987" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/89f33c16796415ccfd8bb3cf8d520cbb79899bfe", - "reference": "89f33c16796415ccfd8bb3cf8d520cbb79899bfe", + "url": "https://api.github.com/repos/symfony/process/zipball/05a03ed27073638658cab9405d99a67dd1014987", + "reference": "05a03ed27073638658cab9405d99a67dd1014987", "shasum": "" }, "require": { @@ -1230,7 +1230,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:29:29" + "time": "2016-09-06 10:55:00" }, { "name": "unicaen/unicaen-app", @@ -1238,7 +1238,7 @@ "source": { "type": "svn", "url": "https://svn.unicaen.fr/svn/UnicaenApp", - "reference": "/trunk/@714" + "reference": "/trunk/@720" }, "require": { "doctrine/doctrine-orm-module": ">=0.7", @@ -1281,7 +1281,7 @@ ] }, "description": "Module commun aux applis ZF2 de l'UCBN", - "time": "2016-06-10 15:26:34" + "time": "2016-09-15 14:26:18" }, { "name": "unicaen/unicaen-auth", @@ -1289,7 +1289,7 @@ "source": { "type": "svn", "url": "https://svn.unicaen.fr/svn/UnicaenAuth", - "reference": "/trunk/@288" + "reference": "/trunk/@300" }, "require": { "bjyoungblood/bjy-authorize": ">=1.4", @@ -1311,7 +1311,7 @@ ] }, "description": "Module d'authentification pour les applis ZF2 de l'UCBN", - "time": "2016-06-24 11:49:10" + "time": "2016-09-09 12:15:12" }, { "name": "unicaen/unicaen-code", @@ -1319,7 +1319,7 @@ "source": { "type": "svn", "url": "https://svn.unicaen.fr/svn/UnicaenCode", - "reference": "/trunk/@35" + "reference": "/trunk/@37" }, "require": { "zendframework/zend-developer-tools": ">=1.0" @@ -1339,7 +1339,7 @@ ] }, "description": "Boite à outils pour la programmation avec la bibliothèque Unicaen", - "time": "2016-07-01 12:19:01" + "time": "2016-09-02 16:54:48" }, { "name": "unicaen/unicaen-import", @@ -1347,7 +1347,7 @@ "source": { "type": "svn", "url": "https://svn.unicaen.fr/svn/UnicaenImport", - "reference": "/trunk/@14" + "reference": "/trunk/@19" }, "require-dev": { "phpunit/phpunit": ">=3.7" @@ -1363,7 +1363,7 @@ ] }, "description": "Boite à outils pour la programmation avec la bibliothèque Unicaen", - "time": "2016-05-20 14:06:59" + "time": "2016-09-16 11:01:01" }, { "name": "zendframework/zend-authentication", @@ -4093,16 +4093,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.26", + "version": "4.8.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74" + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74", - "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90", + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90", "shasum": "" }, "require": { @@ -4161,7 +4161,7 @@ "testing", "xunit" ], - "time": "2016-05-17 03:09:28" + "time": "2016-07-21 06:48:14" }, { "name": "phpunit/phpunit-mock-objects", @@ -4337,23 +4337,23 @@ }, { "name": "sebastian/environment", - "version": "1.3.7", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { @@ -4383,7 +4383,7 @@ "environment", "hhvm" ], - "time": "2016-05-17 03:18:57" + "time": "2016-08-18 05:49:44" }, { "name": "sebastian/exporter", @@ -4593,16 +4593,16 @@ }, { "name": "symfony/yaml", - "version": "v3.1.2", + "version": "v3.1.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de" + "reference": "f291ed25eb1435bddbe8a96caaef16469c2a092d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de", - "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de", + "url": "https://api.github.com/repos/symfony/yaml/zipball/f291ed25eb1435bddbe8a96caaef16469c2a092d", + "reference": "f291ed25eb1435bddbe8a96caaef16469c2a092d", "shasum": "" }, "require": { @@ -4638,32 +4638,33 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:41:56" + "time": "2016-09-02 02:12:52" }, { "name": "webmozart/assert", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3|^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -4687,7 +4688,7 @@ "check", "validate" ], - "time": "2015-08-24 13:29:44" + "time": "2016-08-09 15:02:57" }, { "name": "zendframework/zend-dom", diff --git a/config/autoload/unicaen-app.global.php b/config/autoload/unicaen-app.global.php index 04a1e170b7339cd1f4144450b5fbbdf6fae7a45c..d662c1fdf6fff0f28cc5b556d9333a5abc6c1d96 100644 --- a/config/autoload/unicaen-app.global.php +++ b/config/autoload/unicaen-app.global.php @@ -12,7 +12,7 @@ $settings = [ 'app_infos' => [ 'nom' => "OSE", 'desc' => "Organisation des Services d'Enseignement", - 'version' => "4.2.2", + 'version' => "4.2.3", 'date' => "21/09/2016", 'contact' => ['mail' => "Contactez votre composante.", /*'tel' => "01 02 03 04 05"*/], 'mentionsLegales' => "http://www.unicaen.fr/outils-portail-institutionnel/mentions-legales/", diff --git a/module/Application/src/Application/Exception/DbException.php b/module/Application/src/Application/Exception/DbException.php index d4f58d95278f5e92e2b30615ad8f46cf72c0b23c..0a3d8c7d5204185a525607c784cc0dc1778fe3d5 100644 --- a/module/Application/src/Application/Exception/DbException.php +++ b/module/Application/src/Application/Exception/DbException.php @@ -25,6 +25,8 @@ class DbException extends RuntimeException { 'Vous ne pouvez pas dévalider ces heures d\'enseignement car des demandes de mise en paiement ou des mises en paiement ont été faites.', 'integrity constraint (OSE.MEP_FR_SERVICE_REF_FK) violated' => 'Vous ne pouvez pas dévalider ces heures de référentiel car des demandes de mise en paiement ou des mises en paiement ont été faites.', + 'unique constraint (OSE.EP_CODE__UN) violated' => + 'Un enseignement existe déjà avec le même code. Merci de choisir un autre code d\'enseignement.', ]; diff --git a/module/Application/src/Application/Provider/Role/RoleProvider.php b/module/Application/src/Application/Provider/Role/RoleProvider.php index 2ac05752ef010f4be3981593ba614c2b8781d5ce..7f2ece88afc2eed943edc26cfe5ed9066dd0cff3 100644 --- a/module/Application/src/Application/Provider/Role/RoleProvider.php +++ b/module/Application/src/Application/Provider/Role/RoleProvider.php @@ -80,7 +80,7 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface - protected function getRolesPrivileges($roleId) + protected function getRolesPrivileges() { if (!$this->rolesPrivileges){ $pr = $this->getPrivilegeProvider()->getPrivilegesRoles(); @@ -93,12 +93,7 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface } } } - - if (isset($this->rolesPrivileges[$roleId])){ - return $this->rolesPrivileges[$roleId]; - }else{ - return []; - } + return $this->rolesPrivileges; } @@ -126,7 +121,7 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface // chargement des rôles métiers $query = $this->getEntityManager()->createQuery( - 'SELECT DISTINCT + 'SELECT DISTINCT r, a, s, p FROM Application\Entity\Db\Role r @@ -138,12 +133,15 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface )->setParameter(':personnel', $personnel); $result = $query->getResult(); + $rolesPrivileges = $this->getRolesPrivileges(); foreach ($result as $dbRole) { /* @var $dbRole \Application\Entity\Db\Role */ $roleId = $dbRole->getRoleId(); $role = new Role($roleId, 'user', $dbRole->getLibelle()); - $role->initPrivileges($this->getRolesPrivileges($roleId)); + if (isset($rolesPrivileges[$roleId])){ + $role->initPrivileges($rolesPrivileges[$roleId]); + } if ($dbRole->getPeutChangerStructure()){ $role->setPeutChangerStructure(true); @@ -168,7 +166,9 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface if (!isset($roles[$affRoleId])) { $affRoleLibelle = $dbRole->getLibelle() . ' (' . $structure->getLibelleCourt() . ')'; $affRole = new \Application\Acl\Role($affRoleId, $roleId, $affRoleLibelle); - $role->initPrivileges($this->getRolesPrivileges($roleId)); + if (isset($rolesPrivileges[$roleId])){ + $affRole->initPrivileges($rolesPrivileges[$roleId]); + } $affRole->setDbRole( $dbRole ); $affRole->setPersonnel($personnel); $affRole->setStructure($structure); @@ -186,7 +186,9 @@ class RoleProvider implements ProviderInterface, EntityManagerAwareInterface if ($intervenant) { if ($intervenant->getStatut()->getId() == $statut['statut-id']) { $role->setIntervenant($intervenant); - $role->initPrivileges($this->getRolesPrivileges($intervenant->getStatut()->getRoleId())); + if (isset($rolesPrivileges[$intervenant->getStatut()->getRoleId()])){ + $role->initPrivileges($rolesPrivileges[$intervenant->getStatut()->getRoleId()]); + } } } $roles[$statut['role-id']] = $role;