diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ed9cdebf..994d4bd61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ 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) +* [admin]: Add crud for composition type in admin (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/611) ## Test releases 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/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index a89b1d67c..2c380ad52 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -21,6 +21,7 @@ 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\CenterResolverManagerInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Privacy\PrivacyEvent; @@ -56,6 +57,8 @@ final class ActivityController extends AbstractController private ActivityTypeRepository $activityTypeRepository; + private CenterResolverManagerInterface $centerResolver; + private EntityManagerInterface $entityManager; private EventDispatcherInterface $eventDispatcher; @@ -82,7 +85,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 +100,7 @@ final class ActivityController extends AbstractController $this->eventDispatcher = $eventDispatcher; $this->logger = $logger; $this->serializer = $serializer; + $this->centerResolver = $centerResolver; } /** @@ -198,7 +203,7 @@ final class ActivityController extends AbstractController // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity); $form = $this->createForm(ActivityType::class, $entity, [ - 'center' => $entity->getCenter(), + 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, 'role' => new Role('CHILL_ACTIVITY_UPDATE'), 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, @@ -416,7 +421,7 @@ final class ActivityController extends AbstractController $this->denyAccessUnlessGranted(ActivityVoter::CREATE, $entity); $form = $this->createForm(ActivityType::class, $entity, [ - 'center' => $entity->getCenter(), + 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, 'role' => new Role('CHILL_ACTIVITY_CREATE'), 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, 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 5fa0bca35..828cb68f2 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -16,8 +16,8 @@ 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\HasScopeInterface; +use Chill\MainBundle\Entity\HasCentersInterface; +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, HasCentersInterface, HasScopesInterface { public const SENTRECEIVED_RECEIVED = 'received'; @@ -306,13 +306,17 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac * get the center * center is extracted from person. */ - public function getCenter(): ?Center + public function getCenters(): iterable { if ($this->person instanceof Person) { - return $this->person->getCenter(); + return [$this->person->getCenter()]; } - return null; + if ($this->getAccompanyingPeriod() instanceof AccompanyingPeriod) { + return $this->getAccompanyingPeriod()->getCenters() ?? []; + } + + return []; } public function getComment(): CommentEmbeddable @@ -422,6 +426,19 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this->scope; } + public function getScopes(): iterable + { + 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/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 898f39e56..011243d46 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -14,17 +14,20 @@ 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; 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; 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; @@ -50,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 @@ -109,19 +113,18 @@ 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'] instanceof 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, ]); } /** @var ? \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingPeriod */ $accompanyingPeriod = null; - if ($options['accompanyingPeriod']) { + if ($options['accompanyingPeriod'] instanceof AccompanyingPeriod) { $accompanyingPeriod = $options['accompanyingPeriod']; } @@ -218,12 +221,10 @@ class ActivityType extends AbstractType ]); } - if ($activityType->isVisible('user') && $options['center']) { - $builder->add('user', UserPickerType::class, [ + if ($activityType->isVisible('user') && $options['center'] instanceof Center) { + $builder->add('user', PickUserDynamicType::class, [ 'label' => $activityType->getLabel('user'), 'required' => $activityType->isRequired('user'), - 'center' => $options['center'], - 'role' => $options['role'], ]); } @@ -442,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/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..c95471771 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, $subject->getPerson(), $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.'); @@ -158,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); } } 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'), ]); } } 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/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); 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); 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/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', [ 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'] ); } diff --git a/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php new file mode 100644 index 000000000..63307a99d --- /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 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 ' 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); } } 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'")); + } + } } 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' => [ 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/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; } 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 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'); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index 4d78bb42b..bf7f24f4b 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, @@ -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(); } 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 e5b5b4e10..61bce30f9 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -228,6 +228,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/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php index 1fe398290..039489864 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php @@ -36,49 +36,49 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface * inversedBy="comments") * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") */ - private $accompanyingPeriod; + private ?AccompanyingPeriod $accompanyingPeriod; /** * @ORM\Column(type="text") - * @Groups({"read", "write"}) + * @Groups({"read", "write", "docgen:read"}) * @Assert\NotBlank * @Assert\NotNull */ - private $content; + private ?string $content; /** * @ORM\Column(type="datetime") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ - private $createdAt; + private ?DateTimeInterface $createdAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ - private $creator; + private ?User $creator; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") - * @Groups({"read"}) + * @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 { 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 = ''; 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/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 7da08d740..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 `getCurrentPersonAddress` instead + * @deprecated Use @see{Person::getCurrentPersonAddress} or @see{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 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/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 %} 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 %} - {% for period in accompanying_periods %} + {# 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 (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]) %} + {% 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 %} + {% if person is defined %} + {% set identifier = person.id %} + {% else %} + {% set identifier = household.id %} + {% endif %} + +
+
+

+ +

+ +
+ +
+ {% 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/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 %} 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/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/Resources/views/Person/list_with_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig index c407b6c57..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 @@ -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) %} @@ -233,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]) %} diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php index f4387f40a..2144db5a3 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php @@ -118,7 +118,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(); } 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/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)); + } } 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, diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index ca7a27e1c..773024823 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -468,6 +468,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