From 3cf8609e8f73f17a4a8b06d83d65529aa0fdd14c Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 4 Jul 2022 17:20:03 +0200 Subject: [PATCH 01/35] [event] fix deprecation (type missing) --- src/Bundle/ChillEventBundle/Controller/EventController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index 0dcaf176a..5d00387c8 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -273,7 +273,7 @@ class EventController extends AbstractController /** * @var Center $centers */ - $centers = $this->authorizationHelper->getReachableCenters($this->getUser(), $role); + $centers = $this->authorizationHelper->getReachableCenters($this->getUser(), (string) $role); if (count($centers) === 1) { return $this->redirectToRoute('chill_event__event_new', [ From 389f014d361ec8880d8c98cb4fa1f28e8656b3d0 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 5 Jul 2022 10:18:07 +0200 Subject: [PATCH 02/35] [event] fix deprecation (typing) --- src/Bundle/ChillEventBundle/Form/Type/PickEventType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php index 6b0b2d1ab..68500e55e 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php @@ -151,7 +151,7 @@ class PickEventType extends AbstractType } else { $centers = $this->authorizationHelper->getReachableCenters( $this->user, - $options['role'] + (string) $options['role'] ); } From 36e35f2e8fd457e437f27982684d4b241da51870 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 6 Jul 2022 13:36:20 +0200 Subject: [PATCH 03/35] [event] refactor admin for event bundle --- .../Controller/AdminController.php | 17 ++---- .../Menu/AdminMenuBuilder.php | 61 +++++++++++++++++++ .../Resources/views/Admin/index.html.twig | 13 ++++ .../Resources/views/Admin/layout.html.twig | 31 ---------- .../Resources/views/Admin/menu.html.twig | 18 ------ .../Resources/views/EventType/edit.html.twig | 2 +- .../Resources/views/EventType/index.html.twig | 2 +- .../Resources/views/EventType/new.html.twig | 2 +- .../Resources/views/EventType/show.html.twig | 2 +- .../Resources/views/Role/edit.html.twig | 2 +- .../Resources/views/Role/index.html.twig | 2 +- .../Resources/views/Role/new.html.twig | 2 +- .../Resources/views/Role/show.html.twig | 2 +- .../Resources/views/Status/edit.html.twig | 2 +- .../Resources/views/Status/index.html.twig | 2 +- .../Resources/views/Status/new.html.twig | 2 +- .../Resources/views/Status/show.html.twig | 2 +- .../ChillEventBundle/config/routes.yaml | 34 +++++------ .../ChillEventBundle/config/services.yaml | 9 +++ 19 files changed, 118 insertions(+), 89 deletions(-) create mode 100644 src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php create mode 100644 src/Bundle/ChillEventBundle/Resources/views/Admin/index.html.twig delete mode 100644 src/Bundle/ChillEventBundle/Resources/views/Admin/layout.html.twig diff --git a/src/Bundle/ChillEventBundle/Controller/AdminController.php b/src/Bundle/ChillEventBundle/Controller/AdminController.php index aca3b5a04..81918436e 100644 --- a/src/Bundle/ChillEventBundle/Controller/AdminController.php +++ b/src/Bundle/ChillEventBundle/Controller/AdminController.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\EventBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\Routing\Annotation\Route; /** * Class AdminController @@ -20,18 +21,12 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class AdminController extends AbstractController { /** - * @return \Symfony\Component\HttpFoundation\Response + * Event admin. + * + * @Route("/{_locale}/admin/event", name="chill_event_admin_index") */ - public function indexAction() + public function indexAdminAction() { - return $this->render('ChillEventBundle:Admin:layout.html.twig'); - } - - /** - * @return \Symfony\Component\HttpFoundation\RedirectResponse - */ - public function redirectToAdminIndexAction() - { - return $this->redirectToRoute('chill_main_admin_central'); + return $this->render('ChillEventBundle:Admin:index.html.twig'); } } diff --git a/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php new file mode 100644 index 000000000..cede2a5b8 --- /dev/null +++ b/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php @@ -0,0 +1,61 @@ +authorizationChecker = $authorizationChecker; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { + return; + } + + $menu->addChild('Events', [ + 'route' => 'chill_event_admin_index', + ]) + ->setAttribute('class', 'list-group-item-header') + ->setExtras([ + 'order' => 6500 + ]); + + $menu->addChild('Event type', [ + 'route' => 'chill_eventtype_admin', + ])->setExtras(['order' => 6510]); + + $menu->addChild('Event status', [ + 'route' => 'chill_event_admin_status', + ])->setExtras(['order' => 6520]); + + $menu->addChild('Role', [ + 'route' => 'chill_event_admin_role', + ])->setExtras(['order' => 6530]); + } + + public static function getMenuIds(): array + { + return ['admin_section', 'admin_event']; + } +} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Admin/index.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Admin/index.html.twig new file mode 100644 index 000000000..4ad95b49c --- /dev/null +++ b/src/Bundle/ChillEventBundle/Resources/views/Admin/index.html.twig @@ -0,0 +1,13 @@ +{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} + +{% block vertical_menu_content %} + {{ chill_menu('admin_event', { + 'layout': '@ChillMain/Admin/menu_admin_section.html.twig', + }) }} +{% endblock %} + +{% block layout_wvm_content %} + {% block admin_content %} +

{{ 'Events configuration' |trans }}

+ {% endblock %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillEventBundle/Resources/views/Admin/layout.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Admin/layout.html.twig deleted file mode 100644 index 827f4610e..000000000 --- a/src/Bundle/ChillEventBundle/Resources/views/Admin/layout.html.twig +++ /dev/null @@ -1,31 +0,0 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} - -{% block vertical_menu_content %} - {{ chill_menu('admin_events', { - 'layout': '@ChillEvent/Admin/menu.html.twig', - }) }} -{% endblock %} - -{% block layout_wvm_content %} - {% block admin_content %} -

{{ 'Events configuration' |trans }}

- {% endblock %} -{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillEventBundle/Resources/views/Admin/menu.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Admin/menu.html.twig index 2e804277d..f587d97c4 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Admin/menu.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Admin/menu.html.twig @@ -1,21 +1,3 @@ -{# - * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - {% extends "@ChillMain/Menu/verticalMenu.html.twig" %} {% block v_menu_title %}{{ 'Events configuration menu'|trans }}{% endblock %} diff --git a/src/Bundle/ChillEventBundle/Resources/views/EventType/edit.html.twig b/src/Bundle/ChillEventBundle/Resources/views/EventType/edit.html.twig index 3f2f5b146..205b8791b 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/EventType/edit.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/EventType/edit.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/EventType/index.html.twig b/src/Bundle/ChillEventBundle/Resources/views/EventType/index.html.twig index 308974770..9c62697f3 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/EventType/index.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/EventType/index.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/EventType/new.html.twig b/src/Bundle/ChillEventBundle/Resources/views/EventType/new.html.twig index e7d2f0d66..4c0823cdc 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/EventType/new.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/EventType/new.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/EventType/show.html.twig b/src/Bundle/ChillEventBundle/Resources/views/EventType/show.html.twig index 3e0aaba03..0dbd66b17 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/EventType/show.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/EventType/show.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Role/edit.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Role/edit.html.twig index a0b2d4f92..0c9d61795 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Role/edit.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Role/edit.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%}

{{ 'Role edit'|trans }}

diff --git a/src/Bundle/ChillEventBundle/Resources/views/Role/index.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Role/index.html.twig index 4fb4f866f..091b2f6ac 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Role/index.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Role/index.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Role/new.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Role/new.html.twig index da0a3e459..03681f30c 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Role/new.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Role/new.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Role/show.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Role/show.html.twig index 2fb920eb2..68a15958f 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Role/show.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Role/show.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Status/edit.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Status/edit.html.twig index e376e05e3..3d00a66fa 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Status/edit.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Status/edit.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Status/index.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Status/index.html.twig index 7ac4ed37e..144a80e51 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Status/index.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Status/index.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Status/new.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Status/new.html.twig index aa3ecc374..03ba1de3a 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Status/new.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Status/new.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Status/show.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Status/show.html.twig index 624997026..0e0a75069 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Status/show.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Status/show.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillEventBundle:Admin:layout.html.twig" %} +{% extends "ChillEventBundle:Admin:index.html.twig" %} {% block admin_content -%} diff --git a/src/Bundle/ChillEventBundle/config/routes.yaml b/src/Bundle/ChillEventBundle/config/routes.yaml index 2abb338bd..afa6bbe2b 100644 --- a/src/Bundle/ChillEventBundle/config/routes.yaml +++ b/src/Bundle/ChillEventBundle/config/routes.yaml @@ -9,24 +9,24 @@ chill_event_participation: ## ADMIN -chill_event_admin: +chill_event_admin_index: path: /{_locale}/admin/event - controller: Chill\EventBundle\Controller\AdminController::indexAction - options: - menus: - admin_section: - order: 2100 - label: "Events" - icons: ['calendar'] + controller: Chill\EventBundle\Controller\AdminController::indexAdminAction + # options: + # menus: + # admin_section: + # order: 2100 + # label: "Events" + # icons: ['calendar'] -chill_event_admin_redirect_to_admin_index: - path: /{_locale}/admin/event_redirect_to_main - controller: Chill\EventBundle\Controller\AdminController::redirectToAdminIndexAction - options: - menus: - admin_events: - order: 0 - label: Main admin menu +# chill_event_admin_redirect_to_admin_index: +# path: /{_locale}/admin/event_redirect_to_main +# controller: Chill\EventBundle\Controller\AdminController::redirectToAdminIndexAction +# options: +# menus: +# admin_events: +# order: 0 +# label: Main admin menu chill_event_admin_status: resource: "@ChillEventBundle/config/routes/status.yaml" @@ -39,4 +39,4 @@ chill_event_admin_role: chill_event_admin_event_type: resource: "@ChillEventBundle/config/routes/eventtype.yaml" prefix: /{_locale}/admin/event/event_type - + diff --git a/src/Bundle/ChillEventBundle/config/services.yaml b/src/Bundle/ChillEventBundle/config/services.yaml index 8287f32b5..cee12a024 100644 --- a/src/Bundle/ChillEventBundle/config/services.yaml +++ b/src/Bundle/ChillEventBundle/config/services.yaml @@ -1,2 +1,11 @@ services: + Chill\EventBundle\Controller\: + autowire: true + resource: '../Controller' + tags: ['controller.service_arguments'] + Chill\EventBundle\Menu\: + autowire: true + autoconfigure: true + resource: '../Menu/' + tags: ['chill.menu_builder'] \ No newline at end of file From 9978e76a8799706c3e798ff3de3e3c2d4f8e1b9a Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 7 Jul 2022 15:25:17 +0200 Subject: [PATCH 04/35] fix activity rights (WIP) --- src/Bundle/ChillActivityBundle/Form/ActivityType.php | 5 ++--- .../Resources/views/Activity/edit.html.twig | 8 ++++++++ .../Resources/views/Activity/listPerson.html.twig | 2 +- .../Resources/views/Activity/new.html.twig | 8 ++++++++ .../Security/Authorization/ActivityVoter.php | 5 +++-- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 898f39e56..b2d88f0db 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -20,6 +20,7 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\Type\ChillCollectionType; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\CommentType; +use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Form\Type\PrivateCommentType; use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Form\Type\UserPickerType; @@ -219,11 +220,9 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('user') && $options['center']) { - $builder->add('user', UserPickerType::class, [ + $builder->add('user', PickUserDynamicType::class, [ 'label' => $activityType->getLabel('user'), 'required' => $activityType->isRequired('user'), - 'center' => $options['center'], - 'role' => $options['role'], ]); } diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig index 8d9ee878c..a000b0c7e 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig @@ -120,3 +120,11 @@ {{ form_end(edit_form) }} {# {{ form(delete_form) }} #} + +{% block js %} + {{ encore_entry_script_tags('mod_pickentity_type') }} +{% endblock %} + +{% block css %} + {{ encore_entry_link_tags('mod_pickentity_type') }} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig index f55c68fcc..0514284a2 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig @@ -46,7 +46,7 @@ {% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'person'} %} - {% if is_granted('CHILL_ACTIVITY_CREATE_PERSON', person) %} + {% if is_granted('CHILL_ACTIVITY_CREATE', person) %} {{ form_end(form) }} + +{% block js %} + {{ encore_entry_script_tags('mod_pickentity_type') }} +{% endblock %} + +{% block css %} + {{ encore_entry_link_tags('mod_pickentity_type') }} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php index 9911bf9fd..42a73762c 100644 --- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php +++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php @@ -133,7 +133,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn // change attribute CREATE if (self::CREATE === $attribute) { - $attribute = self::CREATE_PERSON; + return $this->voterHelper->voteOnAttribute(self::CREATE_PERSON, null, $token); } } elseif ($subject->getAccompanyingPeriod() instanceof AccompanyingPeriod) { if (!$this->security->isGranted(AccompanyingPeriodVoter::SEE, $subject->getAccompanyingPeriod())) { @@ -144,7 +144,8 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn if (AccompanyingPeriod::STEP_CLOSED === $subject->getAccompanyingPeriod()->getStep()) { return false; } - $attribute = self::CREATE_ACCOMPANYING_COURSE; + + return $this->voterHelper->voteOnAttribute(self::CREATE_ACCOMPANYING_COURSE, $subject->getAccompanyingPeriod(), $token); } } else { throw new RuntimeException('Could not determine context of activity.'); From 1d8f25e2c86ccfc88349c11b2ede9f3c21fb5da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 8 Jul 2022 15:04:06 +0200 Subject: [PATCH 05/35] use the date parameter in deprecated method getLastAddress --- src/Bundle/ChillPersonBundle/Entity/Person.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 7da08d740..d0be5752a 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -1184,7 +1184,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI } /** - * @deprecated Use `getCurrentPersonAddress` instead + * @deprecated Use @link{Person::getCurrentPersonAddress} or @link{Person::getCurrentHouseholdAddress} instead * * @throws Exception * @@ -1192,7 +1192,9 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI */ public function getLastAddress(?DateTime $from = null) { - return $this->getCurrentPersonAddress(); + return $this->getCurrentHouseholdAddress( + null !== $from ? DateTimeImmutable::createFromMutable($from) : null + ); } public function getLastName(): string From 94c258e914012521abeff9f5121ce2c8735e7657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 10 Jul 2022 22:00:04 +0200 Subject: [PATCH 06/35] fixed: narrow search on postal code with an 'AND' clause instead of 'OR' clause --- .../Repository/PostalCodeRepository.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php index 02e63771b..1c4a69366 100644 --- a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php @@ -119,8 +119,8 @@ final class PostalCodeRepository implements ObjectRepository $pertinenceClause = ['STRICT_WORD_SIMILARITY(canonical, UNACCENT(?))']; $pertinenceArgs = [$pattern]; - $orWhere = ['canonical %>> UNACCENT(?)']; - $orWhereArgs = [$pattern]; + $andWhere = ['canonical %>> UNACCENT(?)']; + $andWhereArgs = [$pattern]; foreach (explode(' ', $pattern) as $part) { $part = trim($part); @@ -129,8 +129,8 @@ final class PostalCodeRepository implements ObjectRepository continue; } - $orWhere[] = "canonical LIKE '%' || UNACCENT(LOWER(?)) || '%'"; - $orWhereArgs[] = $part; + $andWhere[] = "canonical LIKE '%' || UNACCENT(LOWER(?)) || '%'"; + $andWhereArgs[] = $part; $pertinenceClause[] = "(EXISTS (SELECT 1 FROM unnest(string_to_array(canonical, ' ')) AS t WHERE starts_with(t, UNACCENT(LOWER(?)))))::int"; $pertinenceClause[] = @@ -139,7 +139,7 @@ final class PostalCodeRepository implements ObjectRepository } $query ->setSelectPertinence(implode(' + ', $pertinenceClause), $pertinenceArgs) - ->andWhereClause(implode(' OR ', $orWhere), $orWhereArgs); + ->andWhereClause(implode(' AND ', $andWhere), $andWhereArgs); return $query; } From 3bb8b713d14b48aa0761ebc336456485b8448d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 03:32:15 +0200 Subject: [PATCH 07/35] fixed: migration of databse with address on same day fails --- .../ChillMainBundle/migrations/Version20210505153727.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210505153727.php b/src/Bundle/ChillMainBundle/migrations/Version20210505153727.php index 34c3c10b9..eca166ae9 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210505153727.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210505153727.php @@ -47,12 +47,12 @@ final class Version20210505153727 extends AbstractMigration '); $this->addSql(' WITH hydrated_addresses AS ( - SELECT *, rank() OVER (PARTITION BY pa_a.person_id ORDER BY validfrom) + SELECT *, rank() OVER (PARTITION BY pa_a.person_id ORDER BY validfrom, id) FROM chill_main_address AS aa JOIN chill_person_persons_to_addresses AS pa_a ON aa.id = pa_a.address_id ) UPDATE chill_main_address AS b SET validto = ( - SELECT validfrom - INTERVAL \'1 DAY\' + SELECT validfrom FROM hydrated_addresses WHERE hydrated_addresses.id = ( SELECT a1.id From ab08dab88ab2bb66f777ebfeb73f89758c3f7ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 12:55:02 +0200 Subject: [PATCH 08/35] fixed: voter and permissions in accompanying course document --- .../Entity/AccompanyingCourseDocument.php | 12 +++++++- .../ChillDocStoreBundle/Entity/Document.php | 28 +------------------ .../Entity/PersonDocument.php | 20 +++++++++++++ .../Form/AccompanyingCourseDocumentType.php | 5 ---- .../AccompanyingCourseDocumentVoter.php | 4 +++ 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php b/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php index b013f1a44..4f90b06fc 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\DocStoreBundle\Entity; +use Chill\MainBundle\Entity\HasScopesInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Doctrine\ORM\Mapping as ORM; @@ -18,7 +19,7 @@ use Doctrine\ORM\Mapping as ORM; * @ORM\Entity * @ORM\Table("chill_doc.accompanyingcourse_document") */ -class AccompanyingCourseDocument extends Document +class AccompanyingCourseDocument extends Document implements HasScopesInterface { /** * @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class) @@ -31,6 +32,15 @@ class AccompanyingCourseDocument extends Document return $this->course; } + public function getScopes(): iterable + { + if (null !== $this->course) { + return []; + } + + return $this->course->getScopes(); + } + public function setCourse(?AccompanyingPeriod $course): self { $this->course = $course; diff --git a/src/Bundle/ChillDocStoreBundle/Entity/Document.php b/src/Bundle/ChillDocStoreBundle/Entity/Document.php index e26469573..0fd329ff8 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/Document.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/Document.php @@ -16,8 +16,6 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; use Chill\MainBundle\Doctrine\Model\TrackCreationTrait; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait; -use Chill\MainBundle\Entity\HasScopeInterface; -use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; use DateTimeInterface; use Doctrine\ORM\Mapping as ORM; @@ -26,7 +24,7 @@ use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\MappedSuperclass */ -class Document implements HasScopeInterface, TrackCreationInterface, TrackUpdateInterface +class Document implements TrackCreationInterface, TrackUpdateInterface { use TrackCreationTrait; @@ -70,13 +68,6 @@ class Document implements HasScopeInterface, TrackCreationInterface, TrackUpdate */ private $object; - /** - * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope") - * - * @var \Chill\MainBundle\Entity\Scope The document's center - */ - private $scope; - /** * @ORM\ManyToOne(targetEntity="Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate") */ @@ -122,16 +113,6 @@ class Document implements HasScopeInterface, TrackCreationInterface, TrackUpdate return $this->object; } - /** - * Get scope. - * - * @return \Chill\MainBundle\Entity\Scope - */ - public function getScope(): ?Scope - { - return $this->scope; - } - public function getTemplate(): ?DocGeneratorTemplate { return $this->template; @@ -175,13 +156,6 @@ class Document implements HasScopeInterface, TrackCreationInterface, TrackUpdate return $this; } - public function setScope($scope): self - { - $this->scope = $scope; - - return $this; - } - public function setTemplate(?DocGeneratorTemplate $template): self { $this->template = $template; diff --git a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php index fe888f587..b6cf5376f 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php @@ -13,6 +13,7 @@ namespace Chill\DocStoreBundle\Entity; use Chill\MainBundle\Entity\HasCenterInterface; use Chill\MainBundle\Entity\HasScopeInterface; +use Chill\MainBundle\Entity\Scope; use Chill\PersonBundle\Entity\Person; use Doctrine\ORM\Mapping as ORM; @@ -27,6 +28,13 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt */ private Person $person; + /** + * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope") + * + * @var \Chill\MainBundle\Entity\Scope The document's center + */ + private $scope; + public function getCenter() { return $this->getPerson()->getCenter(); @@ -37,10 +45,22 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt return $this->person; } + public function getScope(): ?Scope + { + return $this->scope; + } + public function setPerson($person): self { $this->person = $person; return $this; } + + public function setScope($scope): self + { + $this->scope = $scope; + + return $this; + } } diff --git a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php index 64a81e9c7..c9f9365a4 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php @@ -88,10 +88,5 @@ class AccompanyingCourseDocumentType extends AbstractType $resolver->setDefaults([ 'data_class' => Document::class, ]); - - // $resolver->setRequired(['role', 'center']) - // ->setAllowedTypes('role', [ \Symfony\Component\Security\Core\Role\Role::class ]) - // ->setAllowedTypes('center', [ \Chill\MainBundle\Entity\Center::class ]) - // ; } } diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php index 35fde9b28..e37a8deab 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php @@ -106,6 +106,10 @@ class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements Prov ) { return false; } + + if (self::CREATE === $attribute && null !== $subject->getCourse()) { + return $this->voterHelper->voteOnAttribute($attribute, $subject->getCourse(), $token); + } } return $this->voterHelper->voteOnAttribute($attribute, $subject, $token); From 5962d3f2337d51df452416ad309f5c85e088c3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 12:56:34 +0200 Subject: [PATCH 09/35] fixed: query for index in PersonDocumentACLAwareRepository --- .../Repository/PersonDocumentACLAwareRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php index 540390aef..2fee85a8f 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php @@ -65,7 +65,7 @@ class PersonDocumentACLAwareRepository implements PersonDocumentACLAwareReposito $this->addACL($qb, $person); foreach ($orderBy as $field => $order) { - $qb->addOrderBy($field, $order); + $qb->addOrderBy('d.' . $field, $order); } $qb->setFirstResult($offset)->setMaxResults($limit); From f3ca01fd88412357696ea925607d1f7785e2e0af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 13:34:10 +0200 Subject: [PATCH 10/35] cs: fix --- src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php | 4 ++-- .../ChillMainBundle/Form/Type/Export/PickCenterType.php | 2 -- src/Bundle/ChillPersonBundle/Entity/Person.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php index cede2a5b8..63307a99d 100644 --- a/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php @@ -35,10 +35,10 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface $menu->addChild('Events', [ 'route' => 'chill_event_admin_index', - ]) + ]) ->setAttribute('class', 'list-group-item-header') ->setExtras([ - 'order' => 6500 + 'order' => 6500, ]); $menu->addChild('Event type', [ diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index 9c36d452f..c73402dd3 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -75,8 +75,6 @@ class PickCenterType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { - - $export = $this->exportManager->getExport($options['export_alias']); $centers = $this->authorizationHelper->getReachableCenters( $this->user, diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index d0be5752a..3a197e414 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -1184,7 +1184,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI } /** - * @deprecated Use @link{Person::getCurrentPersonAddress} or @link{Person::getCurrentHouseholdAddress} instead + * @deprecated Use @see{Person::getCurrentPersonAddress} or @see{Person::getCurrentHouseholdAddress} instead * * @throws Exception * From 87a9d48bdf4bb4df7cd3e90fa927cc9d9affa521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 13:39:07 +0200 Subject: [PATCH 11/35] feature: allow to not check mainPerson, person1 or person2 when generating a document --- .../Service/DocGenerator/ActivityContext.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php index 55d64ef93..61bcaad3e 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php @@ -130,8 +130,10 @@ class ActivityContext implements return $this->personRender->renderString($p, []); }, 'multiple' => false, + 'required' => false, 'expanded' => true, 'label' => $options[$key . 'Label'], + 'placeholder' => $this->translator->trans('Any person selected'), ]); } } From 16fed67dd0217a96ac363a4812724a8642644f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 13:45:52 +0200 Subject: [PATCH 12/35] fixed: do not allow to edit a course through the "warning" button on the course's index page --- .../Controller/AccompanyingCourseController.php | 2 +- .../views/AccompanyingCourse/_join_household.html.twig | 4 +++- .../views/AccompanyingCourse/_warning_address.html.twig | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index 4d78bb42b..60d38528b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -177,7 +177,7 @@ class AccompanyingCourseController extends Controller */ public function editAction(AccompanyingPeriod $accompanyingCourse): Response { - $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $accompanyingCourse); + $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $accompanyingCourse); return $this->render('@ChillPerson/AccompanyingCourse/edit.html.twig', [ 'accompanyingCourse' => $accompanyingCourse, diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_join_household.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_join_household.html.twig index 888ab8d43..2bdeb4cf4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_join_household.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_join_household.html.twig @@ -1,7 +1,7 @@
- + {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE', accompanyingCourse) %}
  • @@ -13,6 +13,8 @@
+ {% endif %} +

{{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }}

diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_warning_address.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_warning_address.html.twig index 1f9c09845..5ba0fe799 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_warning_address.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_warning_address.html.twig @@ -3,6 +3,7 @@
+ {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE', accompanyingCourse) %}
  • @@ -14,6 +15,7 @@
+ {% endif %}

{{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }}

{% if not hasPersonLocation %} From 4ef48216ed48f7a0bfb6d3db0d28849d2fe19206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 13:54:12 +0200 Subject: [PATCH 13/35] fixed: do not allow to create a course or see a houshold from the search result, if the user does not have any rights to do it --- .../Resources/views/Person/list_with_period.html.twig | 10 ++++++---- .../Security/Authorization/AccompanyingPeriodVoter.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig index c407b6c57..886fa791b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig @@ -1,13 +1,15 @@ {% macro button_person_after(person) %} {% set household = person.getCurrentHousehold %} - {% if household is not null %} + {% if household is not null and is_granted('CHILL_PERSON_HOUSEHOLD_SEE', household) %}
  • {% endif %} -
  • - -
  • + {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE', person) %} +
  • + +
  • + {% endif %} {% endmacro %} {% macro accompanying_period(acp, person) %} diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php index 0859ba7bd..c6a06a663 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php @@ -113,7 +113,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH ->generate(self::class) ->addCheckFor(null, [self::CREATE, self::REASSIGN_BULK]) ->addCheckFor(AccompanyingPeriod::class, [self::TOGGLE_CONFIDENTIAL, ...self::ALL]) - ->addCheckFor(Person::class, [self::SEE]) + ->addCheckFor(Person::class, [self::SEE, self::CREATE]) ->build(); } From 09b2c9a14e174e19e1d21b6c60729f027d3a8367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 15:11:35 +0200 Subject: [PATCH 14/35] fixed: do not show same person twice if persons are members simultaneously --- .../Entity/Household/Household.php | 30 +++++++++++- .../views/Person/household_history.html.twig | 10 ++-- .../Tests/Entity/Household/HouseholdTest.php | 47 +++++++++++++++++++ 3 files changed, 81 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index 19bda3785..91d9cea57 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Entity\Household; use ArrayIterator; use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; +use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Validator\Constraints\Household\MaxHolder; use DateTime; use DateTimeImmutable; @@ -354,7 +355,12 @@ class Household return $this->members; } - public function getMembersDuringMembership(HouseholdMember $membership) + /** + * get all the members during a given membership. + * + * @return Collection|HouseholdMember[] + */ + public function getMembersDuringMembership(HouseholdMember $membership): Collection { return $this->getMembersOnRange( $membership->getStartDate(), @@ -441,6 +447,28 @@ class Household return $this->getNonCurrentMembers($now)->matching($criteria); } + /** + * get all the unique persons during a given membership. + * + * same as @see(self::getMembersDuringMembership}, except that the collection is filtered to + * return unique members. + * + * @return Collection|Person[] + */ + public function getPersonsDuringMembership(HouseholdMember $member): Collection + { + // make list unique + $membersByHash = []; + + foreach ($this->getMembersDuringMembership($member) as $m) { + if (null !== $m && null !== $m->getPerson()) { + $membersByHash[spl_object_hash($m->getPerson())] = $m->getPerson(); + } + } + + return new ArrayCollection(array_values($membersByHash)); + } + public function getPreviousAddressOf(Address $address): ?Address { $iterator = new ArrayIterator($this->getAddressesOrdered()); diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/household_history.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/household_history.html.twig index 6f7ce0a06..6cacbdf96 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/household_history.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/household_history.html.twig @@ -65,18 +65,18 @@

    {{ 'household.Members at same time'|trans }}

    - {% set simultaneous = p.household.getMembersDuringMembership(p) %} + {% set simultaneous = p.household.getPersonsDuringMembership(p) %} {% if simultaneous|length == 0 %}

    {{ 'household.Any simultaneous members'|trans }}

    {% else %} - {% for m in simultaneous -%} + {% for person in simultaneous -%} {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { action: 'show', displayBadge: true, - targetEntity: { name: 'person', id: m.person.id }, - buttonText: m.person|chill_entity_render_string, - isDead: m.person.deathdate is not null + targetEntity: { name: 'person', id: person.id }, + buttonText: person|chill_entity_render_string, + isDead: person.deathdate is not null } %} {%- endfor -%} {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Tests/Entity/Household/HouseholdTest.php b/src/Bundle/ChillPersonBundle/Tests/Entity/Household/HouseholdTest.php index 7cf8af3e5..b7b805be8 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Entity/Household/HouseholdTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Entity/Household/HouseholdTest.php @@ -135,4 +135,51 @@ final class HouseholdTest extends TestCase $this->assertEquals(new DateTimeImmutable('2021-12-31'), $second->getStartDate()); $this->assertEquals(new DateTimeImmutable('2021-12-31'), $inside->getEndDate()); } + + public function testHouseholdGetPersonsDuringMembership() + { + $household = new Household(); + $person1 = new Person(); + $person2 = new Person(); + $personOut = new Person(); + + $household->addMember( + $member1 = (new HouseholdMember()) + ->setStartDate(new DateTimeImmutable('2021-01-01')) + ->setEndDate(new DateTimeImmutable('2021-12-01')) + ->setPerson($person1) + ); + + $household->addMember( + $member2a = (new HouseholdMember()) + ->setStartDate(new DateTimeImmutable('2021-01-01')) + ->setEndDate(new DateTimeImmutable('2021-05-01')) + ->setPerson($person2) + ); + + $household->addMember( + $member2b = (new HouseholdMember()) + ->setStartDate(new DateTimeImmutable('2021-11-01')) + ->setEndDate(new DateTimeImmutable('2022-06-01')) + ->setPerson($person2) + ); + + $household->addMember( + $memberOut = (new HouseholdMember()) + ->setStartDate(new DateTimeImmutable('2019-01-01')) + ->setEndDate(new DateTimeImmutable('2019-12-01')) + ->setPerson($personOut) + ); + + $this->assertCount(0, $household->getPersonsDuringMembership($memberOut)); + + $this->assertCount(1, $household->getPersonsDuringMembership($member1)); + $this->assertContains($person2, $household->getPersonsDuringMembership($member1)); + + $this->assertCount(1, $household->getPersonsDuringMembership($member2a)); + $this->assertContains($person1, $household->getPersonsDuringMembership($member2a)); + + $this->assertCount(1, $household->getPersonsDuringMembership($member2b)); + $this->assertContains($person1, $household->getPersonsDuringMembership($member2b)); + } } From a79a2b6ee918036f7f582b5309c1ea79d73bfa4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 15:26:04 +0200 Subject: [PATCH 15/35] fixed: warning message "usagers du parcours" does show only for current members for a course --- .../Controller/AccompanyingCourseController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index 60d38528b..bf7f24f4b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -215,7 +215,7 @@ class AccompanyingCourseController extends Controller // get persons without household $withoutHousehold = []; - foreach ($accompanyingCourse->getParticipations() as $p) { + foreach ($accompanyingCourse->getCurrentParticipations() as $p) { if (false === $p->getPerson()->isSharingHousehold()) { $withoutHousehold[] = $p->getPerson(); } From 6bcc28b4bb438d73d2ce61f78c9f7a7fec355304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 15:57:38 +0200 Subject: [PATCH 16/35] feature: hide course when the period is not active for the user, in search results and list of periods for a person --- .../views/AccompanyingPeriod/_list.html.twig | 50 +++++++++++++++++-- .../views/Person/list_with_period.html.twig | 3 +- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list.html.twig index 307c462e2..986392056 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list.html.twig @@ -48,13 +48,57 @@ {% endmacro %} {% block content %} -
    - {% for period in accompanying_periods %} + {%- set acps = [] %} + {%- set acpsClosed = [] %} + {% for acp in accompanying_periods %} + {% if acp.step == 'CLOSED' or (acp.requestorPerson is not same as(person) and acp.openParticipationContainsPerson(person) is null ) %} + {%- set acpsClosed = acpsClosed|merge([acp]) %} + {% else %} + {%- set acps = acps|merge([acp]) %} + {% endif %} + {% endfor %} +
    + {% for period in acps %} {% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with { 'recordAction': _self.recordAction(period, contextEntity) } %} - + {% else %} +

    {{ 'Any accompanying periods are open'|trans }}

    {% endfor %}
    + + {% if acpsClosed|length > 0 %} +
    +
    +

    + +

    + +
    + +
    + {% for period in acpsClosed %} + {% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with { + 'recordAction': _self.recordAction(period, contextEntity) + } %} + {% endfor %} +
    + +
    +
    +
    + {% endif %} {% endblock content %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig index 886fa791b..8cc0128a5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig @@ -235,7 +235,8 @@ {%- set acpsClosed = [] %} {%- for acp in person.accompanyingPeriodInvolved %} {%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', acp) %} - {% if acp.step == 'CLOSED' %} + {# filter for "current" periods: either the person is a requestor, or is member of the period and not closed #} + {% if acp.step == 'CLOSED' or (acp.requestorPerson is not same as(person) and acp.openParticipationContainsPerson(person) is null ) %} {%- set acpsClosed = acpsClosed|merge([acp]) %} {% else %} {%- set acps = acps|merge([acp]) %} From 692c2bdac0c14b746aec1aa4a3f3f57b00ac7d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 16:11:45 +0200 Subject: [PATCH 17/35] fixed: do not show disabled users in list of users from the api --- .../ChillMainBundle/Controller/UserApiController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Controller/UserApiController.php b/src/Bundle/ChillMainBundle/Controller/UserApiController.php index d1fd4d5bb..6acd0c4dd 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserApiController.php @@ -12,7 +12,9 @@ declare(strict_types=1); namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; +use Doctrine\ORM\QueryBuilder; use Symfony\Component\HttpFoundation\JsonResponse; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; class UserApiController extends ApiController @@ -58,4 +60,14 @@ class UserApiController extends ApiController ['groups' => ['read']] ); } + + /** + * @param QueryBuilder $query + */ + protected function customizeQuery(string $action, Request $request, $query): void + { + if ('_index' === $action) { + $query->andWhere($query->expr()->eq('e.enabled', "'TRUE'")); + } + } } From c69af351ccbeabb2b0b7e86ae011baddf1700499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 16:20:48 +0200 Subject: [PATCH 18/35] fixed: do not show disabled jobs in list of jobs from the api --- .../Controller/UserJobApiController.php | 25 +++++++++++++++++++ .../ChillMainExtension.php | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/Controller/UserJobApiController.php diff --git a/src/Bundle/ChillMainBundle/Controller/UserJobApiController.php b/src/Bundle/ChillMainBundle/Controller/UserJobApiController.php new file mode 100644 index 000000000..50b97809a --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/UserJobApiController.php @@ -0,0 +1,25 @@ +andWhere($query->expr()->eq('e.active', "'TRUE'")); + } + } +} diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 929bffe14..df0affa86 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -19,6 +19,7 @@ use Chill\MainBundle\Controller\LanguageController; use Chill\MainBundle\Controller\LocationController; use Chill\MainBundle\Controller\LocationTypeController; use Chill\MainBundle\Controller\UserController; +use Chill\MainBundle\Controller\UserJobApiController; use Chill\MainBundle\Controller\UserJobController; use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface; use Chill\MainBundle\Doctrine\DQL\GetJsonFieldByKey; @@ -501,6 +502,7 @@ class ChillMainExtension extends Extension implements 'name' => 'user_job', 'base_path' => '/api/1.0/main/user-job', 'base_role' => 'ROLE_USER', + 'controller' => UserJobApiController::class, 'actions' => [ '_index' => [ 'methods' => [ From 3748eb99c6c73edab56aafdcb477453ad500d0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 17:10:40 +0200 Subject: [PATCH 19/35] Fixed: add an exclude constraint to ensure on db side that there is only one step waiting for a transition --- .../migrations/Version20220711150006.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/migrations/Version20220711150006.php diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220711150006.php b/src/Bundle/ChillMainBundle/migrations/Version20220711150006.php new file mode 100644 index 000000000..0bac5ac96 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20220711150006.php @@ -0,0 +1,39 @@ +addSql('ALTER TABLE chill_main_workflow_entity_step + DROP CONSTRAINT chill_custom_only_one_step_opened'); + } + + public function getDescription(): string + { + return 'Add a constraint to ensure that only one step is available at a time'; + } + + public function up(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_main_workflow_entity_step + ADD CONSTRAINT chill_custom_only_one_step_opened + EXCLUDE ( + entityworkflow_id WITH = + ) WHERE (transitionafter IS NULL) + DEFERRABLE INITIALLY DEFERRED'); + } +} From 93560a62efc6e63ea56b57ce59078faff7ce0d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 17:36:59 +0200 Subject: [PATCH 20/35] Feature: an activity has the same scope as an accompanying period, if it exists --- .../ChillActivityBundle/Entity/Activity.php | 17 +++++++++++++++-- .../Security/Authorization/ActivityVoter.php | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 5fa0bca35..c947e7474 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -17,7 +17,7 @@ use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable; use Chill\MainBundle\Entity\HasCenterInterface; -use Chill\MainBundle\Entity\HasScopeInterface; +use Chill\MainBundle\Entity\HasScopesInterface; use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; @@ -55,7 +55,7 @@ use Symfony\Component\Validator\Constraints as Assert; * getUserFunction="getUser", * path="scope") */ -class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCenterInterface, HasScopeInterface +class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCenterInterface, HasScopesInterface { public const SENTRECEIVED_RECEIVED = 'received'; @@ -422,6 +422,19 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this->scope; } + public function getScopes(): array + { + if (null !== $this->getAccompanyingPeriod()) { + return $this->getAccompanyingPeriod()->getScopes(); + } + + if (null !== $this->getPerson()) { + return [$this->scope]; + } + + return []; + } + public function getSentReceived(): string { return $this->sentReceived; diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php index 42a73762c..570c41d14 100644 --- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php +++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php @@ -133,7 +133,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn // change attribute CREATE if (self::CREATE === $attribute) { - return $this->voterHelper->voteOnAttribute(self::CREATE_PERSON, null, $token); + return $this->voterHelper->voteOnAttribute(self::CREATE_PERSON, $subject->getPerson(), $token); } } elseif ($subject->getAccompanyingPeriod() instanceof AccompanyingPeriod) { if (!$this->security->isGranted(AccompanyingPeriodVoter::SEE, $subject->getAccompanyingPeriod())) { From ce17c15d41200c25f69839451b66a6c599225f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 18:24:48 +0200 Subject: [PATCH 21/35] fixed: ACL in activity creations and edition --- .../Controller/ActivityController.php | 2 +- src/Bundle/ChillActivityBundle/Entity/Activity.php | 13 ++++++++----- .../ChillActivityBundle/Form/ActivityType.php | 14 ++++++++------ .../migrations/Version20160318111334.php | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index a89b1d67c..5f7075aaf 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -198,7 +198,7 @@ final class ActivityController extends AbstractController // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); $form = $this->createForm(ActivityType::class, $entity, [ - 'center' => $entity->getCenter(), + 'center' => $entity->getCenters()[0] ?? null, 'role' => new Role('CHILL_ACTIVITY_UPDATE'), 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index c947e7474..75729ca95 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable; use Chill\MainBundle\Entity\HasCenterInterface; +use Chill\MainBundle\Entity\HasCentersInterface; use Chill\MainBundle\Entity\HasScopesInterface; use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Scope; @@ -55,7 +56,7 @@ use Symfony\Component\Validator\Constraints as Assert; * getUserFunction="getUser", * path="scope") */ -class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCenterInterface, HasScopesInterface +class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface { public const SENTRECEIVED_RECEIVED = 'received'; @@ -306,13 +307,15 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac * get the center * center is extracted from person. */ - public function getCenter(): ?Center + public function getCenters(): array { if ($this->person instanceof Person) { - return $this->person->getCenter(); + return [$this->person->getCenter()]; + } elseif ($this->getAccompanyingPeriod() instanceof AccompanyingPeriod) { + return $this->getAccompanyingPeriod()->getCenters(); } - return null; + return []; } public function getComment(): CommentEmbeddable @@ -422,7 +425,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this->scope; } - public function getScopes(): array + public function getScopes(): iterable { if (null !== $this->getAccompanyingPeriod()) { return $this->getAccompanyingPeriod()->getScopes(); diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index b2d88f0db..88356a5c6 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -14,7 +14,9 @@ namespace Chill\ActivityBundle\Form; use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\ActivityPresence; use Chill\ActivityBundle\Entity\ActivityReason; +use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\DocStoreBundle\Form\StoredObjectType; +use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\Type\ChillCollectionType; @@ -51,6 +53,7 @@ use Symfony\Component\Form\FormEvents; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; +use Symfony\Component\Security\Core\Role\Role; use function in_array; class ActivityType extends AbstractType @@ -110,12 +113,11 @@ class ActivityType extends AbstractType $activityType = $options['activityType']; // TODO revoir la gestion des center au niveau du form des activité. - if ($options['center']) { + if ($options['center'] && null !== $options['data']->getPerson()) { $builder->add('scope', ScopePickerType::class, [ 'center' => $options['center'], - 'role' => $options['role'], - // TODO make required again once scope and rights are fixed - 'required' => false, + 'role' => ActivityVoter::CREATE === (string) $options['role'] ? ActivityVoter::CREATE_PERSON : (string) $options['role'], + 'required' => true, ]); } @@ -441,8 +443,8 @@ class ActivityType extends AbstractType $resolver ->setRequired(['center', 'role', 'activityType', 'accompanyingPeriod']) - ->setAllowedTypes('center', ['null', 'Chill\MainBundle\Entity\Center']) - ->setAllowedTypes('role', 'Symfony\Component\Security\Core\Role\Role') + ->setAllowedTypes('center', ['null', Center::class]) + ->setAllowedTypes('role', [Role::class, 'string']) ->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class) ->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null']); } diff --git a/src/Bundle/ChillEventBundle/migrations/Version20160318111334.php b/src/Bundle/ChillEventBundle/migrations/Version20160318111334.php index 241003abf..e879f1d29 100644 --- a/src/Bundle/ChillEventBundle/migrations/Version20160318111334.php +++ b/src/Bundle/ChillEventBundle/migrations/Version20160318111334.php @@ -126,7 +126,7 @@ class Version20160318111334 extends AbstractMigration $this->addSql('ALTER TABLE chill_event_participation ' . 'ADD CONSTRAINT FK_4E7768AC217BBB47 ' . 'FOREIGN KEY (person_id) ' - . 'REFERENCES Person (id) ' + . 'REFERENCES chill_person_person(id) ' . 'NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_event_participation ' . 'ADD CONSTRAINT FK_4E7768ACD60322AC ' From 6998043159110c64acac5c89b12ea9d7235e9c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 19:29:45 +0200 Subject: [PATCH 22/35] Fixed: do not allow to create activities when no rights to do it The ACTIVITY_FULL role does not give anymore the roles CHILL_ACTIVITY_CREATE_PERSON and CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE. Tags: #BC --- grumphp.yml | 1 + phpstan-deprecations.neon | 998 ++++++++---------- phpstan-types.neon | 10 - .../ChillActivityExtension.php | 2 - .../ChillActivityBundle/Entity/Activity.php | 5 +- .../ChillActivityBundle/Form/ActivityType.php | 8 +- .../Security/Authorization/ActivityVoter.php | 4 +- 7 files changed, 458 insertions(+), 570 deletions(-) diff --git a/grumphp.yml b/grumphp.yml index 8efce6109..c81830d5b 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -24,6 +24,7 @@ parameters: - "/spec/" - "/var/" - "/vendor/" + - "/tests/app" # Psalm tasks.psalm.blocking: true diff --git a/phpstan-deprecations.neon b/phpstan-deprecations.neon index 42981a551..1f6ca4401 100644 --- a/phpstan-deprecations.neon +++ b/phpstan-deprecations.neon @@ -1,11 +1,10 @@ parameters: ignoreErrors: - - 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\\.$# - """ + 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: 2 path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -25,209 +24,194 @@ parameters: path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityReasonAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityReasonAggregator\\:\\:addRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityTypeAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityTypeAggregator\\:\\:addRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityUserAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityUserAggregator\\:\\:addRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Export/Export/CountActivity.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\CountActivity\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\CountActivity\\:\\:requiredRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Export/CountActivity.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\ListActivity\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\ListActivity\\:\\:requiredRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Export/ListActivity.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:requiredRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Export/StatActivityDuration.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityDateFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityDateFilter\\:\\:addRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Filter/ActivityDateFilter.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityReasonFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityReasonFilter\\:\\:addRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Filter/ActivityReasonFilter.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityTypeFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityTypeFilter\\:\\:addRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php - - message: - """ - #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\PersonHavingActivityBetweenDateFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\PersonHavingActivityBetweenDateFilter\\:\\:addRole\\(\\) has typehint with 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/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php - - message: - """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ + 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/ChillActivityBundle/Form/ActivityType.php + + - + message: """ + #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: + Use getReachableCircles$# + """ count: 1 path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\ActivityBundle\\\\Repository\\\\ActivityACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\ActivityBundle\\\\Repository\\\\ActivityACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.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\\.$# - """ + 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: 1 path: src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php - - message: - """ - #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\: - since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# - """ + message: """ + #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\: + since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# + """ count: 1 path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php @@ -237,47 +221,42 @@ parameters: path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php - - message: - """ - #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldDate\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\: - since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# - """ + message: """ + #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldDate\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\: + since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# + """ count: 1 path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php - - message: - """ - #^Parameter \\$twigEngine of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldLongChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\: - since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# - """ + message: """ + #^Parameter \\$twigEngine of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldLongChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\: + since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# + """ count: 1 path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php - - message: - """ - #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldNumber\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\: - since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# - """ + message: """ + #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldNumber\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\: + since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# + """ count: 1 path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php - - message: - """ - #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldText\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\: - since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# - """ + message: """ + #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldText\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\: + since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# + """ count: 1 path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php - - message: - """ - #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldTitle\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\: - since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# - """ + message: """ + #^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldTitle\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\: + since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$# + """ count: 1 path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php @@ -292,182 +271,162 @@ parameters: path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.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\\.$# - """ + 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: 6 path: src/Bundle/ChillEventBundle/Controller/EventController.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\\.$# - """ + 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/ChillEventBundle/Form/EventType.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\\.$# - """ + 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/ChillEventBundle/Form/Type/PickEventType.php - - message: - """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ + message: """ + #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: + Use getReachableCircles$# + """ count: 1 path: src/Bundle/ChillEventBundle/Search/EventSearch.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\\.$# - """ + 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: 1 path: src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php - - message: - """ - #^Parameter \\$role of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:getReachableCenters\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Parameter \\$role of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:getReachableCenters\\(\\) has typehint with 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/ChillMainBundle/CRUD/Controller/CRUDController.php - - message: - """ - #^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$# - """ + message: """ + #^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\: + since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$# + """ count: 1 path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php - - message: - """ - #^Call to deprecated method getRegionBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Countries\\} instead\\.$# - """ + message: """ + #^Call to deprecated method getRegionBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\: + since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Countries\\} instead\\.$# + """ count: 1 path: src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.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\\.$# - """ + 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: 1 path: src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php - - message: - """ - #^Parameter \\$role of anonymous function has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Parameter \\$role of anonymous function has typehint with 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/ChillMainBundle/Controller/PermissionsGroupController.php - - message: - """ - #^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$# - """ + message: """ + #^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\: + since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$# + """ count: 2 path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php - - message: - """ - #^Class Chill\\\\MainBundle\\\\Entity\\\\User implements deprecated interface Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\AdvancedUserInterface\\: - since Symfony 4\\.1$# - """ + message: """ + #^Class Chill\\\\MainBundle\\\\Entity\\\\User implements deprecated interface Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\AdvancedUserInterface\\: + since Symfony 4\\.1$# + """ count: 1 path: src/Bundle/ChillMainBundle/Entity/User.php - - message: - """ - #^Return type of method Chill\\\\MainBundle\\\\Entity\\\\User\\:\\:getRoles\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\MainBundle\\\\Entity\\\\User\\:\\:getRoles\\(\\) has typehint with 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/ChillMainBundle/Entity/User.php - - message: - """ - #^Return type of method Chill\\\\MainBundle\\\\Export\\\\DirectExportInterface\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\MainBundle\\\\Export\\\\DirectExportInterface\\:\\:requiredRole\\(\\) has typehint with 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/ChillMainBundle/Export/DirectExportInterface.php - - message: - """ - #^Return type of method Chill\\\\MainBundle\\\\Export\\\\ExportInterface\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\MainBundle\\\\Export\\\\ExportInterface\\:\\:requiredRole\\(\\) has typehint with 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/ChillMainBundle/Export/ExportInterface.php - - message: - """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ + message: """ + #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: + Use getReachableCircles$# + """ count: 1 path: src/Bundle/ChillMainBundle/Export/ExportManager.php - - message: - """ - #^Return type of method Chill\\\\MainBundle\\\\Export\\\\ModifierInterface\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\MainBundle\\\\Export\\\\ModifierInterface\\:\\:addRole\\(\\) has typehint with 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/ChillMainBundle/Export/ModifierInterface.php - - message: - """ - #^Class Chill\\\\MainBundle\\\\Form\\\\Event\\\\CustomizeFormEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\MainBundle\\\\Form\\\\Event\\\\CustomizeFormEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.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\\.$# - """ + 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/ChillMainBundle/Form/Type/ScopePickerType.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\\.$# - """ + 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/ChillMainBundle/Form/Type/UserPickerType.php @@ -477,74 +436,66 @@ parameters: path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php - - message: - """ - #^Parameter \\$attribute of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:userHasAccess\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Parameter \\$attribute of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:userHasAccess\\(\\) has typehint with 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/ChillMainBundle/Security/Authorization/AuthorizationHelper.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php - - message: - """ - #^Parameter \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCircles\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Parameter \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCircles\\(\\) has typehint with 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/ChillMainBundle/Security/Authorization/AuthorizationHelper.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelperFactory\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelperFactory\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelperGenerator\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelperGenerator\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php - - message: - """ - #^Class Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\PasswordRecoverEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\PasswordRecoverEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php - - message: - """ - #^Class Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcher implements deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Class Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcher implements deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php @@ -554,65 +505,58 @@ parameters: path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php - - message: - """ - #^Class Chill\\\\MainBundle\\\\Templating\\\\Events\\\\DelegatedBlockRenderingEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\MainBundle\\\\Templating\\\\Events\\\\DelegatedBlockRenderingEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php - - message: - """ - #^Class Chill\\\\PersonBundle\\\\Actions\\\\ActionEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\PersonBundle\\\\Actions\\\\ActionEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Actions/ActionEvent.php - - message: - """ - #^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\: - since 1\\.1 use `getOpenedAccompanyingPeriod instead$# - """ + message: """ + #^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\: + since 1\\.1 use `getOpenedAccompanyingPeriod instead$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php - - message: - """ - #^Instantiation of deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Instantiation of deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php - - message: - """ - #^Class Chill\\\\PersonBundle\\\\Controller\\\\AccompanyingCourseController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\: - since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$# - """ + message: """ + #^Class Chill\\\\PersonBundle\\\\Controller\\\\AccompanyingCourseController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\: + since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php - - message: - """ - #^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\: - since 1\\.1 use `getOpenedAccompanyingPeriod instead$# - """ + message: """ + #^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\: + since 1\\.1 use `getOpenedAccompanyingPeriod instead$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php - - message: - """ - #^Class Chill\\\\PersonBundle\\\\Controller\\\\PersonDuplicateController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\: - since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$# - """ + message: """ + #^Class Chill\\\\PersonBundle\\\\Controller\\\\PersonDuplicateController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\: + since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php @@ -622,164 +566,146 @@ parameters: path: src/Bundle/ChillPersonBundle/Entity/Person.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\AgeAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\AgeAggregator\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Aggregator/AgeAggregator.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\CountryOfBirthAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\CountryOfBirthAggregator\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Aggregator/CountryOfBirthAggregator.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\GenderAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\GenderAggregator\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Aggregator/GenderAggregator.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\NationalityAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\NationalityAggregator\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Aggregator/NationalityAggregator.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\\.$# - """ + 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: 1 path: src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\CountPerson\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\CountPerson\\:\\:requiredRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Export/CountPerson.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\\.$# - """ + 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: 1 path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\ListPerson\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\ListPerson\\:\\:requiredRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Export/ListPerson.php - - message: - """ - #^Call to deprecated method execute\\(\\) of class Doctrine\\\\DBAL\\\\Statement\\: - Statement\\:\\:execute\\(\\) is deprecated, use Statement\\:\\:executeQuery\\(\\) or executeStatement\\(\\) instead$# - """ + message: """ + #^Call to deprecated method execute\\(\\) of class Doctrine\\\\DBAL\\\\Statement\\: + Statement\\:\\:execute\\(\\) is deprecated, use Statement\\:\\:executeQuery\\(\\) or executeStatement\\(\\) instead$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.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\\.$# - """ + 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: 1 path: src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\ListPersonDuplicate\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\ListPersonDuplicate\\:\\:requiredRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Export/ListPersonDuplicate.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodClosingFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodClosingFilter\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Filter/AccompanyingPeriodClosingFilter.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodFilter\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Filter/AccompanyingPeriodFilter.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodOpeningFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodOpeningFilter\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Filter/AccompanyingPeriodOpeningFilter.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\BirthdateFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\BirthdateFilter\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Filter/BirthdateFilter.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\GenderFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\GenderFilter\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Filter/GenderFilter.php - - message: - """ - #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\NationalityFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\NationalityFilter\\:\\:addRole\\(\\) has typehint with 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/ChillPersonBundle/Export/Filter/NationalityFilter.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\\.$# - """ + 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: 1 path: src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php @@ -789,254 +715,226 @@ parameters: path: src/Bundle/ChillPersonBundle/Form/PersonType.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\\.$# - """ + 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/ChillPersonBundle/Form/Type/PickPersonType.php - - message: - """ - #^Class Chill\\\\PersonBundle\\\\Privacy\\\\AccompanyingPeriodPrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\PersonBundle\\\\Privacy\\\\AccompanyingPeriodPrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php - - message: - """ - #^Class Chill\\\\PersonBundle\\\\Privacy\\\\PrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\PersonBundle\\\\Privacy\\\\PrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriodACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriodACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.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\\.$# - """ + 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: 1 path: src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php - - message: - """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ + message: """ + #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: + Use getReachableCircles$# + """ count: 1 path: src/Bundle/ChillReportBundle/Controller/ReportController.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\\.$# - """ + 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/ChillReportBundle/Controller/ReportController.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\\.$# - """ + 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: 1 path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php - - message: - """ - #^Return type of method Chill\\\\ReportBundle\\\\Export\\\\Export\\\\ReportList\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ReportBundle\\\\Export\\\\Export\\\\ReportList\\:\\:requiredRole\\(\\) has typehint with 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/ChillReportBundle/Export/Export/ReportList.php - - message: - """ - #^Return type of method Chill\\\\ReportBundle\\\\Export\\\\Filter\\\\ReportDateFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Return type of method Chill\\\\ReportBundle\\\\Export\\\\Filter\\\\ReportDateFilter\\:\\:addRole\\(\\) has typehint with 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/ChillReportBundle/Export/Filter/ReportDateFilter.php - - message: - """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ + message: """ + #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: + Use getReachableCircles$# + """ count: 1 path: src/Bundle/ChillReportBundle/Form/ReportType.php - - message: - """ - #^Parameter \\$role of method Chill\\\\ReportBundle\\\\Form\\\\ReportType\\:\\:appendScopeChoices\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Parameter \\$role of method Chill\\\\ReportBundle\\\\Form\\\\ReportType\\:\\:appendScopeChoices\\(\\) has typehint with 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/ChillReportBundle/Form/ReportType.php - - message: - """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ + message: """ + #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: + Use getReachableCircles$# + """ count: 1 path: src/Bundle/ChillReportBundle/Search/ReportSearch.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\\.$# - """ + 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: 1 path: src/Bundle/ChillReportBundle/Search/ReportSearch.php - - message: - """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ + message: """ + #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: + Use getReachableCircles$# + """ count: 2 path: src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.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\\.$# - """ + 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: 2 path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php - - message: - """ - #^Parameter \\$role of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:setCreateForm\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ + message: """ + #^Parameter \\$role of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:setCreateForm\\(\\) has typehint with 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/ChillTaskBundle/Controller/SingleTaskController.php - - message: - """ - #^Class Chill\\\\TaskBundle\\\\Event\\\\TaskEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\TaskBundle\\\\Event\\\\TaskEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillTaskBundle/Event/TaskEvent.php - - message: - """ - #^Class Chill\\\\TaskBundle\\\\Event\\\\UI\\\\UIEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\TaskBundle\\\\Event\\\\UI\\\\UIEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillTaskBundle/Event/UI/UIEvent.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\\.$# - """ + 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: 4 path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.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\\.$# - """ + 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/ChillTaskBundle/Form/SingleTaskType.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Form\\\\SingleTaskType\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Form\\\\SingleTaskType\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php - - message: - """ - #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Repository\\\\SingleTaskAclAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: - Use CenterResolverManager and its interface CenterResolverManagerInterface$# - """ + message: """ + #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Repository\\\\SingleTaskAclAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: + Use CenterResolverManager and its interface CenterResolverManagerInterface$# + """ count: 1 path: src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.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\\.$# - """ + 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: 1 path: src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php - - message: - """ - #^Class Chill\\\\TaskBundle\\\\Security\\\\Authorization\\\\AuthorizationEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: - since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# - """ + message: """ + #^Class Chill\\\\TaskBundle\\\\Security\\\\Authorization\\\\AuthorizationEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\: + since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$# + """ count: 1 path: src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.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\\.$# - """ + 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/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.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\\.$# - """ + 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: 1 path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php diff --git a/phpstan-types.neon b/phpstan-types.neon index dc3f67a73..c8a0791e0 100644 --- a/phpstan-types.neon +++ b/phpstan-types.neon @@ -25,16 +25,6 @@ parameters: count: 1 path: src/Bundle/ChillActivityBundle/Form/ActivityType.php - - - message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" - count: 3 - path: src/Bundle/ChillActivityBundle/Form/ActivityType.php - - - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" - count: 2 - path: src/Bundle/ChillActivityBundle/Form/ActivityType.php - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" count: 3 diff --git a/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php index 39c7eab36..41aa89dcb 100644 --- a/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php +++ b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php @@ -61,8 +61,6 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf ActivityVoter::DELETE => [ActivityVoter::SEE_DETAILS], ActivityVoter::SEE_DETAILS => [ActivityVoter::SEE], ActivityVoter::FULL => [ - ActivityVoter::CREATE_PERSON, - ActivityVoter::CREATE_ACCOMPANYING_COURSE, ActivityVoter::DELETE, ActivityVoter::UPDATE, ], diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 75729ca95..faa042e03 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -16,7 +16,6 @@ use Chill\DocStoreBundle\Entity\StoredObject; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable; -use Chill\MainBundle\Entity\HasCenterInterface; use Chill\MainBundle\Entity\HasCentersInterface; use Chill\MainBundle\Entity\HasScopesInterface; use Chill\MainBundle\Entity\Location; @@ -311,7 +310,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac { if ($this->person instanceof Person) { return [$this->person->getCenter()]; - } elseif ($this->getAccompanyingPeriod() instanceof AccompanyingPeriod) { + } + + if ($this->getAccompanyingPeriod() instanceof AccompanyingPeriod) { return $this->getAccompanyingPeriod()->getCenters(); } diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 88356a5c6..011243d46 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -25,9 +25,9 @@ use Chill\MainBundle\Form\Type\CommentType; use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Form\Type\PrivateCommentType; use Chill\MainBundle\Form\Type\ScopePickerType; -use Chill\MainBundle\Form\Type\UserPickerType; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Templating\TranslatableStringHelper; +use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Entity\SocialWork\SocialIssue; @@ -113,7 +113,7 @@ class ActivityType extends AbstractType $activityType = $options['activityType']; // TODO revoir la gestion des center au niveau du form des activité. - if ($options['center'] && null !== $options['data']->getPerson()) { + if ($options['center'] instanceof Center && null !== $options['data']->getPerson()) { $builder->add('scope', ScopePickerType::class, [ 'center' => $options['center'], 'role' => ActivityVoter::CREATE === (string) $options['role'] ? ActivityVoter::CREATE_PERSON : (string) $options['role'], @@ -124,7 +124,7 @@ class ActivityType extends AbstractType /** @var ? \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingPeriod */ $accompanyingPeriod = null; - if ($options['accompanyingPeriod']) { + if ($options['accompanyingPeriod'] instanceof AccompanyingPeriod) { $accompanyingPeriod = $options['accompanyingPeriod']; } @@ -221,7 +221,7 @@ class ActivityType extends AbstractType ]); } - if ($activityType->isVisible('user') && $options['center']) { + if ($activityType->isVisible('user') && $options['center'] instanceof Center) { $builder->add('user', PickUserDynamicType::class, [ 'label' => $activityType->getLabel('user'), 'required' => $activityType->isRequired('user'), diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php index 570c41d14..c95471771 100644 --- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php +++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php @@ -159,12 +159,12 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn // transform the attribute if (self::CREATE === $attribute) { - $attribute = self::CREATE_ACCOMPANYING_COURSE; + return $this->voterHelper->voteOnAttribute(self::CREATE_ACCOMPANYING_COURSE, $subject, $token); } } elseif ($subject instanceof Person) { // transform the attribute if (self::CREATE === $attribute) { - $attribute = self::CREATE_PERSON; + return $this->voterHelper->voteOnAttribute(self::CREATE_PERSON, $subject, $token); } } From ba8a80a202db5fe67bcb80819a1d350e4e38b14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 19:32:19 +0200 Subject: [PATCH 23/35] Fixed: test for userjob associated to course in Regulation list --- .../Resources/views/AccompanyingCourse/dispatch_list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/dispatch_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/dispatch_list.html.twig index 9b48883ef..88bdf80c3 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/dispatch_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/dispatch_list.html.twig @@ -14,7 +14,7 @@ {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE', period) %}
    {% set job_id = null %} - {% if period.job is defined %} + {% if period.job is not null %} {% set job_id = period.job.id %} {% endif %} Date: Mon, 11 Jul 2022 19:37:32 +0200 Subject: [PATCH 24/35] Fixed: do not show postal code created by users in the list of postal codes --- .../ChillMainBundle/Controller/PostalCodeAPIController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php index fa1a29296..ffad0caeb 100644 --- a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php @@ -92,5 +92,8 @@ final class PostalCodeAPIController extends ApiController $qb->where('e.country = :country') ->setParameter('country', $request->query->get('country')); } + + $qb->andWhere('e.origin = :zero') + ->setParameter('zero', 0); } } From 5f6c11bde9ac1006c5b187c29f4c33ce0a44021b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 11 Jul 2022 19:56:59 +0200 Subject: [PATCH 25/35] Feature: show comment in #docgen generation for accompanying periods --- .../Entity/AccompanyingPeriod/Comment.php | 8 ++++---- .../Normalizer/AccompanyingPeriodDocGenNormalizer.php | 4 ++++ .../Normalizer/AccompanyingPeriodDocGenNormalizerTest.php | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php index 1fe398290..595ffa35f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php @@ -40,7 +40,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface /** * @ORM\Column(type="text") - * @Groups({"read", "write"}) + * @Groups({"read", "write", "docgen:read"}) * @Assert\NotBlank * @Assert\NotNull */ @@ -48,14 +48,14 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface /** * @ORM\Column(type="datetime") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private $createdAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private $creator; @@ -63,7 +63,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private $id; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php index 86deda604..0a00b4000 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php @@ -71,6 +71,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf 'location' => Address::class, 'locationPerson' => Person::class, 'administrativeLocation' => Location::class, + 'pinnedComment' => AccompanyingPeriod\Comment::class, ]; private ClosingMotiveRender $closingMotiveRender; @@ -164,6 +165,8 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf 'location' => $this->normalizer->normalize($period->getLocation(), $format, $addressContext), 'administrativeLocation' => $this->normalizer->normalize($period->getAdministrativeLocation(), $format, $administrativeLocationContext), 'works' => $this->normalizer->normalize($period->getWorks(), $format, $workContext), + 'comments' => $this->normalizer->normalize($period->getComments(), $format, array_merge($context, ['docgen:expects' => AccompanyingPeriod\Comment::class])), + 'pinnedComment' => $this->normalizer->normalize($period->getPinnedComment(), $format, array_merge($context, ['docgen:expects' => AccompanyingPeriod\Comment::class])), ]; } @@ -183,6 +186,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf 'hasLocationPerson' => false, 'hasAdministrativeLocation' => false, 'works' => [], + 'comments' => [], ] ); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php index c42dc9a5a..7e6330988 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php @@ -68,6 +68,8 @@ final class AccompanyingPeriodDocGenNormalizerTest extends KernelTestCase 'closingMotive' => '@ignored', 'confidential' => true, 'confidentialText' => 'confidentiel', + 'comments' => '@ignored', + 'pinnedComment' => '@ignored', 'createdAt' => '@ignored', 'createdBy' => '@ignored', 'emergency' => true, From 11d1b26efc45cecb458148893a4f4a50333a444c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 12 Jul 2022 10:44:40 +0200 Subject: [PATCH 26/35] fixed: unable to create a course (due to method change in activity entity) --- .../ChillActivityBundle/Controller/ActivityController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 5f7075aaf..abf242af6 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -416,7 +416,7 @@ final class ActivityController extends AbstractController $this->denyAccessUnlessGranted(ActivityVoter::CREATE, $entity); $form = $this->createForm(ActivityType::class, $entity, [ - 'center' => $entity->getCenter(), + 'center' => $entity->getCenters()[0] ?? null, 'role' => new Role('CHILL_ACTIVITY_CREATE'), 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, From 5896a77ae910d32b0a34611405cb714df361205b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 12 Jul 2022 11:10:18 +0200 Subject: [PATCH 27/35] Fixed: use CenterResolver where cases when center is resolved differently --- .../Controller/ActivityController.php | 13 ++++++++++--- src/Bundle/ChillActivityBundle/Entity/Activity.php | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index abf242af6..ee2634884 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -21,6 +21,9 @@ use Chill\ActivityBundle\Repository\ActivityTypeRepository; use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Repository\LocationRepository; +use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; +use Chill\MainBundle\Security\Resolver\CenterResolverInterface; +use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Privacy\PrivacyEvent; @@ -70,6 +73,8 @@ final class ActivityController extends AbstractController private ThirdPartyRepository $thirdPartyRepository; + private CenterResolverManagerInterface $centerResolver; + public function __construct( ActivityACLAwareRepositoryInterface $activityACLAwareRepository, ActivityTypeRepository $activityTypeRepository, @@ -82,7 +87,8 @@ final class ActivityController extends AbstractController EntityManagerInterface $entityManager, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger, - SerializerInterface $serializer + SerializerInterface $serializer, + CenterResolverManagerInterface $centerResolver ) { $this->activityACLAwareRepository = $activityACLAwareRepository; $this->activityTypeRepository = $activityTypeRepository; @@ -96,6 +102,7 @@ final class ActivityController extends AbstractController $this->eventDispatcher = $eventDispatcher; $this->logger = $logger; $this->serializer = $serializer; + $this->centerResolver = $centerResolver; } /** @@ -198,7 +205,7 @@ final class ActivityController extends AbstractController // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); $form = $this->createForm(ActivityType::class, $entity, [ - 'center' => $entity->getCenters()[0] ?? null, + 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, 'role' => new Role('CHILL_ACTIVITY_UPDATE'), 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, @@ -416,7 +423,7 @@ final class ActivityController extends AbstractController $this->denyAccessUnlessGranted(ActivityVoter::CREATE, $entity); $form = $this->createForm(ActivityType::class, $entity, [ - 'center' => $entity->getCenters()[0] ?? null, + 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, 'role' => new Role('CHILL_ACTIVITY_CREATE'), 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index faa042e03..828cb68f2 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -306,14 +306,14 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac * get the center * center is extracted from person. */ - public function getCenters(): array + public function getCenters(): iterable { if ($this->person instanceof Person) { return [$this->person->getCenter()]; } if ($this->getAccompanyingPeriod() instanceof AccompanyingPeriod) { - return $this->getAccompanyingPeriod()->getCenters(); + return $this->getAccompanyingPeriod()->getCenters() ?? []; } return []; From 8809abedf683ffe964e20f29843a77c76cce3a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 12 Jul 2022 18:08:54 +0200 Subject: [PATCH 28/35] fixed: rendering of course in list of courses by household --- .../views/AccompanyingPeriod/_list.html.twig | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list.html.twig index 986392056..b140bb4c1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list.html.twig @@ -48,10 +48,13 @@ {% endmacro %} {% block content %} + + {# WARNING: this list is rendered in either person context or houshold context #} + {%- set acps = [] %} {%- set acpsClosed = [] %} {% for acp in accompanying_periods %} - {% if acp.step == 'CLOSED' or (acp.requestorPerson is not same as(person) and acp.openParticipationContainsPerson(person) is null ) %} + {% if acp.step == 'CLOSED' or (person is defined and acp.requestorPerson is not same as(person) and acp.openParticipationContainsPerson(person) is null ) %} {%- set acpsClosed = acpsClosed|merge([acp]) %} {% else %} {%- set acps = acps|merge([acp]) %} @@ -69,24 +72,30 @@
    {% if acpsClosed|length > 0 %} -
    + {% if person is defined %} + {% set identifier = person.id %} + {% else %} + {% set identifier = household.id %} + {% endif %} + +
    -

    +

    -
    From 83ee3c7cfdc6b4c695f27db1b27ca742c97e1565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 12 Jul 2022 18:15:16 +0200 Subject: [PATCH 29/35] fixed: add required type-hinting to AccompanyingPeriodComment, necessary for docgen rendering --- .../Entity/AccompanyingPeriod/Comment.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php index 595ffa35f..039489864 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php @@ -36,7 +36,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface * inversedBy="comments") * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") */ - private $accompanyingPeriod; + private ?AccompanyingPeriod $accompanyingPeriod; /** * @ORM\Column(type="text") @@ -44,20 +44,20 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface * @Assert\NotBlank * @Assert\NotNull */ - private $content; + private ?string $content; /** * @ORM\Column(type="datetime") * @Groups({"read", "docgen:read"}) */ - private $createdAt; + private ?DateTimeInterface $createdAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) * @Groups({"read", "docgen:read"}) */ - private $creator; + private ?User $creator; /** * @ORM\Id @@ -65,20 +65,20 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface * @ORM\Column(type="integer") * @Groups({"read", "docgen:read"}) */ - private $id; + private ?int $id; /** * @ORM\Column(type="datetime") * @Groups({"read"}) */ - private $updatedAt; + private ?DateTimeInterface $updatedAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) * @Groups({"read"}) */ - private $updatedBy; + private ?User $updatedBy; public function getAccompanyingPeriod(): ?AccompanyingPeriod { From 85796c22718c021a573d9d2c7a49c0d6bd3f41c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 12 Jul 2022 18:16:04 +0200 Subject: [PATCH 30/35] CS --- .../ChillActivityBundle/Controller/ActivityController.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index ee2634884..2c380ad52 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -21,8 +21,6 @@ use Chill\ActivityBundle\Repository\ActivityTypeRepository; use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Repository\LocationRepository; -use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; -use Chill\MainBundle\Security\Resolver\CenterResolverInterface; use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Person; @@ -59,6 +57,8 @@ final class ActivityController extends AbstractController private ActivityTypeRepository $activityTypeRepository; + private CenterResolverManagerInterface $centerResolver; + private EntityManagerInterface $entityManager; private EventDispatcherInterface $eventDispatcher; @@ -73,8 +73,6 @@ final class ActivityController extends AbstractController private ThirdPartyRepository $thirdPartyRepository; - private CenterResolverManagerInterface $centerResolver; - public function __construct( ActivityACLAwareRepositoryInterface $activityACLAwareRepository, ActivityTypeRepository $activityTypeRepository, From b28677fac91f5529a7c9c06956d5f0764a96bcb0 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 18 Jul 2022 14:39:24 +0200 Subject: [PATCH 31/35] delete quitter et repositionner buttons from enfant hors menage --- .../Resources/views/Household/summary.html.twig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig index 7ba2235a6..a8ff245d7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig @@ -180,10 +180,16 @@ {% if members|length > 0 %}
    {% for m in members %} + {% if m.position.shareHousehold %} {% include '@ChillPerson/Household/_render_member.html.twig' with { 'member': m, 'customButtons': { 'before': _self.customButtons(m, household) } } %} + {% else %} + {% include '@ChillPerson/Household/_render_member.html.twig' with { + 'member': m, + } %} + {% endif %} {% endfor %}
    {% else %} From 99154eaa994454eddc5c8d3b5863cfc98a8b3f71 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 18 Jul 2022 14:42:41 +0200 Subject: [PATCH 32/35] changelog updated --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ed9cdebf..9bcbb28db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to * [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty * [search]: Order of birthdate fields changed in advanced search to avoid confusion. * [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675) +* [household]: Reposition and cut button for enfant hors menage have been deleted (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/620) ## Test releases From d55ba3661948bd747e5e62ab17d9940dc2c6d357 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 18 Jul 2022 15:39:00 +0200 Subject: [PATCH 33/35] [person] add comment field to accompanying period resource docgen --- .../ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php index 8f84f319a..73f2e069a 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php @@ -47,7 +47,7 @@ class Resource /** * @ORM\Column(type="text", nullable=true) - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?string $comment = ''; From e6caeecc50b7a8be4f16c0627d7194fb9815cf4f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 18 Jul 2022 16:36:13 +0200 Subject: [PATCH 34/35] add composition type to admin menu --- .../HouseholdCompositionTypeController.php | 26 ++++++++++++ .../ChillPersonExtension.php | 21 ++++++++++ .../Form/HouseholdCompositionTypeType.php | 39 ++++++++++++++++++ .../Menu/AdminHouseholdMenuBuilder.php | 6 ++- .../HouseholdCompositionType/edit.html.twig | 11 +++++ .../HouseholdCompositionType/index.html.twig | 41 +++++++++++++++++++ .../HouseholdCompositionType/new.html.twig | 12 ++++++ .../translations/messages.fr.yml | 6 +++ 8 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeController.php create mode 100644 src/Bundle/ChillPersonBundle/Form/HouseholdCompositionTypeType.php create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/edit.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/index.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/new.html.twig diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeController.php new file mode 100644 index 000000000..eb1dc1ea9 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index d7037c1d2..73ebb007c 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -227,6 +227,27 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], + [ + 'class' => \Chill\PersonBundle\Entity\Household\HouseholdCompositionType::class, + 'name' => 'person_household_composition_type', + 'base_path' => '/admin/person/household/composition-type', + 'form_class' => \Chill\PersonBundle\Form\HouseholdCompositionTypeType::class, + 'controller' => \Chill\PersonBundle\Controller\HouseholdCompositionTypeController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdCompositionType/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdCompositionType/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdCompositionType/edit.html.twig', + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\Relationships\Relation::class, 'name' => 'person_relation', diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionTypeType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionTypeType.php new file mode 100644 index 000000000..f5d26da7f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionTypeType.php @@ -0,0 +1,39 @@ +add('label', TranslatableStringFormType::class) + ->add('active', CheckboxType::class, [ + 'label' => 'Actif?', + 'required' => false, + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', HouseholdCompositionType::class); + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php index e68059e1d..4dc43bcaa 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php @@ -46,9 +46,13 @@ class AdminHouseholdMenuBuilder implements LocalMenuBuilderInterface 'route' => 'chill_crud_person_household_position_index', ])->setExtras(['order' => 2110]); + $menu->addChild('Composition', [ + 'route' => 'chill_crud_person_household_composition_type_index', + ])->setExtras(['order' => 2120]); + $menu->addChild('person_admin.relation', [ 'route' => 'chill_crud_person_relation_index', - ])->setExtras(['order' => 2120]); + ])->setExtras(['order' => 2130]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/edit.html.twig new file mode 100644 index 000000000..28678bf6d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/edit.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/index.html.twig new file mode 100644 index 000000000..252e932e8 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/index.html.twig @@ -0,0 +1,41 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + {{ 'Id'|trans }} + {{ 'Label'|trans }} + {{ 'Active'|trans }} +   + {% endblock %} + + {% block table_entities_tbody %} + {% for entity in entities %} + + {{ entity.id }} + {{ entity.label|localize_translatable_string }} + + {%- if entity.isActive -%} + + {%- else -%} + + {%- endif -%} + + +
      +
    • + +
    • +
    + + + {% endfor %} + {% endblock %} + + {% block actions_before %} +
  • + {{'Back to the admin'|trans}} +
  • + {% endblock %} + {% endembed %} +{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/new.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/new.html.twig new file mode 100644 index 000000000..3a28dd85f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/HouseholdCompositionType/new.html.twig @@ -0,0 +1,12 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_new_title.html.twig') %} +{% endblock %} + +{% block admin_content %} + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} + diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 266970698..7fdec7314 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -409,6 +409,12 @@ crud: add_new: Ajouter un nouveau title_new: Nouvelle position title_edit: Modifier la position + person_household_composition_type: + index: + title: Composition + add_new: Ajouter un nouveau + title_new: Nouvelle composition + title_edit: Modifier la composition person_relation: index: title: Relations de filiations From 80df7b2f72f7b8ec1d85c34eb6368f9fe730ae98 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 18 Jul 2022 16:37:34 +0200 Subject: [PATCH 35/35] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bcbb28db..994d4bd61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to * [search]: Order of birthdate fields changed in advanced search to avoid confusion. * [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675) * [household]: Reposition and cut button for enfant hors menage have been deleted (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/620) +* [admin]: Add crud for composition type in admin (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/611) ## Test releases