mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
cs: Fix code-style (using PHPCSFixer and PHPCS).
This commit is contained in:
parent
b7360955f7
commit
8401ce2656
@ -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();
|
||||||
|
|
||||||
|
@ -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',
|
'Appel téléphonique',
|
||||||
'Formation',
|
'Formation',
|
||||||
] as $key => $label) {
|
] 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;
|
||||||
|
@ -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
|
||||||
|
@ -12,6 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\DocGeneratorBundle\Serializer\Encoder;
|
namespace Chill\DocGeneratorBundle\Serializer\Encoder;
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
@ -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,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;
|
||||||
|
@ -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(
|
||||||
|
static function (Center $c) {
|
||||||
|
return $c->getId();
|
||||||
|
},
|
||||||
$centers
|
$centers
|
||||||
), true)) {
|
), 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 (
|
||||||
|
$helper->ask(
|
||||||
$this->tempInput,
|
$this->tempInput,
|
||||||
$this->tempOutput,
|
$this->tempOutput,
|
||||||
new ConfirmationQuestion('Are you sure ?', true)
|
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 (
|
||||||
|
false !== ($row = fgetcsv(
|
||||||
$csv,
|
$csv,
|
||||||
0,
|
0,
|
||||||
$input->getOption('delimiter'),
|
$input->getOption('delimiter'),
|
||||||
$input->getOption('enclosure'),
|
$input->getOption('enclosure'),
|
||||||
$input->getOption('escape')
|
$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 (
|
||||||
|
$exportManager->isGrantedForElement(
|
||||||
$export,
|
$export,
|
||||||
null,
|
null,
|
||||||
$exportManager->getPickedCenters($data['centers'])
|
$exportManager->getPickedCenters($data['centers'])
|
||||||
) === false) {
|
) === 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
||||||
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
|
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
|
||||||
|
|
||||||
use function str_replace;
|
use function str_replace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,6 +44,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
|||||||
use Symfony\Component\DependencyInjection\Loader;
|
use Symfony\Component\DependencyInjection\Loader;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,6 +15,7 @@ use LogicException;
|
|||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,6 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|||||||
use Symfony\Component\DependencyInjection\Definition;
|
use Symfony\Component\DependencyInjection\Definition;
|
||||||
use Symfony\Component\DependencyInjection\Reference;
|
use Symfony\Component\DependencyInjection\Reference;
|
||||||
use UnexpectedValueException;
|
use UnexpectedValueException;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
use function get_class;
|
use function get_class;
|
||||||
@ -373,8 +374,10 @@ abstract class AbstractWidgetsCompilerPass implements CompilerPassInterface
|
|||||||
private function isPlaceAllowedForWidget($place, $widgetAlias, ContainerBuilder $container)
|
private function isPlaceAllowedForWidget($place, $widgetAlias, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
if ($this->widgetServices[$widgetAlias] instanceof WidgetFactoryInterface) {
|
if ($this->widgetServices[$widgetAlias] instanceof WidgetFactoryInterface) {
|
||||||
if (in_array($place, $this->widgetServices[$widgetAlias]
|
if (
|
||||||
->getAllowedPlaces(), true)) {
|
in_array($place, $this->widgetServices[$widgetAlias]
|
||||||
|
->getAllowedPlaces(), true)
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -41,8 +41,10 @@ class TrackCreateUpdateSubscriber implements EventSubscriber
|
|||||||
{
|
{
|
||||||
$object = $args->getObject();
|
$object = $args->getObject();
|
||||||
|
|
||||||
if ($object instanceof TrackCreationInterface
|
if (
|
||||||
&& $this->security->getUser() instanceof User) {
|
$object instanceof TrackCreationInterface
|
||||||
|
&& $this->security->getUser() instanceof User
|
||||||
|
) {
|
||||||
$object->setCreatedBy($this->security->getUser());
|
$object->setCreatedBy($this->security->getUser());
|
||||||
$object->setCreatedAt(new DateTimeImmutable('now'));
|
$object->setCreatedAt(new DateTimeImmutable('now'));
|
||||||
}
|
}
|
||||||
@ -59,8 +61,10 @@ class TrackCreateUpdateSubscriber implements EventSubscriber
|
|||||||
|
|
||||||
protected function onUpdate(object $object): void
|
protected function onUpdate(object $object): void
|
||||||
{
|
{
|
||||||
if ($object instanceof TrackUpdateInterface
|
if (
|
||||||
&& $this->security->getUser() instanceof User) {
|
$object instanceof TrackUpdateInterface
|
||||||
|
&& $this->security->getUser() instanceof User
|
||||||
|
) {
|
||||||
$object->setUpdatedBy($this->security->getUser());
|
$object->setUpdatedBy($this->security->getUser());
|
||||||
$object->setUpdatedAt(new DateTimeImmutable('now'));
|
$object->setUpdatedAt(new DateTimeImmutable('now'));
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ namespace Chill\MainBundle\Doctrine\Model;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use JsonSerializable;
|
use JsonSerializable;
|
||||||
|
|
||||||
use function json_encode;
|
use function json_encode;
|
||||||
|
|
||||||
class Point implements JsonSerializable
|
class Point implements JsonSerializable
|
||||||
|
@ -16,6 +16,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
|
|||||||
use Doctrine\DBAL\Types\ConversionException;
|
use Doctrine\DBAL\Types\ConversionException;
|
||||||
use Doctrine\DBAL\Types\DateIntervalType;
|
use Doctrine\DBAL\Types\DateIntervalType;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
use function current;
|
use function current;
|
||||||
use function preg_match;
|
use function preg_match;
|
||||||
|
@ -18,6 +18,7 @@ use RuntimeException;
|
|||||||
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
|
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
|
||||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,6 +26,7 @@ use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
|
|||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use UnexpectedValueException;
|
use UnexpectedValueException;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
use function get_class;
|
use function get_class;
|
||||||
@ -122,8 +123,10 @@ class ExportManager
|
|||||||
public function &getFiltersApplyingOn(ExportInterface $export, ?array $centers = null)
|
public function &getFiltersApplyingOn(ExportInterface $export, ?array $centers = null)
|
||||||
{
|
{
|
||||||
foreach ($this->filters as $alias => $filter) {
|
foreach ($this->filters as $alias => $filter) {
|
||||||
if (in_array($filter->applyOn(), $export->supportsModifiers(), true)
|
if (
|
||||||
&& $this->isGrantedForElement($filter, $export, $centers)) {
|
in_array($filter->applyOn(), $export->supportsModifiers(), true)
|
||||||
|
&& $this->isGrantedForElement($filter, $export, $centers)
|
||||||
|
) {
|
||||||
yield $alias => $filter;
|
yield $alias => $filter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,8 +146,10 @@ class ExportManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->aggregators as $alias => $aggregator) {
|
foreach ($this->aggregators as $alias => $aggregator) {
|
||||||
if (in_array($aggregator->applyOn(), $export->supportsModifiers(), true)
|
if (
|
||||||
&& $this->isGrantedForElement($aggregator, $export, $centers)) {
|
in_array($aggregator->applyOn(), $export->supportsModifiers(), true)
|
||||||
|
&& $this->isGrantedForElement($aggregator, $export, $centers)
|
||||||
|
) {
|
||||||
yield $alias => $aggregator;
|
yield $alias => $aggregator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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