mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles
This commit is contained in:
commit
793f7724a7
@ -60,7 +60,7 @@ code_style:
|
|||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- tests/app/vendor/
|
||||||
|
|
||||||
sa_tests:
|
phpstan_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||||
script:
|
script:
|
||||||
@ -71,6 +71,17 @@ sa_tests:
|
|||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- tests/app/vendor/
|
||||||
|
|
||||||
|
psalm_tests:
|
||||||
|
stage: Tests
|
||||||
|
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||||
|
script:
|
||||||
|
- bin/grumphp run --tasks=psalm
|
||||||
|
artifacts:
|
||||||
|
expire_in: 30 min
|
||||||
|
paths:
|
||||||
|
- bin
|
||||||
|
- tests/app/vendor/
|
||||||
|
|
||||||
unit_tests:
|
unit_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
],
|
],
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"require": {
|
"require": {
|
||||||
"champs-libres/async-uploader-bundle": "dev-sf4",
|
"php": "^7.4",
|
||||||
"champs-libres/wopi-bundle": "dev-master",
|
"champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
|
||||||
"composer/package-versions-deprecated": "^1.10",
|
"champs-libres/wopi-bundle": "dev-master#59b468503b9413f8d588ef9e626e7675560db3d8",
|
||||||
|
"ocramius/package-versions": "^1.10",
|
||||||
"doctrine/doctrine-bundle": "^2.1",
|
"doctrine/doctrine-bundle": "^2.1",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.0",
|
"doctrine/doctrine-migrations-bundle": "^3.0",
|
||||||
"doctrine/orm": "^2.7",
|
"doctrine/orm": "^2.7",
|
||||||
@ -25,28 +26,28 @@
|
|||||||
"ramsey/uuid-doctrine": "^1.7",
|
"ramsey/uuid-doctrine": "^1.7",
|
||||||
"sensio/framework-extra-bundle": "^5.5",
|
"sensio/framework-extra-bundle": "^5.5",
|
||||||
"spomky-labs/base64url": "^2.0",
|
"spomky-labs/base64url": "^2.0",
|
||||||
"symfony/asset": "4.*",
|
"symfony/asset": "^4.4",
|
||||||
"symfony/browser-kit": "^5.2",
|
"symfony/browser-kit": "^4.4",
|
||||||
"symfony/css-selector": "^5.2",
|
"symfony/css-selector": "^4.4",
|
||||||
"symfony/expression-language": "4.*",
|
"symfony/expression-language": "^4.4",
|
||||||
"symfony/form": "4.*",
|
"symfony/form": "^4.4",
|
||||||
"symfony/intl": "4.*",
|
"symfony/intl": "^4.4",
|
||||||
"symfony/mime": "^4 || ^5",
|
"symfony/mime": "^4.4",
|
||||||
"symfony/monolog-bundle": "^3.5",
|
"symfony/monolog-bundle": "^3.5",
|
||||||
"symfony/security-bundle": "4.*",
|
"symfony/security-bundle": "^4.4",
|
||||||
"symfony/serializer": "^5.2",
|
"symfony/serializer": "^5.3",
|
||||||
"symfony/swiftmailer-bundle": "^3.5",
|
"symfony/swiftmailer-bundle": "^3.5",
|
||||||
"symfony/templating": "4.*",
|
"symfony/templating": "^4.4",
|
||||||
"symfony/translation": "4.*",
|
"symfony/translation": "^4.4",
|
||||||
"symfony/twig-bundle": "^4.4",
|
"symfony/twig-bundle": "^4.4",
|
||||||
"symfony/validator": "4.*",
|
"symfony/validator": "^4.4",
|
||||||
"symfony/webpack-encore-bundle": "^1.11",
|
"symfony/webpack-encore-bundle": "^1.11",
|
||||||
"symfony/workflow": "4.*",
|
"symfony/workflow": "^4.4",
|
||||||
"symfony/yaml": "4.*",
|
"symfony/yaml": "^4.4",
|
||||||
"twig/extra-bundle": "^2.12 || ^3.0",
|
"twig/extra-bundle": "^3.0",
|
||||||
"twig/intl-extra": "^3.0",
|
"twig/intl-extra": "^3.0",
|
||||||
"twig/markdown-extra": "^3.3",
|
"twig/markdown-extra": "^3.3",
|
||||||
"twig/twig": "^2.12 || ^3.0"
|
"twig/twig": "^3.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/symfony": "*"
|
"symfony/symfony": "*"
|
||||||
@ -57,17 +58,20 @@
|
|||||||
"fakerphp/faker": "^1.13",
|
"fakerphp/faker": "^1.13",
|
||||||
"nelmio/alice": "^3.8",
|
"nelmio/alice": "^3.8",
|
||||||
"phpstan/phpstan-strict-rules": "^1.0",
|
"phpstan/phpstan-strict-rules": "^1.0",
|
||||||
"phpunit/phpunit": "^7.0",
|
"phpunit/phpunit": ">= 7.5",
|
||||||
"symfony/debug-bundle": "^5.1",
|
"symfony/debug-bundle": "^5.1",
|
||||||
"symfony/dotenv": "^5.1",
|
"symfony/dotenv": "^4.4",
|
||||||
"symfony/maker-bundle": "^1.20",
|
"symfony/maker-bundle": "^1.20",
|
||||||
"symfony/phpunit-bridge": "^5.2",
|
"symfony/phpunit-bridge": "^4.4",
|
||||||
"symfony/stopwatch": "^5.1",
|
"symfony/stopwatch": "^4.4",
|
||||||
"symfony/var-dumper": "4.*",
|
"symfony/var-dumper": "^4.4",
|
||||||
"symfony/web-profiler-bundle": "^5.0"
|
"symfony/web-profiler-bundle": "^4.4",
|
||||||
|
"vimeo/psalm": "^4.15"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"bin-dir": "bin",
|
"bin-dir": "bin",
|
||||||
|
"optimize-autoloader": true,
|
||||||
|
"sort-packages": true,
|
||||||
"vendor-dir": "tests/app/vendor"
|
"vendor-dir": "tests/app/vendor"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -91,7 +91,9 @@ class CountPerson implements ExportInterface
|
|||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
// we gather all center the user choose.
|
// we gather all center the user choose.
|
||||||
$centers = array_map(static function ($el) { return $el['center']; }, $acl);
|
$centers = array_map(static function ($el) {
|
||||||
|
return $el['center'];
|
||||||
|
}, $acl);
|
||||||
|
|
||||||
$qb = $this->entityManager->createQueryBuilder();
|
$qb = $this->entityManager->createQueryBuilder();
|
||||||
|
|
||||||
|
@ -11,53 +11,53 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\MainBundle\DependencyInjection;
|
namespace Chill\MainBundle\DependencyInjection;
|
||||||
|
|
||||||
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure the main bundle.
|
* Configure the main bundle.
|
||||||
*/
|
*/
|
||||||
class ChillMainConfiguration implements ConfigurationInterface
|
class ChillMainConfiguration implements ConfigurationInterface
|
||||||
{
|
{
|
||||||
use AddWidgetConfigurationTrait;
|
use AddWidgetConfigurationTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ContainerBuilder
|
* @var ContainerBuilder
|
||||||
*/
|
*/
|
||||||
private $containerBuilder;
|
private $containerBuilder;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
array $widgetFactories,
|
array $widgetFactories,
|
||||||
ContainerBuilder $containerBuilder
|
ContainerBuilder $containerBuilder
|
||||||
) {
|
) {
|
||||||
// we register here widget factories (see below)
|
// we register here widget factories (see below)
|
||||||
$this->setWidgetFactories($widgetFactories);
|
$this->setWidgetFactories($widgetFactories);
|
||||||
// we will need the container builder later...
|
// we will need the container builder later...
|
||||||
$this->containerBuilder = $containerBuilder;
|
$this->containerBuilder = $containerBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder();
|
||||||
$rootNode = $treeBuilder->root('chill_main');
|
$rootNode = $treeBuilder->root('chill_main');
|
||||||
|
|
||||||
$rootNode
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
->arrayNode('widgets')
|
->arrayNode('widgets')
|
||||||
->canBeDisabled()
|
->canBeDisabled()
|
||||||
->children()
|
->children()
|
||||||
// we declare here all configuration for homepage place
|
// we declare here all configuration for homepage place
|
||||||
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
|
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
|
||||||
->end() // end of widgets/children
|
->end() // end of widgets/children
|
||||||
->end() // end of widgets
|
->end() // end of widgets
|
||||||
->end() // end of root/children
|
->end() // end of root/children
|
||||||
->end() // end of root
|
->end() // end of root
|
||||||
;
|
;
|
||||||
|
|
||||||
return $treeBuilder;
|
return $treeBuilder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
25
grumphp.yml
25
grumphp.yml
@ -12,3 +12,28 @@ parameters:
|
|||||||
tasks.phpcsfixer.allow_risky: true
|
tasks.phpcsfixer.allow_risky: true
|
||||||
tasks.phpcsfixer.diff: true
|
tasks.phpcsfixer.diff: true
|
||||||
tasks.phpstan.level: 1
|
tasks.phpstan.level: 1
|
||||||
|
tasks.phpstan.blocking: true
|
||||||
|
tasks.phpstan.ignore_patterns:
|
||||||
|
- "/.github/"
|
||||||
|
- "/.idea/"
|
||||||
|
- "/build/"
|
||||||
|
- "/benchmarks/"
|
||||||
|
- "/docs/"
|
||||||
|
- "/node_modules/"
|
||||||
|
- "/resource/"
|
||||||
|
- "/spec/"
|
||||||
|
- "/var/"
|
||||||
|
- "/vendor/"
|
||||||
|
|
||||||
|
# Psalm
|
||||||
|
tasks.psalm.blocking: true
|
||||||
|
tasks.psalm.ignore_patterns:
|
||||||
|
- "/.github/"
|
||||||
|
- "/.idea/"
|
||||||
|
- "/build/"
|
||||||
|
- "/benchmarks/"
|
||||||
|
- "/node_modules/"
|
||||||
|
- "/resource/"
|
||||||
|
- "/spec/"
|
||||||
|
- "/var/"
|
||||||
|
- "/vendor/"
|
||||||
|
@ -417,15 +417,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||||
|
|
||||||
-
|
|
||||||
message:
|
|
||||||
"""
|
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
|
||||||
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
|
||||||
"""
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message:
|
message:
|
||||||
"""
|
"""
|
||||||
@ -435,15 +426,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||||
|
|
||||||
-
|
|
||||||
message:
|
|
||||||
"""
|
|
||||||
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
|
||||||
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message:
|
message:
|
||||||
"""
|
"""
|
||||||
|
2006
psalm-baseline.xml
Normal file
2006
psalm-baseline.xml
Normal file
File diff suppressed because it is too large
Load Diff
16
psalm.xml
Normal file
16
psalm.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<psalm
|
||||||
|
errorLevel="7"
|
||||||
|
resolveFromConfigFile="true"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="https://getpsalm.org/schema/config"
|
||||||
|
xsi:schemaLocation="https://getpsalm.org/schema/config tests/app/vendor/vimeo/psalm/config.xsd"
|
||||||
|
errorBaseline="psalm-baseline.xml"
|
||||||
|
>
|
||||||
|
<projectFiles>
|
||||||
|
<directory name="src" />
|
||||||
|
<ignoreFiles>
|
||||||
|
<directory name="./tests/" />
|
||||||
|
</ignoreFiles>
|
||||||
|
</projectFiles>
|
||||||
|
</psalm>
|
@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
final class ActivityController extends AbstractController
|
final class ActivityController extends AbstractController
|
||||||
@ -307,8 +308,10 @@ final class ActivityController extends AbstractController
|
|||||||
$activityData = $request->query->get('activityData');
|
$activityData = $request->query->get('activityData');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
|
if (
|
||||||
|| !$activityType->isActive()) {
|
!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
|
||||||
|
|| !$activityType->isActive()
|
||||||
|
) {
|
||||||
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
||||||
|
|
||||||
if (null !== $activityData) {
|
if (null !== $activityData) {
|
||||||
|
@ -14,7 +14,6 @@ namespace Chill\ActivityBundle\Controller;
|
|||||||
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
||||||
use Chill\ActivityBundle\Form\ActivityReasonCategoryType;
|
use Chill\ActivityBundle\Form\ActivityReasonCategoryType;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ namespace Chill\ActivityBundle\Controller;
|
|||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
use Chill\ActivityBundle\Form\ActivityReasonType;
|
use Chill\ActivityBundle\Form\ActivityReasonType;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ use Chill\MainBundle\Entity\RoleScope;
|
|||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\DependencyInjection;
|
|||||||
|
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||||
|
|
||||||
use function is_int;
|
use function is_int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,6 +25,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ use Symfony\Component\Security\Core\Role\Role;
|
|||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Symfony\Component\Validator\Constraints\Callback;
|
use Symfony\Component\Validator\Constraints\Callback;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
@ -189,7 +190,9 @@ class ListActivity implements ListInterface
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) { return $el['center']; }, $acl);
|
$centers = array_map(static function ($el) {
|
||||||
|
return $el['center'];
|
||||||
|
}, $acl);
|
||||||
|
|
||||||
// throw an error if any fields are present
|
// throw an error if any fields are present
|
||||||
if (!array_key_exists('fields', $data)) {
|
if (!array_key_exists('fields', $data)) {
|
||||||
|
@ -25,6 +25,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
|
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
|
@ -31,6 +31,7 @@ use Symfony\Component\Form\FormEvents;
|
|||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
|
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
|
@ -48,6 +48,7 @@ use Symfony\Component\Form\FormEvent;
|
|||||||
use Symfony\Component\Form\FormEvents;
|
use Symfony\Component\Form\FormEvents;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class ActivityType extends AbstractType
|
class ActivityType extends AbstractType
|
||||||
|
@ -36,8 +36,10 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
if (
|
||||||
&& $this->security->isGranted(ActivityVoter::SEE, $period)) {
|
AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
||||||
|
&& $this->security->isGranted(ActivityVoter::SEE, $period)
|
||||||
|
) {
|
||||||
$menu->addChild($this->translator->trans('Activity'), [
|
$menu->addChild($this->translator->trans('Activity'), [
|
||||||
'route' => 'chill_activity_activity_list',
|
'route' => 'chill_activity_activity_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
|
@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Menu;
|
|||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||||
|
@ -22,6 +22,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
@ -167,7 +168,9 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
|
|||||||
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
|
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
|
||||||
// we get the ids for those scopes
|
// we get the ids for those scopes
|
||||||
$reachablesScopesId = array_map(
|
$reachablesScopesId = array_map(
|
||||||
static function (Scope $scope) { return $scope->getId(); },
|
static function (Scope $scope) {
|
||||||
|
return $scope->getId();
|
||||||
|
},
|
||||||
$reachableScopes
|
$reachableScopes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
|
|
||||||
// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
||||||
// Feel free to remove this, extend it, or make something more sophisticated.
|
// Feel free to remove this, extend it, or make something more sophisticated.
|
||||||
if (isset($_SERVER['HTTP_CLIENT_IP'])
|
if (
|
||||||
|
isset($_SERVER['HTTP_CLIENT_IP'])
|
||||||
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
||||||
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
|
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
|
||||||
) {
|
) {
|
||||||
|
@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\Center;
|
|||||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||||
@ -64,8 +65,10 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
|
|||||||
|
|
||||||
protected function supports($attribute, $subject)
|
protected function supports($attribute, $subject)
|
||||||
{
|
{
|
||||||
if ($subject instanceof Center
|
if (
|
||||||
&& in_array($attribute, $this->getAttributes(), true)) {
|
$subject instanceof Center
|
||||||
|
&& in_array($attribute, $this->getAttributes(), true)
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
|||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||||
|
@ -24,6 +24,7 @@ use RuntimeException;
|
|||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
use Symfony\Component\Security\Core\User\UserInterface;
|
||||||
|
|
||||||
use function implode;
|
use function implode;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
use function strtr;
|
use function strtr;
|
||||||
|
@ -17,6 +17,7 @@ use Symfony\Component\Validator\Constraint;
|
|||||||
use Symfony\Component\Validator\ConstraintValidator;
|
use Symfony\Component\Validator\ConstraintValidator;
|
||||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||||
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||||
|
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ namespace Chill\Migrations\Activity;
|
|||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,6 +19,7 @@ use DateTimeImmutable;
|
|||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
use function random_int;
|
use function random_int;
|
||||||
|
|
||||||
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
||||||
|
@ -18,10 +18,12 @@ class LoadAsideActivityCategory extends \Doctrine\Bundle\FixturesBundle\Fixture
|
|||||||
{
|
{
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
foreach ([
|
foreach (
|
||||||
'Appel téléphonique',
|
[
|
||||||
'Formation',
|
'Appel téléphonique',
|
||||||
] as $key => $label) {
|
'Formation',
|
||||||
|
] as $key => $label
|
||||||
|
) {
|
||||||
$category = new AsideActivityCategory();
|
$category = new AsideActivityCategory();
|
||||||
$category->setTitle(['fr' => $label]);
|
$category->setTitle(['fr' => $label]);
|
||||||
$manager->persist($category);
|
$manager->persist($category);
|
||||||
|
@ -13,6 +13,7 @@ namespace Chill\AsideActivityBundle\DependencyInjection;
|
|||||||
|
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||||
|
|
||||||
use function is_int;
|
use function is_int;
|
||||||
|
|
||||||
class Configuration implements ConfigurationInterface
|
class Configuration implements ConfigurationInterface
|
||||||
|
@ -32,6 +32,7 @@ use Symfony\Component\Form\FormEvent;
|
|||||||
use Symfony\Component\Form\FormEvents;
|
use Symfony\Component\Form\FormEvents;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
final class AsideActivityFormType extends AbstractType
|
final class AsideActivityFormType extends AbstractType
|
||||||
|
@ -13,6 +13,7 @@ namespace Chill\AsideActivityBundle\Menu;
|
|||||||
|
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||||
|
@ -13,6 +13,7 @@ namespace Chill\AMLI\BudgetBundle\Calculator;
|
|||||||
|
|
||||||
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
|
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
|
||||||
use OutOfBoundsException;
|
use OutOfBoundsException;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function array_keys;
|
use function array_keys;
|
||||||
use function implode;
|
use function implode;
|
||||||
|
@ -21,6 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function get_class;
|
use function get_class;
|
||||||
|
|
||||||
abstract class AbstractElementController extends Controller
|
abstract class AbstractElementController extends Controller
|
||||||
|
@ -22,6 +22,7 @@ use Psr\Log\LoggerInterface;
|
|||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
use function array_flip;
|
use function array_flip;
|
||||||
use function asort;
|
use function asort;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
use function array_flip;
|
use function array_flip;
|
||||||
|
|
||||||
class ResourceType extends AbstractType
|
class ResourceType extends AbstractType
|
||||||
|
@ -18,6 +18,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
|||||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||||
|
@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class CalendarRangeAPIController extends ApiController
|
class CalendarRangeAPIController extends ApiController
|
||||||
|
@ -28,6 +28,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
|||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Validator\Constraints\Range;
|
use Symfony\Component\Validator\Constraints\Range;
|
||||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,6 +14,7 @@ namespace Chill\CalendarBundle\Event;
|
|||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Doctrine\Persistence\Event\LifecycleEventArgs;
|
use Doctrine\Persistence\Event\LifecycleEventArgs;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
class ListenToActivityCreate
|
class ListenToActivityCreate
|
||||||
|
@ -20,7 +20,6 @@ use Chill\MainBundle\Entity\User;
|
|||||||
use Chill\MainBundle\Form\Type\CommentType;
|
use Chill\MainBundle\Form\Type\CommentType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
|
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
@ -25,6 +25,7 @@ use Symfony\Component\Console\Question\Question;
|
|||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
use Symfony\Component\Yaml\Exception\ParseException;
|
use Symfony\Component\Yaml\Exception\ParseException;
|
||||||
use Symfony\Component\Yaml\Parser;
|
use Symfony\Component\Yaml\Parser;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,6 +23,7 @@ use Symfony\Bridge\Twig\TwigEngine;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
@ -135,7 +135,7 @@ class CustomFieldDate extends AbstractCustomField
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $date->format('Y-m-d');
|
return $date->format('Y-m-d');
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:date.'
|
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:date.'
|
||||||
|
@ -21,6 +21,7 @@ use LogicException;
|
|||||||
use Symfony\Bridge\Twig\TwigEngine;
|
use Symfony\Bridge\Twig\TwigEngine;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
use function get_class;
|
use function get_class;
|
||||||
use function gettype;
|
use function gettype;
|
||||||
use function is_object;
|
use function is_object;
|
||||||
|
@ -18,7 +18,6 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
||||||
use Symfony\Component\Validator\Constraints\LessThanOrEqual;
|
use Symfony\Component\Validator\Constraints\LessThanOrEqual;
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
class CustomFieldText extends AbstractCustomField
|
class CustomFieldText extends AbstractCustomField
|
||||||
@ -65,8 +66,10 @@ class CustomFieldText extends AbstractCustomField
|
|||||||
|
|
||||||
$attrArray = [];
|
$attrArray = [];
|
||||||
|
|
||||||
if (array_key_exists(self::MULTIPLE_CF_INLINE, $options)
|
if (
|
||||||
&& $options[self::MULTIPLE_CF_INLINE]) {
|
array_key_exists(self::MULTIPLE_CF_INLINE, $options)
|
||||||
|
&& $options[self::MULTIPLE_CF_INLINE]
|
||||||
|
) {
|
||||||
$attrArray['class'] = 'multiple-cf-inline';
|
$attrArray['class'] = 'multiple-cf-inline';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ use Symfony\Component\Form\FormEvent;
|
|||||||
use Symfony\Component\Form\FormEvents;
|
use Symfony\Component\Form\FormEvents;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class CustomFieldsGroupType extends AbstractType
|
class CustomFieldsGroupType extends AbstractType
|
||||||
|
@ -15,6 +15,7 @@ use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup;
|
|||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Symfony\Component\Form\DataTransformerInterface;
|
use Symfony\Component\Form\DataTransformerInterface;
|
||||||
use Symfony\Component\Form\Exception\TransformationFailedException;
|
use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||||
|
|
||||||
use function gettype;
|
use function gettype;
|
||||||
|
|
||||||
class CustomFieldsGroupToIdTransformer implements DataTransformerInterface
|
class CustomFieldsGroupToIdTransformer implements DataTransformerInterface
|
||||||
|
@ -14,7 +14,9 @@ namespace Chill\CustomFieldsBundle\Form\DataTransformer;
|
|||||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Symfony\Component\Form\DataTransformerInterface;
|
use Symfony\Component\Form\DataTransformerInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
use const JSON_THROW_ON_ERROR;
|
use const JSON_THROW_ON_ERROR;
|
||||||
|
|
||||||
class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
|
class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
|
||||||
@ -33,7 +35,9 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
|
|||||||
|
|
||||||
// @TODO: in the array_map callback, CustomField::getLabel() does not exist. What do we do here?
|
// @TODO: in the array_map callback, CustomField::getLabel() does not exist. What do we do here?
|
||||||
$customFieldsLablels = array_map(
|
$customFieldsLablels = array_map(
|
||||||
static function ($e) { return $e->getLabel(); },
|
static function ($e) {
|
||||||
|
return $e->getLabel();
|
||||||
|
},
|
||||||
$customFields
|
$customFields
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ use Symfony\Component\Form\AbstractTypeExtension;
|
|||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\Form\FormView;
|
use Symfony\Component\Form\FormView;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,7 +17,6 @@ use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Form\FormEvent;
|
use Symfony\Component\Form\FormEvent;
|
||||||
|
|
||||||
use Symfony\Component\Form\FormEvents;
|
use Symfony\Component\Form\FormEvents;
|
||||||
|
|
||||||
class ChoicesListType extends AbstractType
|
class ChoicesListType extends AbstractType
|
||||||
|
@ -18,7 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
|
|
||||||
// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
||||||
// Feel free to remove this, extend it, or make something more sophisticated.
|
// Feel free to remove this, extend it, or make something more sophisticated.
|
||||||
if (isset($_SERVER['HTTP_CLIENT_IP'])
|
if (
|
||||||
|
isset($_SERVER['HTTP_CLIENT_IP'])
|
||||||
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
||||||
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
|
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
|
||||||
) {
|
) {
|
||||||
|
@ -12,6 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\DocGeneratorBundle\Context\Exception;
|
namespace Chill\DocGeneratorBundle\Context\Exception;
|
||||||
|
|
||||||
use LogicException;
|
use LogicException;
|
||||||
|
|
||||||
use function get_class;
|
use function get_class;
|
||||||
use function gettype;
|
use function gettype;
|
||||||
use function is_object;
|
use function is_object;
|
||||||
|
@ -28,12 +28,10 @@ use GuzzleHttp\Client;
|
|||||||
use GuzzleHttp\Exception\TransferException;
|
use GuzzleHttp\Exception\TransferException;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||||
use Symfony\Component\HttpFoundation\File\File;
|
use Symfony\Component\HttpFoundation\File\File;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
// TODO à mettre dans services
|
// TODO à mettre dans services
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||||
@ -42,7 +40,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
|||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Symfony\Component\HttpKernel\KernelInterface;
|
use Symfony\Component\HttpKernel\KernelInterface;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||||
|
|
||||||
@ -206,8 +203,10 @@ final class DocGeneratorTemplateController extends AbstractController
|
|||||||
|
|
||||||
$contextGenerationData = [];
|
$contextGenerationData = [];
|
||||||
|
|
||||||
if ($context instanceof DocGeneratorContextWithPublicFormInterface
|
if (
|
||||||
&& $context->hasPublicForm($template, $entity) || $isTest) {
|
$context instanceof DocGeneratorContextWithPublicFormInterface
|
||||||
|
&& $context->hasPublicForm($template, $entity) || $isTest
|
||||||
|
) {
|
||||||
if ($context instanceof DocGeneratorContextWithPublicFormInterface) {
|
if ($context instanceof DocGeneratorContextWithPublicFormInterface) {
|
||||||
$builder = $this->createFormBuilder(
|
$builder = $this->createFormBuilder(
|
||||||
array_merge(
|
array_merge(
|
||||||
|
@ -54,8 +54,10 @@ class DocGeneratorTemplateType extends AbstractType
|
|||||||
'required' => true,
|
'required' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($context instanceof DocGeneratorContextWithAdminFormInterface
|
if (
|
||||||
&& $context->hasAdminForm()) {
|
$context instanceof DocGeneratorContextWithAdminFormInterface
|
||||||
|
&& $context->hasAdminForm()
|
||||||
|
) {
|
||||||
$sub = $builder
|
$sub = $builder
|
||||||
->create('options', null, ['compound' => true])
|
->create('options', null, ['compound' => true])
|
||||||
->addModelTransformer(new CallbackTransformer(
|
->addModelTransformer(new CallbackTransformer(
|
||||||
|
@ -15,6 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
|||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class AdminMenuBuilder implements LocalMenuBuilderInterface
|
class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||||
|
@ -11,13 +11,15 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\DocGeneratorBundle\Serializer\Encoder;
|
namespace Chill\DocGeneratorBundle\Serializer\Encoder;
|
||||||
|
|
||||||
|
use Symfony\Component\Serializer\Encoder\EncoderInterface;
|
||||||
|
|
||||||
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
||||||
use function array_keys;
|
use function array_keys;
|
||||||
use function is_array;
|
use function is_array;
|
||||||
|
|
||||||
class DocGenEncoder implements \Symfony\Component\Serializer\Encoder\EncoderInterface
|
class DocGenEncoder implements EncoderInterface
|
||||||
{
|
{
|
||||||
public function encode($data, string $format, array $context = [])
|
public function encode($data, $format, array $context = [])
|
||||||
{
|
{
|
||||||
if (!$this->isAssociative($data)) {
|
if (!$this->isAssociative($data)) {
|
||||||
throw new UnexpectedValueException('Only associative arrays are allowed; lists are not allowed');
|
throw new UnexpectedValueException('Only associative arrays are allowed; lists are not allowed');
|
||||||
@ -29,7 +31,7 @@ class DocGenEncoder implements \Symfony\Component\Serializer\Encoder\EncoderInte
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsEncoding(string $format)
|
public function supportsEncoding($format)
|
||||||
{
|
{
|
||||||
return 'docgen' === $format;
|
return 'docgen' === $format;
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\DocGeneratorBundle\Serializer\Helper;
|
namespace Chill\DocGeneratorBundle\Serializer\Helper;
|
||||||
|
|
||||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||||
|
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
|
|
||||||
class NormalizeNullValueHelper
|
class NormalizeNullValueHelper
|
||||||
|
@ -26,10 +26,11 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $object
|
* @param Collection $object
|
||||||
|
* @param null|string $format
|
||||||
*
|
*
|
||||||
* @return array|ArrayObject|bool|float|int|string|void|null
|
* @return array|ArrayObject|bool|float|int|string|void|null
|
||||||
*/
|
*/
|
||||||
public function normalize($object, ?string $format = null, array $context = [])
|
public function normalize($object, $format = null, array $context = [])
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsNormalization($data, ?string $format = null, array $context = [])
|
public function supportsNormalization($data, $format = null, array $context = [])
|
||||||
{
|
{
|
||||||
if ('docgen' !== $format) {
|
if ('docgen' !== $format) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -26,6 +26,7 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
|||||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
|
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
|
||||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
|
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
|
||||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||||
|
|
||||||
use function array_filter;
|
use function array_filter;
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
@ -54,7 +55,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
|||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function normalize($object, ?string $format = null, array $context = [])
|
public function normalize($object, $format = null, array $context = [])
|
||||||
{
|
{
|
||||||
$classMetadataKey = $object ?? $context['docgen:expects'] ?? null;
|
$classMetadataKey = $object ?? $context['docgen:expects'] ?? null;
|
||||||
|
|
||||||
@ -65,7 +66,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
|||||||
if (!$this->classMetadataFactory->hasMetadataFor($classMetadataKey)) {
|
if (!$this->classMetadataFactory->hasMetadataFor($classMetadataKey)) {
|
||||||
throw new LogicException(sprintf(
|
throw new LogicException(sprintf(
|
||||||
'This object does not have metadata: %s. Add groups on this entity to allow to serialize with the format %s and groups %s',
|
'This object does not have metadata: %s. Add groups on this entity to allow to serialize with the format %s and groups %s',
|
||||||
is_object($object) ? get_class($object) : '(todo' /*$context['docgen:expects'],*/ ,
|
is_object($object) ? get_class($object) : '(todo' /*$context['docgen:expects'],*/,
|
||||||
$format,
|
$format,
|
||||||
implode(', ', ($context['groups'] ?? []))
|
implode(', ', ($context['groups'] ?? []))
|
||||||
));
|
));
|
||||||
@ -95,7 +96,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
|||||||
return $this->normalizeObject($object, $format, $context, $expectedGroups, $metadata, $attributes);
|
return $this->normalizeObject($object, $format, $context, $expectedGroups, $metadata, $attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsNormalization($data, ?string $format = null): bool
|
public function supportsNormalization($data, $format = null): bool
|
||||||
{
|
{
|
||||||
return 'docgen' === $format && (is_object($data) || null === $data);
|
return 'docgen' === $format && (is_object($data) || null === $data);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ use Chill\MainBundle\Entity\RoleScope;
|
|||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,6 +19,7 @@ use Symfony\Component\Form\CallbackTransformer;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
use function json_decode;
|
use function json_decode;
|
||||||
use function json_encode;
|
use function json_encode;
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
|||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||||
@ -101,8 +102,10 @@ class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements Prov
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AccompanyingPeriod::STEP_CLOSED === $subject->getCourse()->getStep()
|
if (
|
||||||
&& in_array($attribute, [self::CREATE, self::DELETE, self::UPDATE], true)) {
|
AccompanyingPeriod::STEP_CLOSED === $subject->getCourse()->getStep()
|
||||||
|
&& in_array($attribute, [self::CREATE, self::DELETE, self::UPDATE], true)
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,8 +95,10 @@ class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHiera
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($subject instanceof PersonDocument
|
if (
|
||||||
&& !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())) {
|
$subject instanceof PersonDocument
|
||||||
|
&& !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +14,6 @@ namespace Chill\EventBundle\Controller;
|
|||||||
use Chill\EventBundle\Entity\EventType;
|
use Chill\EventBundle\Entity\EventType;
|
||||||
use Chill\EventBundle\Form\EventTypeType;
|
use Chill\EventBundle\Form\EventTypeType;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,7 +113,9 @@ class ParticipationController extends AbstractController
|
|||||||
[
|
[
|
||||||
'event_id' => current($participations)->getEvent()->getId(),
|
'event_id' => current($participations)->getEvent()->getId(),
|
||||||
'persons_ids' => implode(',', array_map(
|
'persons_ids' => implode(',', array_map(
|
||||||
static function (Participation $p) { return $p->getPerson()->getId(); },
|
static function (Participation $p) {
|
||||||
|
return $p->getPerson()->getId();
|
||||||
|
},
|
||||||
$participations
|
$participations
|
||||||
)),
|
)),
|
||||||
]
|
]
|
||||||
@ -648,7 +651,9 @@ class ParticipationController extends AbstractController
|
|||||||
/** @var \Doctrine\Common\Collections\ArrayCollection $peopleParticipating */
|
/** @var \Doctrine\Common\Collections\ArrayCollection $peopleParticipating */
|
||||||
$peopleParticipating = $peopleParticipating ??
|
$peopleParticipating = $peopleParticipating ??
|
||||||
$participation->getEvent()->getParticipations()->map(
|
$participation->getEvent()->getParticipations()->map(
|
||||||
static function (Participation $p) { return $p->getPerson()->getId(); }
|
static function (Participation $p) {
|
||||||
|
return $p->getPerson()->getId();
|
||||||
|
}
|
||||||
);
|
);
|
||||||
// check that the user is not already in the event
|
// check that the user is not already in the event
|
||||||
if ($peopleParticipating->contains($participation->getPerson()->getId())) {
|
if ($peopleParticipating->contains($participation->getPerson()->getId())) {
|
||||||
|
@ -14,7 +14,6 @@ namespace Chill\EventBundle\Controller;
|
|||||||
use Chill\EventBundle\Entity\Status;
|
use Chill\EventBundle\Entity\Status;
|
||||||
use Chill\EventBundle\Form\StatusType;
|
use Chill\EventBundle\Form\StatusType;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\RoleScope;
|
|||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,6 +21,7 @@ use DateTime;
|
|||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -172,15 +173,19 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->getRole()->getType()->getId() !==
|
if (
|
||||||
$this->getEvent()->getType()->getId()) {
|
$this->getRole()->getType()->getId() !==
|
||||||
|
$this->getEvent()->getType()->getId()
|
||||||
|
) {
|
||||||
$context->buildViolation('The role is not allowed with this event type')
|
$context->buildViolation('The role is not allowed with this event type')
|
||||||
->atPath('role')
|
->atPath('role')
|
||||||
->addViolation();
|
->addViolation();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->getStatus()->getType()->getId() !==
|
if (
|
||||||
$this->getEvent()->getType()->getId()) {
|
$this->getStatus()->getType()->getId() !==
|
||||||
|
$this->getEvent()->getType()->getId()
|
||||||
|
) {
|
||||||
$context->buildViolation('The status is not allowed with this event type')
|
$context->buildViolation('The status is not allowed with this event type')
|
||||||
->atPath('status')
|
->atPath('status')
|
||||||
->addViolation();
|
->addViolation();
|
||||||
|
@ -16,6 +16,7 @@ use Doctrine\ORM\EntityRepository;
|
|||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
|
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
|
||||||
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
|
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
|
||||||
|
|
||||||
use function call_user_func;
|
use function call_user_func;
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
@ -83,8 +84,10 @@ class EventChoiceLoader implements ChoiceLoaderInterface
|
|||||||
|
|
||||||
$event = $this->eventRepository->find($value);
|
$event = $this->eventRepository->find($value);
|
||||||
|
|
||||||
if ($this->hasCenterFilter()
|
if (
|
||||||
&& !in_array($event->getCenter(), $this->centers, true)) {
|
$this->hasCenterFilter()
|
||||||
|
&& !in_array($event->getCenter(), $this->centers, true)
|
||||||
|
) {
|
||||||
throw new RuntimeException('chosen an event not in correct center');
|
throw new RuntimeException('chosen an event not in correct center');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
|||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
use function is_array;
|
use function is_array;
|
||||||
|
|
||||||
@ -170,10 +171,14 @@ class PickEventType extends AbstractType
|
|||||||
. 'option must be an instance of ' . Center::class);
|
. 'option must be an instance of ' . Center::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($c->getId(), array_map(
|
if (
|
||||||
static function (Center $c) { return $c->getId(); },
|
!in_array($c->getId(), array_map(
|
||||||
$centers
|
static function (Center $c) {
|
||||||
), true)) {
|
return $c->getId();
|
||||||
|
},
|
||||||
|
$centers
|
||||||
|
), true)
|
||||||
|
) {
|
||||||
throw new AccessDeniedException('The given center is not reachable');
|
throw new AccessDeniedException('The given center is not reachable');
|
||||||
}
|
}
|
||||||
$selectedCenters[] = $c;
|
$selectedCenters[] = $c;
|
||||||
|
@ -20,6 +20,7 @@ use Doctrine\ORM\EntityRepository;
|
|||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Templating\EngineInterface as TemplatingEngine;
|
use Symfony\Component\Templating\EngineInterface as TemplatingEngine;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -174,7 +175,8 @@ class EventSearch extends AbstractSearch
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
(isset($terms['name']) || isset($terms['_default']))
|
(isset($terms['name']) || isset($terms['_default']))
|
||||||
&& (!empty($terms['name']) || !empty($terms['_default']))) {
|
&& (!empty($terms['name']) || !empty($terms['_default']))
|
||||||
|
) {
|
||||||
// the form with name:"xyz" has precedence
|
// the form with name:"xyz" has precedence
|
||||||
$name = $terms['name'] ?? $terms['_default'];
|
$name = $terms['name'] ?? $terms['_default'];
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ use Psr\Log\LoggerInterface;
|
|||||||
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\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ use Psr\Log\LoggerInterface;
|
|||||||
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\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ use Doctrine\ORM\Mapping\ClassMetadata;
|
|||||||
use LogicException;
|
use LogicException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -207,7 +208,9 @@ class TimelineEventProvider implements TimelineProviderInterface
|
|||||||
|
|
||||||
foreach ($reachableCenters as $center) {
|
foreach ($reachableCenters as $center) {
|
||||||
$reachableCircleId = array_map(
|
$reachableCircleId = array_map(
|
||||||
static function (Scope $scope) { return $scope->getId(); },
|
static function (Scope $scope) {
|
||||||
|
return $scope->getId();
|
||||||
|
},
|
||||||
$this->helper->getReachableCircles($this->user, $role, $person->getCenter())
|
$this->helper->getReachableCircles($this->user, $role, $person->getCenter())
|
||||||
);
|
);
|
||||||
$centerAndScopeLines[] = sprintf(
|
$centerAndScopeLines[] = sprintf(
|
||||||
|
@ -18,6 +18,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
|||||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class FamilyMemberVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
class FamilyMemberVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||||
|
@ -22,6 +22,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
|
|
||||||
abstract class AbstractCRUDController extends AbstractController
|
abstract class AbstractCRUDController extends AbstractController
|
||||||
|
@ -23,6 +23,7 @@ use Symfony\Component\Serializer\Exception\NotEncodableValueException;
|
|||||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||||
|
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
use function ucfirst;
|
use function ucfirst;
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ namespace Chill\MainBundle\CRUD\Resolver;
|
|||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function strtoupper;
|
use function strtoupper;
|
||||||
|
|
||||||
|
@ -16,11 +16,13 @@ use Symfony\Component\Config\Loader\Loader;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Routing\Route;
|
use Symfony\Component\Routing\Route;
|
||||||
use Symfony\Component\Routing\RouteCollection;
|
use Symfony\Component\Routing\RouteCollection;
|
||||||
|
|
||||||
use function array_filter;
|
use function array_filter;
|
||||||
use function array_keys;
|
use function array_keys;
|
||||||
use function array_search;
|
use function array_search;
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
use const ARRAY_FILTER_USE_BOTH;
|
use const ARRAY_FILTER_USE_BOTH;
|
||||||
|
|
||||||
class CRUDRoutesLoader extends Loader
|
class CRUDRoutesLoader extends Loader
|
||||||
@ -139,7 +141,9 @@ class CRUDRoutesLoader extends Loader
|
|||||||
|
|
||||||
$methods = array_keys(array_filter(
|
$methods = array_keys(array_filter(
|
||||||
$action['methods'],
|
$action['methods'],
|
||||||
static function ($value, $key) { return $value; },
|
static function ($value, $key) {
|
||||||
|
return $value;
|
||||||
|
},
|
||||||
ARRAY_FILTER_USE_BOTH
|
ARRAY_FILTER_USE_BOTH
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ use Symfony\Component\Console\Question\ConfirmationQuestion;
|
|||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function array_keys;
|
use function array_keys;
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
@ -308,8 +309,10 @@ class ChillImportUsersCommand extends Command
|
|||||||
|
|
||||||
$permissionGroupsByName = [];
|
$permissionGroupsByName = [];
|
||||||
|
|
||||||
foreach ($this->em->getRepository(PermissionsGroup::class)
|
foreach (
|
||||||
->findAll() as $permissionGroup) {
|
$this->em->getRepository(PermissionsGroup::class)
|
||||||
|
->findAll() as $permissionGroup
|
||||||
|
) {
|
||||||
$permissionGroupsByName[$permissionGroup->getName()] = $permissionGroup;
|
$permissionGroupsByName[$permissionGroup->getName()] = $permissionGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,11 +341,13 @@ class ChillImportUsersCommand extends Command
|
|||||||
|
|
||||||
$this->tempOutput->writeln('You have chosen ' . implode(', ', $keys));
|
$this->tempOutput->writeln('You have chosen ' . implode(', ', $keys));
|
||||||
|
|
||||||
if ($helper->ask(
|
if (
|
||||||
$this->tempInput,
|
$helper->ask(
|
||||||
$this->tempOutput,
|
$this->tempInput,
|
||||||
new ConfirmationQuestion('Are you sure ?', true)
|
$this->tempOutput,
|
||||||
)) {
|
new ConfirmationQuestion('Are you sure ?', true)
|
||||||
|
)
|
||||||
|
) {
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
$this->permissionGroups[$alias][] = $permissionGroupsByName[$key];
|
$this->permissionGroups[$alias][] = $permissionGroupsByName[$key];
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
|||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
@ -141,8 +142,10 @@ class ChillUserSendRenewPasswordCodeCommand extends Command
|
|||||||
|
|
||||||
$headers = $reader->getHeader();
|
$headers = $reader->getHeader();
|
||||||
|
|
||||||
if (false === in_array('username', $headers, true)
|
if (
|
||||||
&& false === in_array('email', $headers, true)) {
|
false === in_array('username', $headers, true)
|
||||||
|
&& false === in_array('email', $headers, true)
|
||||||
|
) {
|
||||||
throw new InvalidArgumentException('The csv file does not have an '
|
throw new InvalidArgumentException('The csv file does not have an '
|
||||||
. 'username or email header');
|
. 'username or email header');
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
|||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Intl\Intl;
|
use Symfony\Component\Intl\Intl;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -24,6 +24,7 @@ use Symfony\Component\Console\Input\InputOption;
|
|||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class LoadPostalCodesCommand extends Command
|
class LoadPostalCodesCommand extends Command
|
||||||
@ -88,13 +89,15 @@ class LoadPostalCodesCommand extends Command
|
|||||||
$num = 0;
|
$num = 0;
|
||||||
$line = 0;
|
$line = 0;
|
||||||
|
|
||||||
while (false !== ($row = fgetcsv(
|
while (
|
||||||
$csv,
|
false !== ($row = fgetcsv(
|
||||||
0,
|
$csv,
|
||||||
$input->getOption('delimiter'),
|
0,
|
||||||
$input->getOption('enclosure'),
|
$input->getOption('delimiter'),
|
||||||
$input->getOption('escape')
|
$input->getOption('enclosure'),
|
||||||
))) {
|
$input->getOption('escape')
|
||||||
|
))
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
$this->addPostalCode($row, $output);
|
$this->addPostalCode($row, $output);
|
||||||
++$num;
|
++$num;
|
||||||
|
@ -23,6 +23,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||||
|
|
||||||
use function trim;
|
use function trim;
|
||||||
|
|
||||||
final class AddressReferenceAPIController extends ApiController
|
final class AddressReferenceAPIController extends ApiController
|
||||||
|
@ -12,7 +12,6 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
class AdminController extends AbstractController
|
class AdminController extends AbstractController
|
||||||
|
@ -14,7 +14,6 @@ namespace Chill\MainBundle\Controller;
|
|||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
use Chill\MainBundle\Form\CenterType;
|
use Chill\MainBundle\Form\CenterType;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ use Symfony\Component\Form\FormFactoryInterface;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
use function serialize;
|
use function serialize;
|
||||||
use function unserialize;
|
use function unserialize;
|
||||||
@ -484,11 +485,13 @@ class ExportController extends AbstractController
|
|||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
|
|
||||||
// check ACL
|
// check ACL
|
||||||
if ($exportManager->isGrantedForElement(
|
if (
|
||||||
$export,
|
$exportManager->isGrantedForElement(
|
||||||
null,
|
$export,
|
||||||
$exportManager->getPickedCenters($data['centers'])
|
null,
|
||||||
) === false) {
|
$exportManager->getPickedCenters($data['centers'])
|
||||||
|
) === false
|
||||||
|
) {
|
||||||
throw $this->createAccessDeniedException('you do not have '
|
throw $this->createAccessDeniedException('you do not have '
|
||||||
. 'access to this export for those centers');
|
. 'access to this export for those centers');
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
|||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function json_decode;
|
use function json_decode;
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ use Symfony\Component\Security\Core\Role\Role;
|
|||||||
use Symfony\Component\Security\Core\Role\RoleHierarchy;
|
use Symfony\Component\Security\Core\Role\RoleHierarchy;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
use function array_map;
|
use function array_map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,12 +55,12 @@ class PostalCodeController extends AbstractController
|
|||||||
->createQuery(
|
->createQuery(
|
||||||
sprintf(
|
sprintf(
|
||||||
'SELECT p.id AS id, p.name AS name, p.code AS code, '
|
'SELECT p.id AS id, p.name AS name, p.code AS code, '
|
||||||
. 'country.name AS country_name, '
|
. 'country.name AS country_name, '
|
||||||
. 'country.countryCode AS country_code '
|
. 'country.countryCode AS country_code '
|
||||||
. 'FROM %s p '
|
. 'FROM %s p '
|
||||||
. 'JOIN p.country country '
|
. 'JOIN p.country country '
|
||||||
. 'WHERE LOWER(p.name) LIKE LOWER(:pattern) OR LOWER(p.code) LIKE LOWER(:pattern) '
|
. 'WHERE LOWER(p.name) LIKE LOWER(:pattern) OR LOWER(p.code) LIKE LOWER(:pattern) '
|
||||||
. 'ORDER BY code',
|
. 'ORDER BY code',
|
||||||
PostalCode::class
|
PostalCode::class
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -27,6 +27,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
use function key;
|
use function key;
|
||||||
use function reset;
|
use function reset;
|
||||||
|
@ -17,6 +17,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class TimelineCenterController extends AbstractController
|
class TimelineCenterController extends AbstractController
|
||||||
|
@ -18,6 +18,7 @@ use Doctrine\Persistence\ObjectManager;
|
|||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Component\Intl\Intl;
|
use Symfony\Component\Intl\Intl;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,7 +52,7 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface,
|
|||||||
if (
|
if (
|
||||||
!in_array($code, $this->regionalVersionToInclude, true)
|
!in_array($code, $this->regionalVersionToInclude, true)
|
||||||
&& !in_array($code, $this->ancientToExclude, true)
|
&& !in_array($code, $this->ancientToExclude, true)
|
||||||
) {
|
) {
|
||||||
$lang = (new Language())
|
$lang = (new Language())
|
||||||
->setId($code)
|
->setId($code)
|
||||||
->setName($this->prepareName($code));
|
->setName($this->prepareName($code));
|
||||||
|
@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\PostalCode;
|
|||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
use function strtolower;
|
use function strtolower;
|
||||||
use function ucwords;
|
use function ucwords;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user