Commit ff11addd by Julien Jorry

BO : add translation on admin + add admin css + fix bugs on…

BO : add translation on admin + add admin css + fix bugs on user/adherent/prestataire + update schema for flux
parent 74ee6743
.traductions .container {
width: 100%;
max-width: 100%;
}
\ No newline at end of file
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/
// any CSS you require will output into a single css file (app.css in this case)
require('../css/admin.css');
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
// var $ = require('jquery');
...@@ -10,5 +10,3 @@ require('../css/app.css'); ...@@ -10,5 +10,3 @@ require('../css/app.css');
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it. // Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
// var $ = require('jquery'); // var $ = require('jquery');
console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "1497e93cb43daaebdc5729c587b19e48", "content-hash": "4f9f14bbf95662cc721ee28c2bf26582",
"packages": [ "packages": [
{ {
"name": "behat/transliterator", "name": "behat/transliterator",
...@@ -718,31 +718,35 @@ ...@@ -718,31 +718,35 @@
}, },
{ {
"name": "doctrine/doctrine-migrations-bundle", "name": "doctrine/doctrine-migrations-bundle",
"version": "v1.3.2", "version": "v2.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/DoctrineMigrationsBundle.git", "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git",
"reference": "49fa399181db4bf4f9f725126bd1cb65c4398dce" "reference": "4c9579e0e43df1fb3f0ca29b9c20871c824fac71"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/49fa399181db4bf4f9f725126bd1cb65c4398dce", "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/4c9579e0e43df1fb3f0ca29b9c20871c824fac71",
"reference": "49fa399181db4bf4f9f725126bd1cb65c4398dce", "reference": "4c9579e0e43df1fb3f0ca29b9c20871c824fac71",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/doctrine-bundle": "~1.0", "doctrine/doctrine-bundle": "~1.0",
"doctrine/migrations": "^1.1", "doctrine/migrations": "^2.0",
"php": ">=5.4.0", "php": "^7.1",
"symfony/framework-bundle": "~2.7|~3.3|~4.0" "symfony/framework-bundle": "~3.4|~4.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^7.4" "doctrine/coding-standard": "^5.0",
"mikey179/vfsstream": "^1.6",
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-strict-rules": "^0.9",
"phpunit/phpunit": "^5.7|^6.4|^7.0"
}, },
"type": "symfony-bundle", "type": "symfony-bundle",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.3-dev" "dev-master": "2.0.x-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -769,13 +773,13 @@ ...@@ -769,13 +773,13 @@
} }
], ],
"description": "Symfony DoctrineMigrationsBundle", "description": "Symfony DoctrineMigrationsBundle",
"homepage": "http://www.doctrine-project.org", "homepage": "https://www.doctrine-project.org",
"keywords": [ "keywords": [
"dbal", "dbal",
"migrations", "migrations",
"schema" "schema"
], ],
"time": "2018-12-03T11:55:33+00:00" "time": "2019-01-09T18:49:50+00:00"
}, },
{ {
"name": "doctrine/event-manager", "name": "doctrine/event-manager",
...@@ -1028,32 +1032,39 @@ ...@@ -1028,32 +1032,39 @@
}, },
{ {
"name": "doctrine/migrations", "name": "doctrine/migrations",
"version": "v1.8.1", "version": "v2.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/migrations.git", "url": "https://github.com/doctrine/migrations.git",
"reference": "215438c0eef3e5f9b7da7d09c6b90756071b43e6" "reference": "0101f5bd7f4e5043bf8630db2930f8fd7da552b6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/215438c0eef3e5f9b7da7d09c6b90756071b43e6", "url": "https://api.github.com/repos/doctrine/migrations/zipball/0101f5bd7f4e5043bf8630db2930f8fd7da552b6",
"reference": "215438c0eef3e5f9b7da7d09c6b90756071b43e6", "reference": "0101f5bd7f4e5043bf8630db2930f8fd7da552b6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/dbal": "~2.6", "doctrine/dbal": "^2.6",
"ocramius/proxy-manager": "^1.0|^2.0", "ocramius/package-versions": "^1.3",
"ocramius/proxy-manager": "^2.0.2",
"php": "^7.1", "php": "^7.1",
"symfony/console": "~3.3|^4.0" "symfony/console": "^3.4||^4.0",
"symfony/stopwatch": "^3.4||^4.0"
}, },
"require-dev": { "require-dev": {
"doctrine/coding-standard": "^1.0", "doctrine/coding-standard": "^5.0",
"doctrine/orm": "~2.5", "doctrine/orm": "^2.6",
"jdorn/sql-formatter": "~1.1", "ext-pdo_sqlite": "*",
"jdorn/sql-formatter": "^1.1",
"mikey179/vfsstream": "^1.6", "mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "~7.0", "phpstan/phpstan": "^0.10",
"squizlabs/php_codesniffer": "^3.0", "phpstan/phpstan-deprecation-rules": "^0.10",
"symfony/yaml": "~3.3|^4.0" "phpstan/phpstan-phpunit": "^0.10",
"phpstan/phpstan-strict-rules": "^0.10",
"phpunit/phpunit": "^7.0",
"symfony/process": "^3.4||^4.0",
"symfony/yaml": "^3.4||^4.0"
}, },
"suggest": { "suggest": {
"jdorn/sql-formatter": "Allows to generate formatted SQL with the diff command.", "jdorn/sql-formatter": "Allows to generate formatted SQL with the diff command.",
...@@ -1065,12 +1076,11 @@ ...@@ -1065,12 +1076,11 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "v1.8.x-dev" "dev-master": "2.0.x-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Doctrine\\DBAL\\Migrations\\": "lib/Doctrine/DBAL/Migrations",
"Doctrine\\Migrations\\": "lib/Doctrine/Migrations" "Doctrine\\Migrations\\": "lib/Doctrine/Migrations"
} }
}, },
...@@ -1092,13 +1102,15 @@ ...@@ -1092,13 +1102,15 @@
"email": "contact@mikesimonson.com" "email": "contact@mikesimonson.com"
} }
], ],
"description": "Database Schema migrations using Doctrine DBAL", "description": "PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.",
"homepage": "https://www.doctrine-project.org/projects/migrations.html", "homepage": "https://www.doctrine-project.org/projects/migrations.html",
"keywords": [ "keywords": [
"database", "database",
"migrations" "dbal",
"migrations",
"php"
], ],
"time": "2018-06-06T21:00:30+00:00" "time": "2019-01-03T18:59:09+00:00"
}, },
{ {
"name": "doctrine/orm", "name": "doctrine/orm",
...@@ -3042,6 +3054,72 @@ ...@@ -3042,6 +3054,72 @@
"time": "2018-03-19T10:34:40+00:00" "time": "2018-03-19T10:34:40+00:00"
}, },
{ {
"name": "lexik/translation-bundle",
"version": "v4.0.13",
"source": {
"type": "git",
"url": "https://github.com/lexik/LexikTranslationBundle.git",
"reference": "91d18448a460a42b467be0b22ea5b47e11d42856"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lexik/LexikTranslationBundle/zipball/91d18448a460a42b467be0b22ea5b47e11d42856",
"reference": "91d18448a460a42b467be0b22ea5b47e11d42856",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"symfony/framework-bundle": "~2.8|~3.0|~4.0"
},
"require-dev": {
"doctrine/data-fixtures": "~1.1",
"doctrine/doctrine-bundle": "~1.2",
"doctrine/mongodb-odm-bundle": "~3.0",
"doctrine/orm": "^2.2.3",
"phpunit/phpunit": "^5.7",
"propel/propel": "@dev",
"propel/propel-bundle": "^3.0@dev|^4.0@dev"
},
"suggest": {
"doctrine/mongodb-odm-bundle": "~3.0",
"doctrine/orm": ">=2.4"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "4.x.x-dev"
}
},
"autoload": {
"psr-4": {
"Lexik\\Bundle\\TranslationBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dev Lexik",
"email": "dev@lexik.fr"
},
{
"name": "Cedric Girard",
"email": "c.girard@lexik.fr"
}
],
"description": "This bundle allows to import translation files content into the database and provide a GUI to edit translations.",
"homepage": "https://github.com/lexik/LexikTranslationBundle",
"keywords": [
"Symfony2",
"bundle",
"i18n",
"translation"
],
"time": "2018-12-17T08:07:15+00:00"
},
{
"name": "liip/imagine-bundle", "name": "liip/imagine-bundle",
"version": "2.1.0", "version": "2.1.0",
"source": { "source": {
...@@ -4797,16 +4875,16 @@ ...@@ -4797,16 +4875,16 @@
}, },
{ {
"name": "sonata-project/core-bundle", "name": "sonata-project/core-bundle",
"version": "3.14.0", "version": "3.14.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sonata-project/SonataCoreBundle.git", "url": "https://github.com/sonata-project/SonataCoreBundle.git",
"reference": "d1b6800485b98eb40ef3d8bb039b77e8bf0beb03" "reference": "b38dfe1709c02cb9bb95f38c48103803f0aaaf3c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sonata-project/SonataCoreBundle/zipball/d1b6800485b98eb40ef3d8bb039b77e8bf0beb03", "url": "https://api.github.com/repos/sonata-project/SonataCoreBundle/zipball/b38dfe1709c02cb9bb95f38c48103803f0aaaf3c",
"reference": "d1b6800485b98eb40ef3d8bb039b77e8bf0beb03", "reference": "b38dfe1709c02cb9bb95f38c48103803f0aaaf3c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -4877,7 +4955,7 @@ ...@@ -4877,7 +4955,7 @@
"keywords": [ "keywords": [
"sonata" "sonata"
], ],
"time": "2019-01-13T14:19:40+00:00" "time": "2019-01-17T07:33:02+00:00"
}, },
{ {
"name": "sonata-project/datagrid-bundle", "name": "sonata-project/datagrid-bundle",
...@@ -4940,21 +5018,21 @@ ...@@ -4940,21 +5018,21 @@
}, },
{ {
"name": "sonata-project/doctrine-extensions", "name": "sonata-project/doctrine-extensions",
"version": "1.1.3", "version": "1.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sonata-project/sonata-doctrine-extensions.git", "url": "https://github.com/sonata-project/sonata-doctrine-extensions.git",
"reference": "08783be96a515331468ad460b041529bc7220737" "reference": "1f619e6f5a27b5bbaa48ab0872b19dc2064bc03f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sonata-project/sonata-doctrine-extensions/zipball/08783be96a515331468ad460b041529bc7220737", "url": "https://api.github.com/repos/sonata-project/sonata-doctrine-extensions/zipball/1f619e6f5a27b5bbaa48ab0872b19dc2064bc03f",
"reference": "08783be96a515331468ad460b041529bc7220737", "reference": "1f619e6f5a27b5bbaa48ab0872b19dc2064bc03f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/dbal": "^2.2", "doctrine/dbal": "^2.2",
"php": "^5.6 || ^7.0" "php": "^7.1"
}, },
"require-dev": { "require-dev": {
"doctrine/common": "^2.7", "doctrine/common": "^2.7",
...@@ -4964,7 +5042,7 @@ ...@@ -4964,7 +5042,7 @@
"symfony/dependency-injection": "^2.8 || ^3.3 || ^4.0", "symfony/dependency-injection": "^2.8 || ^3.3 || ^4.0",
"symfony/expression-language": "^2.8 || ^3.3 || ^4.0", "symfony/expression-language": "^2.8 || ^3.3 || ^4.0",
"symfony/framework-bundle": "^2.8 || ^3.3 || ^4.0", "symfony/framework-bundle": "^2.8 || ^3.3 || ^4.0",
"symfony/phpunit-bridge": "^4.0" "symfony/phpunit-bridge": "^4.2"
}, },
"suggest": { "suggest": {
"doctrine/orm": "If you use doctrine orm", "doctrine/orm": "If you use doctrine orm",
...@@ -5004,7 +5082,7 @@ ...@@ -5004,7 +5082,7 @@
"doctrine2", "doctrine2",
"json" "json"
], ],
"time": "2018-12-16T22:06:10+00:00" "time": "2019-01-15T23:01:57+00:00"
}, },
{ {
"name": "sonata-project/doctrine-orm-admin-bundle", "name": "sonata-project/doctrine-orm-admin-bundle",
...@@ -5222,6 +5300,78 @@ ...@@ -5222,6 +5300,78 @@
"time": "2019-01-10T19:05:17+00:00" "time": "2019-01-10T19:05:17+00:00"
}, },
{ {
"name": "sonata-project/intl-bundle",
"version": "2.5.0",
"source": {
"type": "git",
"url": "https://github.com/sonata-project/SonataIntlBundle.git",
"reference": "1548e0eef68841088867e3a7c5d90a625922c14e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sonata-project/SonataIntlBundle/zipball/1548e0eef68841088867e3a7c5d90a625922c14e",
"reference": "1548e0eef68841088867e3a7c5d90a625922c14e",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"symfony/config": "^2.8 || ^3.2 || ^4.0",
"symfony/dependency-injection": "^2.8 || ^3.2 || ^4.0",
"symfony/http-foundation": "^2.8 || ^3.2 || ^4.0",
"symfony/http-kernel": "^2.8 || ^3.2 || ^4.0",
"symfony/intl": "^2.8 || ^3.2 || ^4.0",
"symfony/templating": "^2.8 || ^3.2 || ^4.0",
"twig/twig": "^1.12 || ^2.0"
},
"conflict": {
"sonata-project/user-bundle": "<2.0 || >=5.0"
},
"require-dev": {
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
"sonata-project/user-bundle": "^3.6 || ^4.0",
"symfony/phpunit-bridge": "^4.0",
"symfony/security-core": "^2.8 || ^3.2 || ^4.0"
},
"suggest": {
"sonata-project/user-bundle": "For user timezone detection"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Sonata\\IntlBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sonata Community",
"homepage": "https://github.com/sonata-project/SonataIntlBundle/contributors"
},
{
"name": "Thomas Rabaix",
"email": "thomas.rabaix@sonata-project.org"
}
],
"description": "Symfony SonataIntlBundle",
"homepage": "https://sonata-project.org/bundles/intl",
"keywords": [
"date",
"intl",
"number",
"sonata",
"time"
],
"time": "2018-06-16T16:09:27+00:00"
},
{
"name": "sonata-project/media-bundle", "name": "sonata-project/media-bundle",
"version": "3.17.1", "version": "3.17.1",
"source": { "source": {
...@@ -5346,6 +5496,87 @@ ...@@ -5346,6 +5496,87 @@
"time": "2019-01-12T12:11:00+00:00" "time": "2019-01-12T12:11:00+00:00"
}, },
{ {
"name": "sonata-project/translation-bundle",
"version": "2.4.0",
"source": {
"type": "git",
"url": "https://github.com/sonata-project/SonataTranslationBundle.git",
"reference": "6086b4d380dc463c68db3630d9ae7c2017f871fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sonata-project/SonataTranslationBundle/zipball/6086b4d380dc463c68db3630d9ae7c2017f871fe",
"reference": "6086b4d380dc463c68db3630d9ae7c2017f871fe",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"sonata-project/admin-bundle": "^3.28",
"sonata-project/block-bundle": "^3.11",
"sonata-project/core-bundle": "^3.7.1",
"symfony/config": "^2.8 || ^3.2 || ^4.0",
"symfony/dependency-injection": "^2.8 || ^3.2 || ^4.0",
"symfony/form": "^2.8 || ^3.2 || ^4.0",
"symfony/http-foundation": "^2.8 || ^3.2 || ^4.0",
"symfony/http-kernel": "^2.8 || ^3.2 || ^4.0",
"symfony/options-resolver": "^2.8 || ^3.2 || ^4.0",
"twig/twig": "^1.35 || ^2.4"
},
"conflict": {
"doctrine/phpcr-odm": ">=3.0",
"knplabs/doctrine-behaviors": "<1.0 || >=2.0",
"stof/doctrine-extensions-bundle": "<1.1 || >=2.0"
},
"require-dev": {
"doctrine/orm": "^2.5",
"knplabs/doctrine-behaviors": "^1.4",
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
"sonata-project/doctrine-orm-admin-bundle": "^3.2",
"stof/doctrine-extensions-bundle": "^1.1",
"symfony/framework-bundle": "^2.8 || ^3.2 || ^4.0",
"symfony/phpunit-bridge": "^4.1"
},
"suggest": {
"doctrine/phpcr-odm": "if you translate odm documents",
"knplabs/doctrine-behaviors": "if you translate orm entities with the knplabs behaviours",
"sonata-project/doctrine-orm-admin-bundle": "if you translate orm entities and search on translated fields",
"stof/doctrine-extensions-bundle": "if you translate orm entities with the gedmo extensions"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Sonata\\TranslationBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Bastien",
"email": "nbastien.pro@gmail.com",
"homepage": "https://github.com/nicolas-bastien"
},
{
"name": "Sonata Community",
"homepage": "https://github.com/sonata-project/SonataTranslationBundle/contributors"
}
],
"description": "SonataTranslationBundle",
"homepage": "http://sonata-project.org/bundles/translation",
"keywords": [
"i18n",
"translation"
],
"time": "2018-12-03T19:10:00+00:00"
},
{
"name": "sonata-project/user-bundle", "name": "sonata-project/user-bundle",
"version": "4.2.3", "version": "4.2.3",
"source": { "source": {
...@@ -7065,21 +7296,21 @@ ...@@ -7065,21 +7296,21 @@
}, },
{ {
"name": "symfony/orm-pack", "name": "symfony/orm-pack",
"version": "v1.0.5", "version": "v1.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/orm-pack.git", "url": "https://github.com/symfony/orm-pack.git",
"reference": "1b58f752cd917a08c9c8df020781d9c46a2275b1" "reference": "36c2a928482dc5f05c5c1c1b947242ae03ff1335"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/orm-pack/zipball/1b58f752cd917a08c9c8df020781d9c46a2275b1", "url": "https://api.github.com/repos/symfony/orm-pack/zipball/36c2a928482dc5f05c5c1c1b947242ae03ff1335",
"reference": "1b58f752cd917a08c9c8df020781d9c46a2275b1", "reference": "36c2a928482dc5f05c5c1c1b947242ae03ff1335",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/doctrine-bundle": "^1.6.10", "doctrine/doctrine-bundle": "^1.6.10",
"doctrine/doctrine-migrations-bundle": "^1.3", "doctrine/doctrine-migrations-bundle": "^1.3|^2.0",
"doctrine/orm": "^2.5.11", "doctrine/orm": "^2.5.11",
"php": "^7.0" "php": "^7.0"
}, },
...@@ -7089,7 +7320,7 @@ ...@@ -7089,7 +7320,7 @@
"MIT" "MIT"
], ],
"description": "A pack for the Doctrine ORM", "description": "A pack for the Doctrine ORM",
"time": "2017-12-12T01:47:50+00:00" "time": "2019-01-16T09:49:15+00:00"
}, },
{ {
"name": "symfony/polyfill-intl-icu", "name": "symfony/polyfill-intl-icu",
...@@ -7981,6 +8212,56 @@ ...@@ -7981,6 +8212,56 @@
"time": "2018-12-10T12:14:14+00:00" "time": "2018-12-10T12:14:14+00:00"
}, },
{ {
"name": "symfony/stopwatch",
"version": "v4.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
"reference": "af62b35760fc92c8dbdce659b4eebdfe0e6a0472"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/af62b35760fc92c8dbdce659b4eebdfe0e6a0472",
"reference": "af62b35760fc92c8dbdce659b4eebdfe0e6a0472",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/contracts": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.2-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Stopwatch\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
"time": "2019-01-03T09:07:35+00:00"
},
{
"name": "symfony/swiftmailer-bundle", "name": "symfony/swiftmailer-bundle",
"version": "v3.2.5", "version": "v3.2.5",
"source": { "source": {
...@@ -8561,33 +8842,40 @@ ...@@ -8561,33 +8842,40 @@
}, },
{ {
"name": "symfony/webpack-encore-bundle", "name": "symfony/webpack-encore-bundle",
"version": "v1.0.0", "version": "v1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/webpack-encore-bundle.git", "url": "https://github.com/symfony/webpack-encore-bundle.git",
"reference": "ebe7747897d664ff06fe6845bf2ce94f7a60513f" "reference": "9c89795a4577c522101206a1a88272660735257c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/webpack-encore-bundle/zipball/ebe7747897d664ff06fe6845bf2ce94f7a60513f", "url": "https://api.github.com/repos/symfony/webpack-encore-bundle/zipball/9c89795a4577c522101206a1a88272660735257c",
"reference": "ebe7747897d664ff06fe6845bf2ce94f7a60513f", "reference": "9c89795a4577c522101206a1a88272660735257c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1.3", "php": "^7.1.3",
"symfony/asset": "^3.4 || ^4.0", "symfony/asset": "^3.4 || ^4.0",
"symfony/config": "^3.4 || ^4.0", "symfony/config": "^3.4 || ^4.0",
"symfony/contracts": "^1.0",
"symfony/dependency-injection": "^3.4 || ^4.0", "symfony/dependency-injection": "^3.4 || ^4.0",
"symfony/http-kernel": "^3.4 || ^4.0" "symfony/http-kernel": "^3.4 || ^4.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^2.13", "friendsofphp/php-cs-fixer": "^2.14",
"symfony/framework-bundle": "^3.4 || ^4.0", "symfony/framework-bundle": "^3.4 || ^4.0",
"symfony/phpunit-bridge": "^3.4 || ^4.1", "symfony/phpunit-bridge": "^3.4 || ^4.1",
"symfony/twig-bundle": "^3.4 || ^4.0", "symfony/twig-bundle": "^3.4 || ^4.0",
"twig/twig": "^1.35 || ^2.0" "twig/twig": "^1.35 || ^2.0"
}, },
"type": "symfony-bundle", "type": "symfony-bundle",
"extra": {
"thanks": {
"name": "symfony/webpack-encore",
"url": "https://github.com/symfony/webpack-encore"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Symfony\\WebpackEncoreBundle\\": "src" "Symfony\\WebpackEncoreBundle\\": "src"
...@@ -8604,7 +8892,7 @@ ...@@ -8604,7 +8892,7 @@
} }
], ],
"description": "Integration with your Symfony app & Webpack Encore!", "description": "Integration with your Symfony app & Webpack Encore!",
"time": "2018-11-03T19:31:51+00:00" "time": "2019-01-17T02:29:30+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
...@@ -10539,16 +10827,16 @@ ...@@ -10539,16 +10827,16 @@
}, },
{ {
"name": "symfony/maker-bundle", "name": "symfony/maker-bundle",
"version": "v1.11.2", "version": "v1.11.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/maker-bundle.git", "url": "https://github.com/symfony/maker-bundle.git",
"reference": "24b19cccad0c658eca516b35b08668d123fabf92" "reference": "08fabae78050d2fe71341d0edc3872bddf03482f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/maker-bundle/zipball/24b19cccad0c658eca516b35b08668d123fabf92", "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/08fabae78050d2fe71341d0edc3872bddf03482f",
"reference": "24b19cccad0c658eca516b35b08668d123fabf92", "reference": "08fabae78050d2fe71341d0edc3872bddf03482f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -10601,7 +10889,7 @@ ...@@ -10601,7 +10889,7 @@
"scaffold", "scaffold",
"scaffolding" "scaffolding"
], ],
"time": "2019-01-05T04:30:01+00:00" "time": "2019-01-17T02:02:27+00:00"
}, },
{ {
"name": "symfony/panther", "name": "symfony/panther",
...@@ -10822,56 +11110,6 @@ ...@@ -10822,56 +11110,6 @@
"time": "2018-12-10T12:11:44+00:00" "time": "2018-12-10T12:11:44+00:00"
}, },
{ {
"name": "symfony/stopwatch",
"version": "v4.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
"reference": "af62b35760fc92c8dbdce659b4eebdfe0e6a0472"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/af62b35760fc92c8dbdce659b4eebdfe0e6a0472",
"reference": "af62b35760fc92c8dbdce659b4eebdfe0e6a0472",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/contracts": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.2-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Stopwatch\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
"time": "2019-01-03T09:07:35+00:00"
},
{
"name": "symfony/test-pack", "name": "symfony/test-pack",
"version": "v1.0.5", "version": "v1.0.5",
"source": { "source": {
......
...@@ -40,4 +40,7 @@ return [ ...@@ -40,4 +40,7 @@ return [
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
App\Application\Sonata\MediaBundle\ApplicationSonataMediaBundle::class => ['all' => true], App\Application\Sonata\MediaBundle\ApplicationSonataMediaBundle::class => ['all' => true],
Bazinga\GeocoderBundle\BazingaGeocoderBundle::class => ['all' => true], Bazinga\GeocoderBundle\BazingaGeocoderBundle::class => ['all' => true],
Sonata\TranslationBundle\SonataTranslationBundle::class => ['all' => true],
Sonata\IntlBundle\SonataIntlBundle::class => ['all' => true],
Lexik\Bundle\TranslationBundle\LexikTranslationBundle::class => ['all' => true]
]; ];
lexik_translation:
fallback_locale: [fr]
managed_locales: [fr,en]
storage:
type: orm
base_layout: "/bundles/LexikTranslationBundle/layout.html.twig"
exporter:
use_yml_tree: true
\ No newline at end of file
...@@ -103,6 +103,6 @@ security: ...@@ -103,6 +103,6 @@ security:
# Secured part of the site # Secured part of the site
# This config requires being logged for the whole site and having the admin role for the admin part. # This config requires being logged for the whole site and having the admin role for the admin part.
# Change these rules to adapt them to your needs # Change these rules to adapt them to your needs
- { path: ^/admin/, role: [ROLE_ADMIN, ROLE_SUPER_ADMIN, ROLE_SONATA_ADMIN] } - { path: ^/admin/, role: [ROLE_ADMIN, ROLE_SUPER_ADMIN, ROLE_SONATA_ADMIN, ROLE_ADMIN_SIEGE, ROLE_REDACTEUR, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT] }
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
...@@ -17,10 +17,11 @@ sonata_user: ...@@ -17,10 +17,11 @@ sonata_user:
sonata_block: sonata_block:
default_contexts: [sonata_page_bundle] default_contexts: [sonata_page_bundle]
blocks: blocks:
sonata.block.service.text:
contexts: [admin]
sonata.admin.block.stats:
contexts: [admin]
sonata.admin.block.admin_list: sonata.admin.block.admin_list:
contexts: [admin] contexts: [admin]
sonata.admin.block.search_result:
#sonata.admin_doctrine_orm.block.audit: contexts: [admin]
# contexts: [admin] \ No newline at end of file
sonata.block.service.text:
\ No newline at end of file
...@@ -42,6 +42,8 @@ sonata_admin: ...@@ -42,6 +42,8 @@ sonata_admin:
# button_history: '@SonataAdmin/Button/history_button.html.twig' # button_history: '@SonataAdmin/Button/history_button.html.twig'
# button_list: '@SonataAdmin/Button/list_button.html.twig' # button_list: '@SonataAdmin/Button/list_button.html.twig'
# button_show: '@SonataAdmin/Button/show_button.html.twig' # button_show: '@SonataAdmin/Button/show_button.html.twig'
assets:
extra_stylesheets: ['build/admin.css']
dashboard: dashboard:
# DASHBOARD de l'admin # DASHBOARD de l'admin
# #
...@@ -65,11 +67,12 @@ sonata_admin: ...@@ -65,11 +67,12 @@ sonata_admin:
# type: sonata.admin.block.stats # type: sonata.admin.block.stats
# settings: # settings:
# code: admin.adherent.gerer # code: admin.adherent.gerer
# icon: fas fa-user-tie # icon: fas fa-user
# text: Adherents # text: Adherents
# color: bg-info # color: bg-info
# filters: # filters:
# enabled: { value: 1 } # enabled: { value: 1 }
# _per_page: { value: 32 }
# - # -
# class: col-xs-4 col-md-3 # class: col-xs-4 col-md-3
# position: top # position: top
...@@ -159,6 +162,7 @@ sonata_admin: ...@@ -159,6 +162,7 @@ sonata_admin:
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT ] roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT ]
items: items:
- admin.prestataire.gerer - admin.prestataire.gerer
# - admin.prestataired.gerer
- admin.prestataire.cotisations - admin.prestataire.cotisations
- admin.groupepresta.gerer - admin.groupepresta.gerer
sonata.admin.group.groupe: sonata.admin.group.groupe:
...@@ -213,6 +217,15 @@ sonata_admin: ...@@ -213,6 +217,15 @@ sonata_admin:
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT, ROLE_REDACTEUR ] roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_TRESORIER, ROLE_GESTION_GROUPE, ROLE_COMPTOIR, ROLE_CONTACT, ROLE_REDACTEUR ]
items: items:
- admin.faq.gerer - admin.faq.gerer
sonata.admin.group.traduction:
keep_open: false
on_top: true
label: "Traductions"
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-flag"></i>'
roles: [ ROLE_SUPER_ADMIN, ROLE_ADMIN_SIEGE, ROLE_REDACTEUR ]
items:
- admin.traduction.gerer
# Gérer l'affichage du menu de l'admin en fonction des roles # Gérer l'affichage du menu de l'admin en fonction des roles
# groups: # groups:
...@@ -222,11 +235,4 @@ sonata_admin: ...@@ -222,11 +235,4 @@ sonata_admin:
# items: # items:
# - app.admin.post # - app.admin.post
# roles: [ ROLE_ONE, ROLE_TWO ] # roles: [ ROLE_ONE, ROLE_TWO ]
sonata_block:
blocks:
sonata.admin.block.stats:
contexts: [admin]
sonata.admin.block.admin_list:
contexts: [admin]
sonata.admin.block.search_result:
contexts: [admin]
sonata_admin:
assets:
extra_stylesheets:
- bundles/sonatatranslation/css/sonata-translation.css
sonata_block:
blocks:
sonata_translation.block.locale_switcher: ~
sonata_translation:
locale_switcher: true
locales: ['en', 'fr']
default_locale: 'fr'
gedmo:
enabled: true
knplabs:
enabled: true
...@@ -14,3 +14,10 @@ sonata_user_admin_resetting: ...@@ -14,3 +14,10 @@ sonata_user_admin_resetting:
fos_user: fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml" resource: "@FOSUserBundle/Resources/config/routing/all.xml"
sonata_translation:
resource: '@SonataTranslationBundle/Resources/config/routes.yaml'
lexik_translation_edition:
resource: "@LexikTranslationBundle/Resources/config/routing.yml"
prefix: /admin
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters: parameters:
locale: 'en' locale: 'en'
sonata.user.admin.user.controller: 'App\Controller\CRUD\CRUDController'
services: services:
# default configuration for services in *this* file # default configuration for services in *this* file
...@@ -57,7 +58,7 @@ services: ...@@ -57,7 +58,7 @@ services:
admin.adherent.gerer: admin.adherent.gerer:
class: App\Admin\AdherentAdmin class: App\Admin\AdherentAdmin
# arguments: [~, App\Entity\OBJECT, 'PixSortableBehaviorBundle:SortableAdmin'] # arguments: [~, App\Entity\OBJECT, 'PixSortableBehaviorBundle:SortableAdmin']
arguments: [~, App\Entity\User, ~] arguments: [~, App\Entity\User, 'App\Controller\CRUD\CRUDController']
tags: tags:
- name: sonata.admin - name: sonata.admin
manager_type: orm manager_type: orm
...@@ -82,7 +83,7 @@ services: ...@@ -82,7 +83,7 @@ services:
admin.prestataire.gerer: admin.prestataire.gerer:
class: App\Admin\PrestataireAdmin class: App\Admin\PrestataireAdmin
arguments: [~, App\Entity\User, ~] arguments: [~, App\Entity\User, 'App\Controller\CRUD\CRUDController']
tags: tags:
- name: sonata.admin - name: sonata.admin
manager_type: orm manager_type: orm
...@@ -92,6 +93,19 @@ services: ...@@ -92,6 +93,19 @@ services:
calls: calls:
- [ setUserManager, ['@fos_user.user_manager']] - [ setUserManager, ['@fos_user.user_manager']]
admin.prestataired.gerer:
class: App\Admin\PrestataireDAdmin
arguments: [~, App\Entity\Prestataire, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Prestataire"
label: "Gérer 2"
public: true
calls:
- [ setUserManager, ['@fos_user.user_manager']]
- [ addChild, ['@sonata.user.admin.user', 'user']]
admin.prestataire.cotisations: admin.prestataire.cotisations:
class: App\Admin\CotisationPrestataireAdmin class: App\Admin\CotisationPrestataireAdmin
arguments: [~, App\Entity\Cotisation, ~] arguments: [~, App\Entity\Cotisation, ~]
...@@ -160,6 +174,16 @@ services: ...@@ -160,6 +174,16 @@ services:
label: "FAQs" label: "FAQs"
public: true public: true
admin.traduction.gerer:
class: App\Admin\TraductionAdmin
arguments: [~, Lexik\Bundle\TranslationBundle\Entity\Translation, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Traduction"
label: "Traductions"
public: true
# admin.flux.gerer: # admin.flux.gerer:
# class: App\Admin\FluxAdmin # class: App\Admin\FluxAdmin
# arguments: [~, App\Entity\Transaction, ~] # arguments: [~, App\Entity\Transaction, ~]
......
This source diff could not be displayed because it is too large. You can view the blob instead.
[Sun Dec 02 16:50:19.789465 2018] [authz_core:error] [pid 74805] [client ::1:53101] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/
[Sun Dec 02 16:50:21.791092 2018] [authz_core:error] [pid 74803] [client 127.0.0.1:53102] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/admin
[Sun Dec 02 16:51:01.047349 2018] [authz_core:error] [pid 74804] [client 127.0.0.1:53109] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/admin
[Sun Dec 02 16:52:03.660281 2018] [authz_core:error] [pid 74806] [client ::1:53133] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/
[Sun Dec 02 16:52:09.671524 2018] [authz_core:error] [pid 74807] [client 127.0.0.1:53140] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/
[Sun Dec 02 16:52:18.073495 2018] [authz_core:error] [pid 74810] [client 127.0.0.1:53141] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/index.php
[Sun Dec 02 17:46:26.101100 2018] [authz_core:error] [pid 1975] [client 127.0.0.1:51635] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/admin
[Sun Dec 02 17:46:30.763401 2018] [authz_core:error] [pid 1975] [client 127.0.0.1:51635] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/admin
[Sun Dec 02 17:46:33.536014 2018] [authz_core:error] [pid 1975] [client 127.0.0.1:51635] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/admina
[Sun Dec 02 17:46:35.705658 2018] [authz_core:error] [pid 1975] [client 127.0.0.1:51635] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/
[Sun Dec 02 17:49:53.486817 2018] [php7:warn] [pid 2116] [client 127.0.0.1:51665] PHP Warning: require(/Users/julien/Desktop/DOUME/ledellin/config/bootstrap.php): failed to open stream: No such file or directory in /Users/julien/Desktop/DOUME/ledellin/public/index.php on line 7
[Sun Dec 02 17:49:53.487364 2018] [php7:error] [pid 2116] [client 127.0.0.1:51665] PHP Fatal error: require(): Failed opening required '/Users/julien/Desktop/DOUME/ledellin/config/bootstrap.php' (include_path='.:/usr/local/Cellar/php@7.1/7.1.22/share/php@7.1/pear') in /Users/julien/Desktop/DOUME/ledellin/public/index.php on line 7
[Sun Dec 02 17:51:07.820729 2018] [php7:error] [pid 2117] [client 127.0.0.1:51672] PHP Fatal error: Uncaught Error: Call to undefined method Symfony\\Component\\Dotenv\\Dotenv::loadEnv() in /Users/julien/Desktop/DOUME/ledellin/config/bootstrap.php:16\nStack trace:\n#0 /Users/julien/Desktop/DOUME/ledellin/public/index.php(7): require()\n#1 {main}\n thrown in /Users/julien/Desktop/DOUME/ledellin/config/bootstrap.php on line 16
[Fri Dec 07 16:57:33.662956 2018] [php7:error] [pid 30009] [client 127.0.0.1:56785] PHP Fatal error: Method App\\Entity\\Comptoir::__toString() must not throw an exception, caught TypeError: Return value of App\\Entity\\Comptoir::__toString() must be of the type string, null returned in /Users/julien/Desktop/DOUME/ledellin/vendor/twig/twig/lib/Twig/Extension/Core.php on line 0, referer: http://www.doume.test/admin/app/comptoir/list
[Fri Dec 07 16:58:57.309991 2018] [php7:error] [pid 11590] [client 127.0.0.1:56788] PHP Fatal error: Method App\\Entity\\Comptoir::__toString() must not throw an exception, caught TypeError: Return value of App\\Entity\\Comptoir::getId() must be of the type integer, null returned in /Users/julien/Desktop/DOUME/ledellin/vendor/twig/twig/lib/Twig/Extension/Core.php on line 0, referer: http://www.doume.test/admin/app/comptoir/list
[Fri Dec 07 17:22:03.920201 2018] [php7:error] [pid 30009] [client 127.0.0.1:56883] PHP Fatal error: Cannot declare class App\\Controller\\AdminController, because the name is already in use in /Users/julien/Desktop/DOUME/ledellin/src/Controller/AdminoldController.php on line 9, referer: http://www.doume.test/admin/app/comptoir/list
[Wed Jan 09 17:40:41.454606 2019] [php7:error] [pid 91126] [client 127.0.0.1:64703] PHP Fatal error: Method App\\Entity\\Document::__toString() must not throw an exception, caught TypeError: Return value of App\\Entity\\Document::__toString() must be of the type string, null returned in /Users/julien/Desktop/DOUME/ledellin/vendor/twig/twig/lib/Twig/Extension/Core.php on line 0, referer: http://www.doume.test/admin/app/document/list
[Wed Jan 09 17:41:18.728866 2019] [php7:error] [pid 91127] [client 127.0.0.1:64708] PHP Fatal error: Method App\\Entity\\Document::__toString() must not throw an exception, caught TypeError: Return value of App\\Entity\\Document::__toString() must be of the type string, null returned in /Users/julien/Desktop/DOUME/ledellin/vendor/twig/twig/lib/Twig/Extension/Core.php on line 0, referer: http://www.doume.test/admin/app/document/list
[Wed Jan 09 19:26:37.905339 2019] [php7:error] [pid 20965] [client 127.0.0.1:54948] PHP Fatal error: Method App\\Entity\\Groupe::__toString() must not throw an exception, caught TypeError: Return value of App\\Entity\\Groupe::__toString() must be of the type string, null returned in /Users/julien/Desktop/DOUME/ledellin/vendor/twig/twig/lib/Twig/Extension/Core.php on line 0, referer: http://www.doume.test/admin/app/groupe/list
[Wed Jan 09 19:44:38.386620 2019] [php7:error] [pid 20965] [client 127.0.0.1:59475] PHP Fatal error: Class App\\Form\\EntityToIdTransformer contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Symfony\\Component\\Form\\DataTransformerInterface::reverseTransform) in /Users/julien/Desktop/DOUME/ledellin/src/Form/EntityToIdTransformer.php on line 9, referer: http://www.doume.test/admin/app/groupe/list
[Wed Jan 09 20:05:19.917664 2019] [php7:error] [pid 25864] [client 127.0.0.1:64672] PHP Fatal error: Method App\\Entity\\Rubrique::__toString() must not throw an exception, caught TypeError: Return value of App\\Entity\\Rubrique::__toString() must be of the type string, null returned in /Users/julien/Desktop/DOUME/ledellin/vendor/twig/twig/lib/Twig/Extension/Core.php on line 0, referer: http://www.doume.test/admin/app/rubrique/list
[Mon Jan 14 16:43:14.544620 2019] [php7:error] [pid 40616] [client 127.0.0.1:54684] PHP Fatal error: Cannot declare class Sonata\\UserBundle\\Admin\\Model\\UserAdmin, because the name is already in use in /Users/julien/Desktop/DOUME/ledellin/src/Application/Sonata/UserBundle/Admin/UserAdmin.php on line 0
[Mon Jan 14 16:47:13.967624 2019] [php7:error] [pid 40568] [client 127.0.0.1:54748] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Model/UserAdmin.php on line 33, referer: http://www.doume.test/admin/user/list
[Mon Jan 14 16:47:14.377460 2019] [php7:error] [pid 40568] [client 127.0.0.1:54748] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Entity/UserAdmin.php on line 18, referer: http://www.doume.test/admin/user/list
[Mon Jan 14 16:47:16.036580 2019] [php7:error] [pid 40616] [client 127.0.0.1:54750] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Model/UserAdmin.php on line 33, referer: http://www.doume.test/admin/user/list
[Mon Jan 14 16:47:16.262028 2019] [php7:error] [pid 40616] [client 127.0.0.1:54750] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Entity/UserAdmin.php on line 18, referer: http://www.doume.test/admin/user/list
[Mon Jan 14 16:47:22.280013 2019] [php7:error] [pid 40569] [client 127.0.0.1:54753] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Model/UserAdmin.php on line 33
[Mon Jan 14 16:47:22.488889 2019] [php7:error] [pid 40569] [client 127.0.0.1:54753] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Entity/UserAdmin.php on line 18
[Mon Jan 14 16:47:40.051908 2019] [php7:error] [pid 40567] [client 127.0.0.1:54758] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Model/UserAdmin.php on line 33
[Mon Jan 14 16:47:40.482546 2019] [php7:error] [pid 40567] [client 127.0.0.1:54758] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Entity/UserAdmin.php on line 18
[Mon Jan 14 16:48:30.540076 2019] [php7:error] [pid 40571] [client 127.0.0.1:54761] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Model/UserAdmin.php on line 33
[Mon Jan 14 16:48:30.860332 2019] [php7:error] [pid 40571] [client 127.0.0.1:54761] PHP Fatal error: Class 'Sonata\\UserBundle\\Admin\\Model\\UserAdmin' not found in /Users/julien/Desktop/DOUME/ledellin/vendor/sonata-project/user-bundle/src/Admin/Entity/UserAdmin.php on line 18
[Mon Jan 14 16:50:00.697303 2019] [php7:error] [pid 40614] [client 127.0.0.1:54766] PHP Fatal error: Cannot declare class Sonata\\UserBundle\\Admin\\Model\\UserAdmin, because the name is already in use in /Users/julien/Desktop/DOUME/ledellin/src/Application/Sonata/UserBundle/Admin/UserAdmin.php on line 33
[Tue Jan 15 20:08:59.626105 2019] [php7:error] [pid 90073] [client 127.0.0.1:52195] PHP Fatal error: Declaration of App\\Admin\\UserAdmin::configureDatagridFilters(Sonata\\AdminBundle\\Datagrid\\DatagridMapper $datagridMapper) must be compatible with App\\Application\\Sonata\\UserBundle\\Admin\\UserAdmin::configureDatagridFilters(Sonata\\AdminBundle\\Datagrid\\DatagridMapper $filterMapper): void in /Users/julien/Desktop/DOUME/ledellin/src/Admin/UserAdmin.php on line 16, referer: http://www.doume.test/admin/adherent/create?_tab=tab_s76756ad69c_1
[Tue Jan 15 20:09:00.351222 2019] [php7:error] [pid 97869] [client 127.0.0.1:52196] PHP Fatal error: Declaration of App\\Admin\\UserAdmin::configureDatagridFilters(Sonata\\AdminBundle\\Datagrid\\DatagridMapper $datagridMapper) must be compatible with App\\Application\\Sonata\\UserBundle\\Admin\\UserAdmin::configureDatagridFilters(Sonata\\AdminBundle\\Datagrid\\DatagridMapper $filterMapper): void in /Users/julien/Desktop/DOUME/ledellin/src/Admin/UserAdmin.php on line 16, referer: http://www.doume.test/admin/dashboard
[Tue Jan 15 20:09:07.108980 2019] [php7:error] [pid 91422] [client 127.0.0.1:52197] PHP Fatal error: Declaration of App\\Admin\\UserAdmin::configureDatagridFilters(Sonata\\AdminBundle\\Datagrid\\DatagridMapper $datagridMapper) must be compatible with App\\Application\\Sonata\\UserBundle\\Admin\\UserAdmin::configureDatagridFilters(Sonata\\AdminBundle\\Datagrid\\DatagridMapper $filterMapper): void in /Users/julien/Desktop/DOUME/ledellin/src/Admin/UserAdmin.php on line 16, referer: http://www.doume.test/admin/adherent/create?_tab=tab_s76756ad69c_1
[Tue Jan 15 20:09:07.525042 2019] [php7:error] [pid 9159] [client 127.0.0.1:52198] PHP Fatal error: Declaration of App\\Admin\\UserAdmin::configureDatagridFilters(Sonata\\AdminBundle\\Datagrid\\DatagridMapper $datagridMapper) must be compatible with App\\Application\\Sonata\\UserBundle\\Admin\\UserAdmin::configureDatagridFilters(Sonata\\AdminBundle\\Datagrid\\DatagridMapper $filterMapper): void in /Users/julien/Desktop/DOUME/ledellin/src/Admin/UserAdmin.php on line 16, referer: http://www.doume.test/admin/dashboard
...@@ -22,6 +22,15 @@ class AdherentAdmin extends UserAdmin ...@@ -22,6 +22,15 @@ class AdherentAdmin extends UserAdmin
protected $baseRouteName = 'adherent'; protected $baseRouteName = 'adherent';
protected $baseRoutePattern = 'adherent'; protected $baseRoutePattern = 'adherent';
protected $datagridValues = [
// reverse order (default = 'ASC')
'_sort_order' => 'DESC',
// name of the ordered field (default = the model's id field, if any)
'_sort_by' => 'ecompte',
// '_page' => 1,
// '_per_page' => 32
];
public function configure() public function configure()
{ {
parent::configure(); parent::configure();
...@@ -49,10 +58,6 @@ class AdherentAdmin extends UserAdmin ...@@ -49,10 +58,6 @@ class AdherentAdmin extends UserAdmin
protected function configureDatagridFilters(DatagridMapper $datagridMapper): void protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
{ {
parent::configureDatagridFilters($datagridMapper); parent::configureDatagridFilters($datagridMapper);
$datagridMapper
->add('username')
->add('email')
;
} }
...@@ -63,8 +68,9 @@ class AdherentAdmin extends UserAdmin ...@@ -63,8 +68,9 @@ class AdherentAdmin extends UserAdmin
->addIdentifier('username') ->addIdentifier('username')
->addIdentifier('email') ->addIdentifier('email')
->addIdentifier('adherent.ecompte', null, array('label' => 'Ecompte')) ->addIdentifier('adherent.ecompte', null, array('label' => 'Ecompte'))
->add('groups')
->addIdentifier('enabled', null, array('label' => 'Activé', 'datatype' => 'App.User', 'template' => '@SonataAdmin/Boolean/editable_boolean.html.twig')) ->addIdentifier('enabled', null, array('label' => 'Activé', 'datatype' => 'App.User', 'template' => '@SonataAdmin/Boolean/editable_boolean.html.twig'))
->addIdentifier('createdAt') // ->addIdentifier('createdAt')
; ;
if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) {
...@@ -76,7 +82,7 @@ class AdherentAdmin extends UserAdmin ...@@ -76,7 +82,7 @@ class AdherentAdmin extends UserAdmin
protected function configureRoutes(RouteCollection $collection) protected function configureRoutes(RouteCollection $collection)
{ {
$collection->remove('delete'); // $collection->remove('delete');
} }
/** /**
...@@ -85,7 +91,14 @@ class AdherentAdmin extends UserAdmin ...@@ -85,7 +91,14 @@ class AdherentAdmin extends UserAdmin
public function createQuery($context = 'list') public function createQuery($context = 'list')
{ {
$query = parent::createQuery($context); $query = parent::createQuery($context);
$query->andWhere($query->getRootAliases()[0] . '.adherent IS NOT NULL'); $role = 'ROLE_ADHERENT';
// $query->andWhere($query->getRootAliases()[0] . '.adherent IS NOT NULL');
$query->leftJoin($query->getRootAliases()[0] . '.groups', 'g')
->where($query->expr()->orX(
$query->expr()->like($query->getRootAliases()[0] . '.roles', ':roles'),
$query->expr()->like('g.roles', ':roles')
))
->setParameter('roles', '%"'.$role.'"%');
return $query; return $query;
} }
} }
...@@ -22,11 +22,6 @@ class PrestataireAdmin extends UserAdmin ...@@ -22,11 +22,6 @@ class PrestataireAdmin extends UserAdmin
{ {
protected $baseRouteName = 'prestataire'; protected $baseRouteName = 'prestataire';
protected $baseRoutePattern = 'prestataire'; protected $baseRoutePattern = 'prestataire';
protected $datagridValues = [
'_page' => 1,
'_per_page' => 32,
];
public function configure() public function configure()
{ {
......
<?php
namespace App\Admin;
use App\Admin\UserAdmin;
use App\Entity\Geoloc;
use App\Entity\Prestataire;
use App\Entity\User;
use App\Entity\Usergroup;
use Doctrine\ORM\Query;
use FOS\UserBundle\Model\UserManagerInterface;
use Knp\Menu\ItemInterface as MenuItemInterface;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\MediaBundle\Form\Type\MediaType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class PrestataireDAdmin extends AbstractAdmin
{
protected $baseRouteName = 'prestataired';
protected $baseRoutePattern = 'prestataired';
public function configure()
{
parent::configure();
}
protected function configureSideMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
{
if (!$childAdmin && !in_array($action, ['edit', 'show'])) {
return;
}
$admin = $this->isChild() ? $this->getParent() : $this;
$id = $admin->getRequest()->get('id');
$user = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(User::class)->findOneBy(array('prestataire' => $id));
if ($this->isGranted('EDIT') && $user != null) {
$menu->addChild('Edit User', [
'uri' => $this->getConfigurationPool()->getContainer()->get('router')->generate('admin_app_user_edit', ['id' => $user->getId()], UrlGeneratorInterface::ABSOLUTE_URL)
]);
}
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
// Initialize prestataire
$presta = $this->getSubject();
$user = $this->userManager->createUser();
$user->setEnabled(1); // enable the user or enable it later with a confirmation token in the email
// $this->userManager->updateUser($user);
$groupe = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(Usergroup::class)->findOneByName('Prestataire');
$user->setEnabled(true);
$user->addGroup($groupe);
$user->addRole('ROLE_PRESTATAIRE');
// $presta = new Prestataire();
$presta->setGeoloc(new Geoloc());
$user->setPrestataire($presta);
// get the current Image instance
$imageHelp = null;
if (!empty($user->getPrestataire()) && !empty($user->getPrestataire()->getMedia())) {
$image = $user->getPrestataire()->getMedia();
if ($image && ($webPath = $image->getWebPath())) {
// get the container so the full path to the image can be set
$container = $this->getConfigurationPool()->getContainer();
$fullPath = $container->get('request_stack')->getCurrentRequest()->getBasePath().'/'.$webPath;
// add a 'help' option containing the preview's img tag
$imageHelp = '<img src="'.$fullPath.'" class="admin-preview" />';
}
}
$formMapper
->tab('Prestataire')
->with('General', ['class' => 'col-md-7'])
->add('raison', TextType::class, array(
'label' => 'Raison :',
'required' => true
))
->add('statut', TextType::class, array(
'label' => 'Statut :',
'required' => false
))
->add('siret', TextType::class, array(
'label' => 'SIRET :',
'required' => true
))
->add('iban', TextType::class, array(
'label' => 'IBAN :',
'required' => true
))
->end()
->with('Responsable', ['class' => 'col-md-5'])
->add('metier', TextType::class, array(
'label' => 'Métier :',
'required' => true
))
->add('responsable', TextType::class, array(
'label' => 'Responsable :',
'required' => false
))
->end()
->with('Addresse', ['class' => 'col-md-7'])
->add('geoloc.adresse', TextType::class, array(
'label' => 'Addresse :',
'required' => false
))
->add('geoloc.cpostal', TextType::class, array(
'label' => 'Code postal :',
'required' => false
))
->add('geoloc.ville', TextType::class, array(
'label' => 'Ville :',
'required' => false
))
->add('geoloc.lat', TextType::class, array(
'label' => 'Latitude :',
'required' => false
))
->add('geoloc.lon', TextType::class, array(
'label' => 'Longitude :',
'required' => false
))
->end()
->with('Image', ['class' => 'col-md-5'])
->add('media', MediaType::class, array(
'provider' => 'sonata.media.provider.image',
'context' => 'prestataire',
'help' => $imageHelp
))
->end()
->end()
;
parent::configureFormFields($formMapper);
}
/**
* {@inheritdoc}
*/
protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
{
parent::configureDatagridFilters($datagridMapper);
$datagridMapper
->add('raison')
->add('statut')
;
}
/**
* @param UserManagerInterface $userManager
*/
public function setUserManager(UserManagerInterface $userManager): void
{
$this->userManager = $userManager;
}
/**
* @return UserManagerInterface
*/
public function getUserManager()
{
return $this->userManager;
}
protected function configureListFields(ListMapper $listMapper): void
{
unset($this->listModes['mosaic']);
$listMapper
->addIdentifier('user.username')
->addIdentifier('user.email')
->addIdentifier('raison')
->addIdentifier('user.enabled', null, array('label' => 'Activé', 'datatype' => 'App.User', 'template' => '@SonataAdmin/Boolean/editable_boolean.html.twig'))
->addIdentifier('user.createdAt')
;
// if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) {
// $listMapper
// ->addIdentifier('user.impersonating', 'string', ['template' => '@SonataUser/Admin/Field/impersonating.html.twig'])
// ;
// }
}
protected function configureRoutes(RouteCollection $collection)
{
$collection->remove('delete');
}
/**
* {@inheritdoc}
*/
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
// $query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true);
$query->innerJoin('o.user', 'u')
->addSelect('u');
return $query;
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Route\RouteCollection;
/**
* TRADUCTION ADMIN
*/
class TraductionAdmin extends AbstractAdmin
{
protected $baseRouteName = 'lexik_translation_overview';
protected $baseRoutePattern = 'translations';
/**
* {@inheritdoc}
*/
public function configureRoutes(RouteCollection $collection)
{
$collection->add('list', 'list', [
'_controller' => 'LexikTranslationBundle:Translation:overview',
]);
$collection->add('grid', 'grid', [
'_controller' => 'LexikTranslationBundle:Translation:grid',
]);
$collection->add('new', 'new', [
'_controller' => 'LexikTranslationBundle:Translation:new',
]);
}
}
...@@ -23,6 +23,8 @@ class UserAdmin extends SonataUserAdmin ...@@ -23,6 +23,8 @@ class UserAdmin extends SonataUserAdmin
'_sort_order' => 'DESC', '_sort_order' => 'DESC',
// name of the ordered field (default = the model's id field, if any) // name of the ordered field (default = the model's id field, if any)
'_sort_by' => 'updatedAt', '_sort_by' => 'updatedAt',
// '_page' => 1,
// '_per_page' => 32
]; ];
public function configure() public function configure()
...@@ -55,7 +57,13 @@ class UserAdmin extends SonataUserAdmin ...@@ -55,7 +57,13 @@ class UserAdmin extends SonataUserAdmin
protected function configureRoutes(RouteCollection $collection) protected function configureRoutes(RouteCollection $collection)
{ {
if ($this->isChild()) {
$collection->remove('delete'); $collection->remove('delete');
return;
}
// This is the route configuration as a parent
$collection->clear();
} }
/** /**
...@@ -63,11 +71,9 @@ class UserAdmin extends SonataUserAdmin ...@@ -63,11 +71,9 @@ class UserAdmin extends SonataUserAdmin
*/ */
protected function configureDatagridFilters(DatagridMapper $datagridMapper): void protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
{ {
parent::configureDatagridFilters($datagridMapper);
$datagridMapper $datagridMapper
->add('enabled') ->add('enabled')
// ->add('email', null, [
// 'show_filter' => true
// ])
; ;
} }
......
...@@ -120,7 +120,7 @@ class UserAdmin extends BaseUserAdmin ...@@ -120,7 +120,7 @@ class UserAdmin extends BaseUserAdmin
->with('Groups', ['class' => 'col-md-8'])->end() ->with('Groups', ['class' => 'col-md-8'])->end()
->with('Status', ['class' => 'col-md-4'])->end() ->with('Status', ['class' => 'col-md-4'])->end()
// ->with('Keys', ['class' => 'col-md-4'])->end() // ->with('Keys', ['class' => 'col-md-4'])->end()
// ->with('Roles', ['class' => 'col-md-12'])->end() ->with('Roles', ['class' => 'col-md-12'])->end()
->end() ->end()
; ;
...@@ -183,14 +183,14 @@ class UserAdmin extends BaseUserAdmin ...@@ -183,14 +183,14 @@ class UserAdmin extends BaseUserAdmin
'multiple' => true, 'multiple' => true,
]) ])
->end() ->end()
// ->with('Roles') ->with('Roles')
// ->add('realRoles', SecurityRolesType::class, [ ->add('realRoles', SecurityRolesType::class, [
// 'label' => 'form.label_roles', 'label' => 'form.label_roles',
// 'expanded' => true, 'expanded' => true,
// 'multiple' => true, 'multiple' => true,
// 'required' => false, 'required' => false,
// ]) ])
// ->end() ->end()
// ->with('Keys') // ->with('Keys')
// ->add('token', null, ['required' => false]) // ->add('token', null, ['required' => false])
// ->add('twoStepVerificationCode', null, ['required' => false]) // ->add('twoStepVerificationCode', null, ['required' => false])
......
<?php
namespace App\Controller\CRUD;
use Sonata\AdminBundle\Controller\CRUDController as Controller;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
class CRUDController extends Controller
{
public function deleteAction($id)
{
$request = $this->getRequest();
$id = $request->get($this->admin->getIdParameter());
$object = $this->admin->getObject($id);
if (!$object) {
throw $this->createNotFoundException(sprintf('unable to find the object with id: %s', $id));
}
$currentUserId = $this->getUser()->getId(); // ID of the current user
if ($currentUserId == $id) {
$this->addFlash(
'sonata_flash_error',
'Vous ne pouvez pas supprimer votre compte !'
);
return $this->redirectTo($object);
}
if ($object->hasRoale('ROLE_SUPER_ADMIN') || $object->hasRole('ROLE_ADMIN_SIEGE')) {
$this->addFlash(
'sonata_flash_error',
'Vous ne pouvez pas supprimer le compte admin !'
);
return $this->redirectTo($object);
}
return parent::deleteAction($id);
}
public function batchActionDelete(ProxyQueryInterface $query)
{
$request = $this->getRequest();
$currentUserId = $this->getUser()->getId(); // ID of the current user
$selectedUsers = $query->execute();
foreach ($selectedUsers as $selectedUser) {
if ($selectedUser->getId() == $currentUserId) {
$this->addFlash(
'sonata_flash_error',
'Vous ne pouvez pas supprimer votre compte !'
);
return new RedirectResponse(
$this->admin->generateUrl('list', array('filter' => $this->admin->getFilterParameters()))
);
}
if ($selectedUser->hasRole('ROLE_SUPER_ADMIN') || $selectedUser->hasRole('ROLE_ADMIN_SIEGE')) {
$this->addFlash(
'sonata_flash_error',
'Vous ne pouvez pas supprimer le compte admin !'
);
return new RedirectResponse(
$this->admin->generateUrl('list', array('filter' => $this->admin->getFilterParameters()))
);
}
}
return parent::batchActionDelete($query);
}
}
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Validator\Constraints as Assert;
trait FileEntityTrait
{
/**
* @var null|File|UploadedFile
*/
protected $file;
/**
* @var null|string
*/
protected $oldPath = null;
/**
* @var null|int
*
* @ORM\Column(type="integer", length=255, nullable=true)
*/
protected $size;
/**
* @var null|string
*
* @ORM\Column(type="string", length=10, nullable=true)
*/
protected $extension;
/**
* @var null|string
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $type;
/**
* @var null|string
*
* @ORM\Column(name="file", type="string", length=255, nullable=true)
*/
protected $path = null;
/**
* @param File|null $file
* @return $this
*/
public function setFile(File $file = null)
{
$this->file = $file;
return $this;
}
/**
* @return null|File|UploadedFile
*/
public function getFile(): ?File
{
return $this->file;
}
/**
* @return null|string
*/
public function getOldPath(): ?string
{
return $this->oldPath;
}
/**
* @param null|string $oldPath
* @return $this
*/
public function setOldPath(?string $oldPath)
{
$this->oldPath = $oldPath;
return $this;
}
/**
* @return int|null
*/
public function getSize(): ?int
{
return $this->size;
}
/**
* @param int|null $size
* @return $this
*/
public function setSize(?int $size)
{
$this->size = $size;
return $this;
}
/**
* @return null|string
*/
public function getExtension(): ?string
{
return $this->extension;
}
/**
* @param null|string $extension
* @return $this
*/
public function setExtension(?string $extension)
{
$this->extension = $extension;
return $this;
}
/**
* @return null|string
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param null|string $type
* @return $this
*/
public function setType(?string $type)
{
$this->type = $type;
return $this;
}
/**
* @return null|string
*/
public function getPath(): ?string
{
return $this->path;
}
/**
* @param null|string $path
* @return $this
*/
public function setPath(?string $path)
{
$this->path = $path;
return $this;
}
public function getAbsolutePath()
{
return null === $this->getPath()
? null
: $this->getUploadRootDir().'/'.$this->getPath();
}
public function getWebPath()
{
return null === $this->getPath()
? null
: $this->getUploadDir().'/'.$this->getPath();
}
public function getUploadRootDir()
{
return __DIR__.'/../../../../web/'.$this->getUploadDir();
}
public function getUploadDir()
{
return 'uploads/'.strtolower($this->getType());
}
/**
* Au chargement de l'entité génération d'un objet File stocker dans la proprieté file
* @ORM\PostLoad()
*/
public function postLoadFile()
{
if($this->getPath() != null) {
try {
$this->setFile(new File($this->getAbsolutePath()));
} catch (\Exception $e){
}
}
}
/**
* A la modification ou création de l'entité je vérifie qu'il y a un UploadedFile dans la proprieté file
* @ORM\PreFlush()
*/
public function upload()
{
if (null === $this->getFile() || !$this->getFile() instanceof UploadedFile) {
return;
}
$file_name = date('m-d-Y_his') . '-' . $this->getFile()->getClientOriginalName();
if($this->getPath() != null) {
$this->setOldPath($this->getPath());
}
$this->setPath($file_name);
$this->setSize($this->getFile()->getSize());
$this->setExtension($this->getFile()->getClientOriginalExtension());
$fs = new Filesystem();
if (!$fs->exists($this->getUploadRootDir())) {
$fs->mkdir($this->getUploadRootDir(), 0775);
}
$this->file->move(
$this->getUploadRootDir(), $this->getPath()
);
}
/**
* Après la création ou la modification de l'entité, si le fichier à été remplacé je supprime l'ancien
* @ORM\PostPersist()
* @ORM\PostUpdate()
*/
public function cleanOldFile()
{
if($this->getOldPath() !== null) {
$fs = new Filesystem();
try {
$fs->remove($this->getUploadRootDir().'/'. $this->getOldPath());
} catch(\Exception $exception) {
}
}
}
}
\ No newline at end of file
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Validator\Constraints as Assert;
trait OldFileEntityTrait
{
/**
* @var null|File|UploadedFile
*/
protected $file;
/**
* @var null|string
*/
protected $oldPath = null;
/**
* @var null|int
*
* @ORM\Column(type="integer", length=255, nullable=true)
*/
protected $size;
/**
* @var null|string
*
* @ORM\Column(type="string", length=10, nullable=true)
*/
protected $extension;
/**
* @var null|string
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $type;
/**
* @var null|string
*
* @ORM\Column(name="file", type="string", length=255, nullable=true)
*/
protected $path = null;
/**
* @param File|null $file
* @return $this
*/
public function setFile(File $file = null)
{
$this->file = $file;
return $this;
}
/**
* @return null|File|UploadedFile
*/
public function getFile(): ?File
{
return $this->file;
}
/**
* @return null|string
*/
public function getOldPath(): ?string
{
return $this->oldPath;
}
/**
* @param null|string $oldPath
* @return $this
*/
public function setOldPath(?string $oldPath)
{
$this->oldPath = $oldPath;
return $this;
}
/**
* @return int|null
*/
public function getSize(): ?int
{
return $this->size;
}
/**
* @param int|null $size
* @return $this
*/
public function setSize(?int $size)
{
$this->size = $size;
return $this;
}
/**
* @return null|string
*/
public function getExtension(): ?string
{
return $this->extension;
}
/**
* @param null|string $extension
* @return $this
*/
public function setExtension(?string $extension)
{
$this->extension = $extension;
return $this;
}
/**
* @return null|string
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param null|string $type
* @return $this
*/
public function setType(?string $type)
{
$this->type = $type;
return $this;
}
/**
* @return null|string
*/
public function getPath(): ?string
{
return $this->path;
}
/**
* @param null|string $path
* @return $this
*/
public function setPath(?string $path)
{
$this->path = $path;
return $this;
}
public function getAbsolutePath()
{
return null === $this->getPath()
? null
: $this->getUploadRootDir().'/'.$this->getPath();
}
public function getWebPath()
{
return null === $this->getPath()
? null
: $this->getUploadDir().'/'.$this->getPath();
}
public function getUploadRootDir()
{
return __DIR__.'/../../../../web/'.$this->getUploadDir();
}
public function getUploadDir()
{
return 'uploads/'.strtolower($this->getType());
}
/**
* Au chargement de l'entité génération d'un objet File stocker dans la proprieté file
* @ORM\PostLoad()
*/
public function postLoadFile()
{
if($this->getPath() != null) {
try {
$this->setFile(new File($this->getAbsolutePath()));
} catch (\Exception $e){
}
}
}
/**
* A la modification ou création de l'entité je vérifie qu'il y a un UploadedFile dans la proprieté file
* @ORM\PreFlush()
*/
public function upload()
{
if (null === $this->getFile() || !$this->getFile() instanceof UploadedFile) {
return;
}
$file_name = date('m-d-Y_his') . '-' . $this->getFile()->getClientOriginalName();
if($this->getPath() != null) {
$this->setOldPath($this->getPath());
}
$this->setPath($file_name);
$this->setSize($this->getFile()->getSize());
$this->setExtension($this->getFile()->getClientOriginalExtension());
$fs = new Filesystem();
if (!$fs->exists($this->getUploadRootDir())) {
$fs->mkdir($this->getUploadRootDir(), 0775);
}
$this->file->move(
$this->getUploadRootDir(), $this->getPath()
);
}
/**
* Après la création ou la modification de l'entité, si le fichier à été remplacé je supprime l'ancien
* @ORM\PostPersist()
* @ORM\PostUpdate()
*/
public function cleanOldFile()
{
if($this->getOldPath() !== null) {
$fs = new Filesystem();
try {
$fs->remove($this->getUploadRootDir().'/'. $this->getOldPath());
} catch(\Exception $exception) {
}
}
}
}
\ No newline at end of file
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
trait SoftDeletableEntityTrait
{
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
* @Assert\DateTime()
*/
private $deletedAt;
/**
* @param \DateTime|null $deletedAt
*
* @return $this
*/
public function setDeletedAt(?\DateTime $deletedAt = null)
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getDeletedAt(): ?\DateTime
{
return $this->deletedAt;
}
public function isDeleted(): bool
{
return null !== $this->deletedAt;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\Transaction;
use App\Entity\Transfert;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* FLUX = TRANSFERT ou TRANSACTION
* @ORM\Entity
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"transfert" = "Transfert", "transaction" = "Transaction"})
*/
abstract class Flux
{
use TimestampableEntity;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\OneToOne(targetEntity="User", inversedBy="user", cascade={"all"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
*/
protected $operateur;
/**
* TYPE DE TRANSACTION :
* @var string
*
* @ORM\Column(name="type", type="string", length=3)
*/
protected $type;
/**
* @var float
*
* @ORM\Column(name="montant", type="decimal", precision=7, scale=2)
*/
protected $montant;
/**
* @var null|string
*
* @ORM\Column(name="reference", type="string", length=255, nullable=true)
*/
protected $reference;
protected $expediteur=null;
protected $destinataire=null;
}
...@@ -94,6 +94,14 @@ class Prestataire ...@@ -94,6 +94,14 @@ class Prestataire
private $accept = false; private $accept = false;
/** /**
* @var bool
*
* @ORM\Column(name="partenaire", type="boolean", nullable=false)
*/
private $partenaire = false;
/**
* @var null|string (champ libre) * @var null|string (champ libre)
* *
* @ORM\Column(name="horaires", type="string", length=255, nullable=true) * @ORM\Column(name="horaires", type="string", length=255, nullable=true)
...@@ -125,7 +133,7 @@ class Prestataire ...@@ -125,7 +133,7 @@ class Prestataire
/** /**
* @var User * @var User
* *
* @ORM\OneToOne(targetEntity="User", cascade={"all"}, mappedBy="prestataire") * @ORM\OneToOne(targetEntity="User", cascade={"all"}, mappedBy="prestataire", fetch="LAZY")
*/ */
protected $user; protected $user;
...@@ -323,7 +331,7 @@ class Prestataire ...@@ -323,7 +331,7 @@ class Prestataire
/** /**
* @return User * @return User
*/ */
public function getUser(): User public function getUser(): ?User
{ {
return $this->user; return $this->user;
} }
......
...@@ -8,153 +8,24 @@ use Gedmo\Timestampable\Traits\TimestampableEntity; ...@@ -8,153 +8,24 @@ use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
/** /**
* @ORM\Entity * TRANSACTION
* @ORM\Table(name="transaction") * Dans l'interface de gestion de son compte professionnel, un prestataire peut effectuer deux types de virements internes, vers un autre prestataire ou vers un adhérent
*/ * Pour ajouter il faut un rôle spécifique:
class Transaction * – Adhérent (paiement numérique avec son compte adhérent)
{ * – Prestataire (entre prestataires et virement vers un compte adhérent)
use TimestampableEntity, * La somme des transactions électroniques sont limitées à un million d'euro par année glissante,
EnablableEntityTrait; * important donc de contrôler au moins le montant global des 365 derniers jours
/**
* @var int
* *
* @ORM\Id * Types de transaction :
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
* *
* @ORM\Column(name="type", type="string", length=3) * - PRESTATAIRES => ADHERENTS (Virement vers un adherent)
*/ * - PRESTATAIRES => PRESTATAIRES (Virement entre prestataires)
private $type; * - ADHERENTS => PRESTATAIRES (Paiement numérique)
/**
* @var float
* *
* @ORM\Column(name="montant", type="decimal", precision=7, scale=2) * @ORM\Entity
*/ * @ORM\Table(name="transaction")
private $montant;
/**
* @var null|string
*
* @ORM\Column(name="titre", type="string", length=255, nullable=true)
*/
private $reference;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="transactionsSend", cascade={"persist"})
*/
private $expediteur;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="transactionsReceived", cascade={"persist"})
*/
private $destinataire;
/**
* @return mixed
*/
public function getId(): int
{
return $this->id;
}
/**
* @param User $destinataire
* @return $this
*/
public function setDestinataire(User $destinataire)
{
$this->destinataire = $destinataire;
return $this;
}
/**
* @return User
*/
public function getDestinataire(): User
{
return $this->destinataire;
}
/**
* @param User $expediteur
* @return $this
*/
public function setExpediteur(User $expediteur)
{
$this->expediteur = $expediteur;
return $this;
}
/**
* @return User
*/
public function getExpediteur(): User
{
return $this->expediteur;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
* @return Transaction
*/
public function setType(string $type)
{
$this->type = $type;
return $this;
}
/**
* @return float
*/
public function getMontant(): float
{
return $this->montant;
}
/**
* @param float $montant
* @return Transaction
*/
public function setMontant(float $montant)
{
$this->montant = $montant;
return $this;
}
/**
* @return null|string
*/ */
public function getReference(): ?string class Transaction extends Flux
{ {
return $this->reference;
}
/**
* @param null|string $reference
* @return Transaction
*/
public function setReference(?string $reference)
{
$this->reference = $reference;
return $this;
}
} }
...@@ -3,67 +3,32 @@ ...@@ -3,67 +3,32 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait; use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\Flux;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity; use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
/** /**
* QUESTION * TRANSFERT
* @ORM\Entity * Les transferts dans la structure sont les flux de billets détenus par les opérateurs.
* @ORM\Table(name="transfert") * Pour ajouter il faut un rôle spécifique :
*/ * – Administrateur (Siège)
class Transfert * – Gestionnaire (Groupe local)
{ * – Comptoir + Vente de monnaie locale
use TimestampableEntity, EnablableEntityTrait; * – Prestataire (Reconversion)
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="operateur", type="string", length=20)
*/
private $operateur;
/**
* @var string
* *
* @ORM\Column(name="type", type="string", length=3) * Types de transfert : (Les transferts dans la structure sont les flux de billets détenus par les opérateurs.)
*/
private $type;
/**
* @var string
* QUESTION
* @ORM\Column(name="expediteur", type="string", length=100)
*/
private $expediteur;
/**
* @var string
* QUESTION
* @ORM\Column(name="destinataire", type="string", length=100)
*/
private $destinataire;
/**
* @var float
* *
* @ORM\Column(name="montant", type="decimal", precision=7, scale=2) * - SIEGE => GROUPES LOCAUX (Transfert du siège au groupe)
*/ * - GROUPES LOCAUX => COMPTOIRS (Transfert du groupe au comptoir)
private $montant; * - COMPTOIRS => GROUPES LOCAUX (Transfert du comptoir au groupe)
* - COMPTOIRS => ADHERENTS (Diffusion de monnaie papier auprès des adhérents)
/** * - COMPTOIRS => PRESTATAIRES (Diffusion de monnaie papier auprès des prestataires)
* @var null|string * - PRESTATAIRES => COMPTOIRS (Reconversion)
* *
* @ORM\Column(name="reference", type="string", length=255, nullable=true) * @ORM\Entity()
* @ORM\Table()
*/ */
private $reference; class Transfert extends Flux
{
} }
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190118103655 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE flux (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, type VARCHAR(3) NOT NULL, expediteur VARCHAR(100) NOT NULL, destinataire VARCHAR(100) NOT NULL, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL, INDEX IDX_7252313AA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE lexik_trans_unit (id INT AUTO_INCREMENT NOT NULL, key_name VARCHAR(255) NOT NULL, domain VARCHAR(255) NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX key_domain_idx (key_name, domain), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE lexik_translation_file (id INT AUTO_INCREMENT NOT NULL, domain VARCHAR(255) NOT NULL, locale VARCHAR(10) NOT NULL, extention VARCHAR(10) NOT NULL, path VARCHAR(255) NOT NULL, hash VARCHAR(255) NOT NULL, UNIQUE INDEX hash_idx (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE lexik_trans_unit_translations (id INT AUTO_INCREMENT NOT NULL, file_id INT DEFAULT NULL, trans_unit_id INT DEFAULT NULL, locale VARCHAR(10) NOT NULL, content LONGTEXT NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, modified_manually TINYINT(1) NOT NULL, INDEX IDX_B0AA394493CB796C (file_id), INDEX IDX_B0AA3944C3C583C9 (trans_unit_id), UNIQUE INDEX trans_unit_locale_idx (trans_unit_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE lexik_trans_unit_translations ADD CONSTRAINT FK_B0AA394493CB796C FOREIGN KEY (file_id) REFERENCES lexik_translation_file (id)');
$this->addSql('ALTER TABLE lexik_trans_unit_translations ADD CONSTRAINT FK_B0AA3944C3C583C9 FOREIGN KEY (trans_unit_id) REFERENCES lexik_trans_unit (id)');
$this->addSql('DROP TABLE transaction');
$this->addSql('DROP TABLE transfert');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE lexik_trans_unit_translations DROP FOREIGN KEY FK_B0AA3944C3C583C9');
$this->addSql('ALTER TABLE lexik_trans_unit_translations DROP FOREIGN KEY FK_B0AA394493CB796C');
$this->addSql('CREATE TABLE transaction (id INT AUTO_INCREMENT NOT NULL, expediteur_id INT DEFAULT NULL, destinataire_id INT DEFAULT NULL, type VARCHAR(3) NOT NULL COLLATE utf8mb4_unicode_ci, montant NUMERIC(7, 2) NOT NULL, titre VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, enabled TINYINT(1) NOT NULL, INDEX IDX_723705D1A4F84F6E (destinataire_id), INDEX IDX_723705D110335F61 (expediteur_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE transfert (id INT AUTO_INCREMENT NOT NULL, operateur VARCHAR(20) NOT NULL COLLATE utf8mb4_unicode_ci, type VARCHAR(3) NOT NULL COLLATE utf8mb4_unicode_ci, expediteur VARCHAR(100) NOT NULL COLLATE utf8mb4_unicode_ci, destinataire VARCHAR(100) NOT NULL COLLATE utf8mb4_unicode_ci, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, enabled TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D110335F61 FOREIGN KEY (expediteur_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1A4F84F6E FOREIGN KEY (destinataire_id) REFERENCES user (id)');
$this->addSql('DROP TABLE flux');
$this->addSql('DROP TABLE lexik_trans_unit');
$this->addSql('DROP TABLE lexik_translation_file');
$this->addSql('DROP TABLE lexik_trans_unit_translations');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190118105955 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE prestataire ADD partenaire TINYINT(1) NOT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE prestataire DROP partenaire');
}
}
<?php
namespace App\Security\Voter;
use App\Entity\User;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
abstract class AbstractVoter extends Voter
{
const LIST = 'list'; // view the list of objects
const VIEW = 'view'; // view the detail of one object
const CREATE = 'create'; // create a new object
const EDIT = 'edit'; // update an existing object
const DELETE = 'delete'; // delete an existing object
const EXPORT = 'export'; // (for the native Sonata export links)
const ALL = 'all'; // grants LIST, VIEW, CREATE, EDIT, DELETE and EXPORT
private $decisionManager;
public function __construct(AccessDecisionManagerInterface $decisionManager)
{
$this->decisionManager = $decisionManager;
}
protected static function supportsAttribute($attribute)
{
// Est-ce que l'action demandée existe
if (!in_array($attribute, array(self::LIST, self::VIEW, self::CREATE, self::EDIT, self::DELETE, self::EXPORT, self::ALL))) {
return false;
}
return true;
}
abstract protected function voteOnAttribute($attribute, $subject, TokenInterface $token);
}
...@@ -3,29 +3,17 @@ ...@@ -3,29 +3,17 @@
namespace App\Security\Voter; namespace App\Security\Voter;
use App\Entity\User; use App\Entity\User;
use App\Security\Voter\AbstractVoter;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter; use Symfony\Component\Security\Core\Authorization\Voter\Voter;
class UserVoter extends Voter class UserVoter extends AbstractVoter
{ {
const ADD = 'add';
const GET = 'get';
const EDIT = 'edit';
const LIST = 'list';
const REMOVE = 'remove';
private $decisionManager;
public function __construct(AccessDecisionManagerInterface $decisionManager)
{
$this->decisionManager = $decisionManager;
}
protected function supports($attribute, $subject) protected function supports($attribute, $subject)
{ {
// Est-ce que l'action demandée existe // Est-ce que l'action demandée existe
if (!in_array($attribute, array(self::ADD, self::GET, self::EDIT, self::REMOVE))) { if (!parent::supportsAttribute($attribute)) {
return false; return false;
} }
...@@ -47,32 +35,42 @@ class UserVoter extends Voter ...@@ -47,32 +35,42 @@ class UserVoter extends Voter
} }
// Les admins peuvent tout faire ! // Les admins peuvent tout faire !
if ($this->decisionManager->decide($token, array('ROLE_SUPER_ADMIN', 'ROLE_ADMIN'))) { if ($this->decisionManager->decide($token, array('ROLE_SUPER_ADMIN', 'ROLE_ADMIN', 'ROLE_ADMIN_SIEGE'))) {
return true; return true;
} }
switch ($attribute) { switch ($attribute) {
case self::ADD: case self::LIST:
return $this->canAdd($subject, $user); return $this->canList($subject, $user);
case self::GET: case self::VIEW:
return $this->canGet($subject, $user); return $this->canView($subject, $user);
case self::CREATE:
return $this->canCreate($subject, $user);
case self::EDIT: case self::EDIT:
return $this->canEdit($subject, $user); return $this->canEdit($subject, $user);
case self::REMOVE: case self::DELETE:
return $this->canRemove($subject, $user); return $this->canDelete($subject, $user);
case self::EXPORT:
return $this->canExport($subject, $user);
case self::ALL:
return $this->canAll($subject, $user);
} }
throw new \LogicException('This code should not be reached!'); throw new \LogicException('This code should not be reached!');
} }
private function canAdd(User $subject, User $user) private function canList(User $subject, User $user)
{ {
if ($this->decisionManager->decide($token, array('ROLE_ADHERENT'))) { // Only ADMIN can list users so already return true before
return false; return false;
} }
private function canView(User $subject, User $user)
{
// if ($this->decisionManager->decide($token, array('ROLE_ADHERENT'))) {
} }
private function canGet(User $subject, User $user) private function canCreate(User $subject, User $user)
{ {
} }
...@@ -80,7 +78,15 @@ class UserVoter extends Voter ...@@ -80,7 +78,15 @@ class UserVoter extends Voter
{ {
} }
private function canRemove(User $subject, User $user) private function canDelete(User $subject, User $user)
{
}
private function canExport(User $subject, User $user)
{
}
private function canAll(User $subject, User $user)
{ {
} }
} }
...@@ -212,6 +212,9 @@ ...@@ -212,6 +212,9 @@
"kriswallsmith/buzz": { "kriswallsmith/buzz": {
"version": "v0.16.1" "version": "v0.16.1"
}, },
"lexik/translation-bundle": {
"version": "v4.0.13"
},
"liip/imagine-bundle": { "liip/imagine-bundle": {
"version": "1.8", "version": "1.8",
"recipe": { "recipe": {
...@@ -383,6 +386,9 @@ ...@@ -383,6 +386,9 @@
"sonata-project/exporter": { "sonata-project/exporter": {
"version": "1.9.1" "version": "1.9.1"
}, },
"sonata-project/intl-bundle": {
"version": "2.5.0"
},
"sonata-project/media-bundle": { "sonata-project/media-bundle": {
"version": "3.13", "version": "3.13",
"recipe": { "recipe": {
...@@ -392,6 +398,15 @@ ...@@ -392,6 +398,15 @@
"ref": "e25412e53b20827db07abb6f2aa0b8e4d26c284c" "ref": "e25412e53b20827db07abb6f2aa0b8e4d26c284c"
} }
}, },
"sonata-project/translation-bundle": {
"version": "2.3",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "2.3",
"ref": "00e821cb362f00c6893f7183311893267330ecfe"
}
},
"sonata-project/user-bundle": { "sonata-project/user-bundle": {
"version": "4.2.3" "version": "4.2.3"
}, },
......
{#<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% block lexik_title %}{% endblock %}</title>
{% block lexik_stylesheets %}
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ asset('bundles/lexiktranslation/ng-table/ng-table.min.css') }}">
{% endblock %}
</head>
<body>
{% block lexik_flash_message %}
<div class="container">
<div class="row">
<div class="col-md-12">
{% set flashes = app.session.flashbag.all() %}
{% if flashes | length > 0 %}
{% for type, messages in flashes %}
{% for message in messages %}
<div class="alert alert-{{ type }}">{{ message }}</div>
{% endfor %}
{% endfor %}
{% endif %}
</div>
</div>
</div>
{% endblock lexik_flash_message %}
{% block lexik_content '' %}
{% block lexik_javascript_footer %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.9/angular.min.js"></script>
<script src="{{ asset('bundles/lexiktranslation/ng-table/ng-table.min.js') }}"></script>
{% endblock %}
</body>
</html>#}
{% extends sonata_admin.adminPool.templates.layout %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ asset('bundles/lexiktranslation/ng-table/ng-table.min.css') }}">
{% endblock %}
{% block content %}
<div class="traductions">
{% block lexik_content %}
{% endblock %}
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.9/angular.min.js"></script>
<script src="{{ asset('bundles/lexiktranslation/ng-table/ng-table.min.js') }}"></script>
{% block lexik_javascript_footer %}{% endblock %}
{% endblock %}
...@@ -212,6 +212,37 @@ file that was distributed with this source code. ...@@ -212,6 +212,37 @@ file that was distributed with this source code.
</ul> </ul>
</div> </div>
{% endif %} {% endif %}
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
{% block sonata_top_nav_menu_locale_block %}
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-flag fa-fw" aria-hidden="true"></i>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</a>
<div class="dropdown-menu multi-column dropdown-add">
<div class="container-fluid">
<div class="row">
<ul class="dropdown-menu">
<li role="presentation" class="dropdown-header">
<i class="fa fa-language"></i>
{{ 'languages'|trans({}, 'SonataTranslationBundle') }}
</li>
{% for locale in sonata_translation_locales %}
<li role="presentation" class="{{ app.request.locale == locale ? 'active' : '' }}">
<a role="menuitem" tabindex="-1" href="{{ path('sonata.translation.locale', {'locale': locale}) }}">
{{ locale|language(locale)|capitalize }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</li>
{% endblock %}
</ul>
</div>
{% endblock %} {% endblock %}
</nav> </nav>
{% endblock sonata_nav %} {% endblock sonata_nav %}
......
layout.logged_in_as: 'Se connecter en tant que' layout:
layout.logout: 'Se déconnecter' logged_in_as: 'Se connecter en tant que'
layout.login: 'Se connecter' logout: 'Se déconnecter'
security.login.username: Email login: 'Se connecter'
security.login.password: 'Mot de passe' security:
security.login.remember_me: 'Se souvenir de moi' login:
security.login.submit: 'Se connecter' username: Email
form.current_password: 'Mot de passe actuel' password: 'Mot de passe'
form.new_password: 'Nouveau mot de passe' remember_me: 'Se souvenir de moi'
form.new_password_confirmation: 'Confirmer le mot de passe' submit: 'Se connecter'
change_password.submit: Confirmer form:
current_password: 'Mot de passe actuel'
new_password: 'Nouveau mot de passe'
new_password_confirmation: 'Confirmer le mot de passe'
change_password:
submit: Confirmer
app.admin.group:
adherent: Adherent
prestataire: Prestataire
groupe: Groupe
app.admin.group:
adherent: Member
prestataire: Recipient
groupe: Group
app:
admin.group:
adherent: Adherent
prestataire: Prestataire
groupe: Groupe
groups: Roles
Commentaires: Comments
app:
admin.group:
adherent: Member
prestataire: Recipient
groupe: Group
move_to_bottom: 'Tout en bas'
move_down: '+ bas'
move_up: '+ haut'
move_to_top: 'Tout en haut'
Commentaires: Commentaires
app:
admin.group:
adherent: Adherent
prestataire: Prestataire
groupe: Groupe
...@@ -19,6 +19,7 @@ Encore ...@@ -19,6 +19,7 @@ Encore
* and one CSS file (e.g. app.css) if you JavaScript imports CSS. * and one CSS file (e.g. app.css) if you JavaScript imports CSS.
*/ */
.addEntry('app', './assets/js/app.js') .addEntry('app', './assets/js/app.js')
.addEntry('admin', './assets/js/admin.js')
//.addEntry('page1', './assets/js/page1.js') //.addEntry('page1', './assets/js/page1.js')
//.addEntry('page2', './assets/js/page2.js') //.addEntry('page2', './assets/js/page2.js')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment