diff --git a/.changes/unreleased/Fixed-20230913-115954.yaml b/.changes/unreleased/Fixed-20230913-115954.yaml new file mode 100644 index 000000000..df1eef370 --- /dev/null +++ b/.changes/unreleased/Fixed-20230913-115954.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: Fix the label of filter ActivityTypeFilter to a more obvious one +time: 2023-09-13T11:59:54.948009297+02:00 +custom: + Issue: "142" diff --git a/.changes/unreleased/Fixed-20230926-175815.yaml b/.changes/unreleased/Fixed-20230926-175815.yaml new file mode 100644 index 000000000..8eb833de7 --- /dev/null +++ b/.changes/unreleased/Fixed-20230926-175815.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: '[export] Fix association of filter "filter location by type" which did not + appears on "list of activities"' +time: 2023-09-26T17:58:15.871908118+02:00 +custom: + Issue: "140" diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByCreatorAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php similarity index 94% rename from src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByCreatorAggregator.php rename to src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php index 917459de3..10f8b2f09 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByCreatorAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Export\Aggregator; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\AggregatorInterface; @@ -45,7 +45,7 @@ class ByCreatorAggregator implements AggregatorInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByThirdpartyAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php similarity index 95% rename from src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByThirdpartyAggregator.php rename to src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php index ac05b153c..5e19f961c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByThirdpartyAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Export\Aggregator; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\AggregatorInterface; @@ -50,7 +50,7 @@ class ByThirdpartyAggregator implements AggregatorInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/CreatorScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php similarity index 95% rename from src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/CreatorScopeAggregator.php rename to src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php index a4b5258e2..cc5f5d4b5 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/CreatorScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Export\Aggregator; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\AggregatorInterface; @@ -50,7 +50,7 @@ class CreatorScopeAggregator implements AggregatorInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/DateAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php similarity index 96% rename from src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/DateAggregator.php rename to src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php index 4ede5b4c4..e1c4591cd 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/DateAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Export\Aggregator; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\AggregatorInterface; @@ -66,7 +66,7 @@ class DateAggregator implements AggregatorInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/LocationTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php similarity index 95% rename from src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/LocationTypeAggregator.php rename to src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php index c72609e2c..ce9302e9e 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/LocationTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Export\Aggregator; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\AggregatorInterface; @@ -50,7 +50,7 @@ class LocationTypeAggregator implements AggregatorInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php index 9ed6bcda2..e7bd27d82 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\ActivityBundle\Export\Export\LinkedToACP; use Chill\ActivityBundle\Entity\Activity; +use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Export\ListActivityHelper; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Chill\MainBundle\Entity\Scope; @@ -160,6 +161,7 @@ class ListActivity implements ListInterface, GroupedExportInterface return array_merge( $this->helper->supportsModifiers(), [ + Declarations::ACTIVITY, \Chill\PersonBundle\Export\Declarations::ACP_TYPE, ] ); diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php index d14111ba7..129ec53fb 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php @@ -299,7 +299,7 @@ class ListActivity implements ListInterface, GroupedExportInterface return [ Declarations::ACTIVITY, Declarations::ACTIVITY_PERSON, - //PersonDeclarations::PERSON_TYPE, + PersonDeclarations::PERSON_TYPE, ]; } } diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php index a679c4ac8..3e7d86c89 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php @@ -155,7 +155,7 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface return [ Declarations::ACTIVITY, Declarations::ACTIVITY_PERSON, - //PersonDeclarations::PERSON_TYPE, + PersonDeclarations::PERSON_TYPE, ]; } } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php index 4ffc3b38c..72528170f 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php @@ -21,19 +21,15 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\FormBuilderInterface; +/** + * Filter accompanying period to keep only the one having at list one activity from the given ActivityType. + */ class ActivityTypeFilter implements FilterInterface { - private ActivityTypeRepositoryInterface $activityTypeRepository; - - private TranslatableStringHelperInterface $translatableStringHelper; - public function __construct( - ActivityTypeRepositoryInterface $activityTypeRepository, - TranslatableStringHelperInterface $translatableStringHelper - ) { - $this->activityTypeRepository = $activityTypeRepository; - $this->translatableStringHelper = $translatableStringHelper; - } + private readonly ActivityTypeRepositoryInterface $activityTypeRepository, + private readonly TranslatableStringHelperInterface $translatableStringHelper + ) {} public function addRole(): ?string { @@ -81,7 +77,7 @@ class ActivityTypeFilter implements FilterInterface $types[] = $this->translatableStringHelper->localize($aty->getName()); } - return ['Filtered by activity types: only %activitytypes%', [ + return ['export.filter.activity.acp_by_activity_type.acp_containing_at_least_one_%activitytypes%', [ '%activitytypes%' => implode(', ', $types), ]]; } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php index b5dab4009..ab7331a65 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php @@ -17,6 +17,9 @@ use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; +/** + * Filter accompanying periods to keep only the one without any activity + */ class HasNoActivityFilter implements FilterInterface { public function addRole(): ?string diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ByCreatorFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php similarity index 94% rename from src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ByCreatorFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php index add9c7c3d..4c1e13f10 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ByCreatorFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Export\Filter; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\FilterInterface; @@ -43,7 +43,7 @@ class ByCreatorFilter implements FilterInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php similarity index 95% rename from src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php index 66ab40e48..47fb3b027 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Export\Filter; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\FilterInterface; @@ -58,7 +58,7 @@ class EmergencyFilter implements FilterInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php similarity index 94% rename from src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php index 312f3a6a0..f5c7b4d16 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Export\Filter; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\FilterInterface; @@ -36,7 +36,7 @@ class LocationFilter implements FilterInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php similarity index 95% rename from src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationTypeFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php index 1c3415460..bff5a0491 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Export\Filter; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\FilterInterface; @@ -55,7 +55,7 @@ class LocationTypeFilter implements FilterInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/SentReceivedFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php similarity index 96% rename from src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/SentReceivedFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php index 0f2a1c7e4..8d1e8baf0 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/SentReceivedFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Export\Filter; use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Export\Declarations; @@ -59,7 +59,7 @@ class SentReceivedFilter implements FilterInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php similarity index 95% rename from src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php index 9ae988579..c32b60f96 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Export\Filter; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Export\FilterInterface; @@ -51,7 +51,7 @@ class UserFilter implements FilterInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UserScopeFilter.php similarity index 96% rename from src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php rename to src/Bundle/ChillActivityBundle/Export/Filter/UserScopeFilter.php index adb1e94f1..d29dea970 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UserScopeFilter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Export\Filter; use Chill\ActivityBundle\Export\Declarations; use Chill\MainBundle\Entity\Scope; @@ -57,7 +57,7 @@ class UserScopeFilter implements FilterInterface public function applyOn(): string { - return Declarations::ACTIVITY_ACP; + return Declarations::ACTIVITY; } public function buildForm(FormBuilderInterface $builder) diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialActionAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialActionAggregatorTest.php index 7f6c76332..6f5af8982 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialActionAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialActionAggregatorTest.php @@ -12,7 +12,7 @@ declare(strict_types=1); namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialActionAggregator; +use Chill\ActivityBundle\Export\Aggregator\BySocialActionAggregator; use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Doctrine\ORM\EntityManagerInterface; diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialIssueAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialIssueAggregatorTest.php index c8374d370..19d29141b 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialIssueAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialIssueAggregatorTest.php @@ -12,7 +12,7 @@ declare(strict_types=1); namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialIssueAggregator; +use Chill\ActivityBundle\Export\Aggregator\BySocialIssueAggregator; use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Doctrine\ORM\EntityManagerInterface; diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByThirdpartyAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByThirdpartyAggregatorTest.php similarity index 83% rename from src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByThirdpartyAggregatorTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByThirdpartyAggregatorTest.php index e3bbde25f..44d0ec497 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByThirdpartyAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByThirdpartyAggregatorTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Tests\Export\Aggregator; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByThirdpartyAggregator; +use Chill\ActivityBundle\Export\Aggregator\ByThirdpartyAggregator; use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Doctrine\ORM\EntityManagerInterface; @@ -28,7 +28,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest { self::bootKernel(); - $this->aggregator = self::$container->get('chill.activity.export.bythirdparty_aggregator'); + $this->aggregator = self::$container->get(ByThirdpartyAggregator::class); } public function getAggregator() diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByUserAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByUserAggregatorTest.php similarity index 90% rename from src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByUserAggregatorTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByUserAggregatorTest.php index ff4f42ec4..f256bde53 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByUserAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByUserAggregatorTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Tests\Export\Aggregator; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByCreatorAggregator; +use Chill\ActivityBundle\Export\Aggregator\ByCreatorAggregator; use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Doctrine\ORM\EntityManagerInterface; diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/UserScopeAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorScopeAggregatorTest.php similarity index 85% rename from src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/UserScopeAggregatorTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorScopeAggregatorTest.php index 1265804f9..da3d1c871 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/UserScopeAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorScopeAggregatorTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Tests\Export\Aggregator; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\CreatorScopeAggregator; +use Chill\ActivityBundle\Export\Aggregator\CreatorScopeAggregator; use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Doctrine\ORM\EntityManagerInterface; @@ -20,7 +20,7 @@ use Doctrine\ORM\EntityManagerInterface; * @internal * @coversNothing */ -final class UserScopeAggregatorTest extends AbstractAggregatorTest +final class CreatorScopeAggregatorTest extends AbstractAggregatorTest { private CreatorScopeAggregator $aggregator; diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/DateAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/DateAggregatorTest.php similarity index 85% rename from src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/DateAggregatorTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/DateAggregatorTest.php index feb5ed970..44ff0529b 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/DateAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/DateAggregatorTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Tests\Export\Aggregator; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\DateAggregator; +use Chill\ActivityBundle\Export\Aggregator\DateAggregator; use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Doctrine\ORM\EntityManagerInterface; @@ -28,7 +28,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest { self::bootKernel(); - $this->aggregator = self::$container->get('chill.activity.export.date_aggregator'); + $this->aggregator = self::$container->get(DateAggregator::class); } public function getAggregator() diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/LocationTypeAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php similarity index 83% rename from src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/LocationTypeAggregatorTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php index c384eb772..c4641bd4c 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/LocationTypeAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; +namespace Chill\ActivityBundle\Tests\Export\Aggregator; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\LocationTypeAggregator; +use Chill\ActivityBundle\Export\Aggregator\LocationTypeAggregator; use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Doctrine\ORM\EntityManagerInterface; @@ -28,7 +28,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest { self::bootKernel(); - $this->aggregator = self::$container->get('chill.activity.export.locationtype_aggregator'); + $this->aggregator = self::$container->get(LocationTypeAggregator::class); } public function getAggregator() diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ActivityTypeFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ActivityTypeFilterTest.php index 72b99375b..3ed453f69 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ActivityTypeFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ActivityTypeFilterTest.php @@ -13,9 +13,10 @@ namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\ActivityType; -use Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter; +use Chill\ActivityBundle\Export\Filter\ActivityTypeFilter; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\PersonBundle\Entity\AccompanyingPeriod; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Query\Expr; @@ -25,13 +26,13 @@ use Doctrine\ORM\Query\Expr; */ final class ActivityTypeFilterTest extends AbstractFilterTest { - private ActivityTypeFilter $filter; + private \Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter $filter; protected function setUp(): void { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.filter_activitytype'); + $this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class); } public function getFilter() @@ -47,13 +48,14 @@ final class ActivityTypeFilterTest extends AbstractFilterTest ->from(ActivityType::class, 'at') ->select('at') ->getQuery() + ->setMaxResults(1) ->getResult(); $data = []; foreach ($array as $a) { $data[] = [ - 'accepted_activitytypes' => $a, + 'accepted_activitytypes' => new ArrayCollection([$a]), ]; } diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialActionFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialActionFilterTest.php index a707e1242..1fa121d94 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialActionFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialActionFilterTest.php @@ -12,9 +12,9 @@ declare(strict_types=1); namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\PersonBundle\Entity\SocialWork\SocialAction; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\EntityManagerInterface; /** @@ -23,13 +23,13 @@ use Doctrine\ORM\EntityManagerInterface; */ final class BySocialActionFilterTest extends AbstractFilterTest { - private BySocialActionFilter $filter; + private \Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter $filter; protected function setUp(): void { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.bysocialaction_filter'); + $this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class); } public function getFilter() @@ -39,19 +39,22 @@ final class BySocialActionFilterTest extends AbstractFilterTest public function getFormData(): array { + self::bootKernel(); + $em = self::$container->get(EntityManagerInterface::class); $array = $em->createQueryBuilder() ->from(SocialAction::class, 'sa') ->select('sa') ->getQuery() + ->setMaxResults(1) ->getResult(); $data = []; foreach ($array as $a) { $data[] = [ - 'accepted_socialactions' => $a, + 'accepted_socialactions' => new ArrayCollection([$a]), ]; } @@ -60,9 +63,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest public function getQueryBuilders(): array { - if (null === self::$kernel) { - self::bootKernel(); - } + self::bootKernel(); $em = self::$container->get(EntityManagerInterface::class); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialIssueFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialIssueFilterTest.php index 5f34a8f3b..ee2360a4e 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialIssueFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialIssueFilterTest.php @@ -15,6 +15,7 @@ use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\PersonBundle\Entity\SocialWork\SocialIssue; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\EntityManagerInterface; /** @@ -29,7 +30,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.bysocialissue_filter'); + $this->filter = self::$container->get(BySocialIssueFilter::class); } public function getFilter() @@ -39,19 +40,21 @@ final class BySocialIssueFilterTest extends AbstractFilterTest public function getFormData(): array { + self::bootKernel(); $em = self::$container->get(EntityManagerInterface::class); $array = $em->createQueryBuilder() ->from(SocialIssue::class, 'si') ->select('si') ->getQuery() + ->setMaxResults(2) ->getResult(); $data = []; foreach ($array as $a) { $data[] = [ - 'accepted_socialissues' => $a, + 'accepted_socialissues' => new ArrayCollection([$a]), ]; } diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByUserFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByUserFilterTest.php index 47e76e25c..83b0b1a25 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByUserFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByUserFilterTest.php @@ -9,10 +9,15 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Tests\Export\Filter; use Chill\ActivityBundle\Entity\Activity; +<<<<<<<< HEAD:src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByUserFilterTest.php use Chill\ActivityBundle\Export\Filter\ACPFilters\ByCreatorFilter; +======== +use Chill\ActivityBundle\Export\Filter\ByCreatorFilter; +use Chill\ActivityBundle\Export\Filter\UserFilter; +>>>>>>>> 1f4d912d8 (Re-associate activity exports and filters):src/Bundle/ChillActivityBundle/Tests/Export/Filter/ByCreatorFilterTest.php use Chill\MainBundle\Entity\User; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Doctrine\ORM\EntityManagerInterface; diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityDateFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityDateFilterTest.php index 8d6d6b790..64d455125 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityDateFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityDateFilterTest.php @@ -29,7 +29,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.date_filter'); + $this->filter = self::$container->get(ActivityDateFilter::class); } public function getFilter() diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ByCreatorFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ByCreatorFilterTest.php new file mode 100644 index 000000000..e41a0e43e --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ByCreatorFilterTest.php @@ -0,0 +1,76 @@ +filter = self::$container->get(ByCreatorFilter::class); + } + + public function getFilter() + { + return $this->filter; + } + + public function getFormData(): array + { + $em = self::$container->get(EntityManagerInterface::class); + + $array = $em->createQueryBuilder() + ->from(User::class, 'u') + ->select('u') + ->getQuery() + ->getResult(); + + $data = []; + + foreach ($array as $a) { + $data[] = [ + 'accepted_users' => $a, + ]; + } + + return $data; + } + + public function getQueryBuilders(): array + { + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('count(activity.id)') + ->from(Activity::class, 'activity') + ->join('activity.users', 'actusers'), + ]; + } +} diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/EmergencyFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/EmergencyFilterTest.php similarity index 84% rename from src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/EmergencyFilterTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Filter/EmergencyFilterTest.php index 5242f337a..072588ced 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/EmergencyFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/EmergencyFilterTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Tests\Export\Filter; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Filter\ACPFilters\EmergencyFilter; +use Chill\ActivityBundle\Export\Filter\EmergencyFilter; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Doctrine\ORM\EntityManagerInterface; @@ -28,7 +28,7 @@ final class EmergencyFilterTest extends AbstractFilterTest { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.emergency_filter'); + $this->filter = self::$container->get(EmergencyFilter::class); } public function getFilter() diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/LocationTypeFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/LocationTypeFilterTest.php similarity index 87% rename from src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/LocationTypeFilterTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Filter/LocationTypeFilterTest.php index c037a28b1..2d779bf32 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/LocationTypeFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/LocationTypeFilterTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Tests\Export\Filter; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Filter\ACPFilters\LocationTypeFilter; +use Chill\ActivityBundle\Export\Filter\LocationTypeFilter; use Chill\MainBundle\Entity\LocationType; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Doctrine\ORM\EntityManagerInterface; @@ -29,7 +29,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.locationtype_filter'); + $this->filter = self::$container->get(LocationTypeFilter::class); } public function getFilter() diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilterTest.php index eb296e9a4..2fb68ed81 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilterTest.php @@ -54,7 +54,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest $data[] = [ 'date_from' => DateTime::createFromFormat('Y-m-d', '2021-07-01'), 'date_to' => DateTime::createFromFormat('Y-m-d', '2022-07-01'), - 'reasons' => $a, + 'reasons' => [$a], ]; } @@ -72,7 +72,9 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest return [ $em->createQueryBuilder() ->select('count(activity.id)') - ->from(Activity::class, 'activity'), + ->from(Activity::class, 'activity') + ->join('activity.person', 'person') + , ]; } } diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/SentReceivedFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/SentReceivedFilterTest.php similarity index 84% rename from src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/SentReceivedFilterTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Filter/SentReceivedFilterTest.php index 6b16daa99..5ea655f79 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/SentReceivedFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/SentReceivedFilterTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Tests\Export\Filter; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Filter\ACPFilters\SentReceivedFilter; +use Chill\ActivityBundle\Export\Filter\SentReceivedFilter; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Doctrine\ORM\EntityManagerInterface; @@ -28,7 +28,7 @@ final class SentReceivedFilterTest extends AbstractFilterTest { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.sentreceived_filter'); + $this->filter = self::$container->get(SentReceivedFilter::class); } public function getFilter() diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/UserFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserFilterTest.php similarity index 87% rename from src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/UserFilterTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserFilterTest.php index fda613d2e..b80a160d7 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/UserFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserFilterTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Tests\Export\Filter; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Filter\ACPFilters\UserFilter; +use Chill\ActivityBundle\Export\Filter\UserFilter; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Doctrine\ORM\EntityManagerInterface; @@ -29,7 +29,7 @@ final class UserFilterTest extends AbstractFilterTest { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.user_filter'); + $this->filter = self::$container->get(UserFilter::class); } public function getFilter() diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/UserScopeFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserScopeFilterTest.php similarity index 87% rename from src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/UserScopeFilterTest.php rename to src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserScopeFilterTest.php index 5742662b2..46ff8fda3 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/UserScopeFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserScopeFilterTest.php @@ -9,10 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; +namespace Chill\ActivityBundle\Tests\Export\Filter; use Chill\ActivityBundle\Entity\Activity; -use Chill\ActivityBundle\Export\Filter\ACPFilters\UserScopeFilter; +use Chill\ActivityBundle\Export\Filter\UserScopeFilter; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Doctrine\ORM\EntityManagerInterface; @@ -29,7 +29,7 @@ final class UserScopeFilterTest extends AbstractFilterTest { self::bootKernel(); - $this->filter = self::$container->get('chill.activity.export.userscope_filter'); + $this->filter = self::$container->get(UserScopeFilter::class); } public function getFilter() diff --git a/src/Bundle/ChillActivityBundle/config/services/export.yaml b/src/Bundle/ChillActivityBundle/config/services/export.yaml index 5af2895e9..563ea7bf5 100644 --- a/src/Bundle/ChillActivityBundle/config/services/export.yaml +++ b/src/Bundle/ChillActivityBundle/config/services/export.yaml @@ -53,8 +53,7 @@ services: tags: - { name: chill.export_filter, alias: 'activity_type_filter' } - chill.activity.export.date_filter: - class: Chill\ActivityBundle\Export\Filter\ActivityDateFilter + Chill\ActivityBundle\Export\Filter\ActivityDateFilter: tags: - { name: chill.export_filter, alias: 'activity_date_filter' } @@ -74,52 +73,43 @@ services: name: chill.export_filter alias: 'activity_person_having_ac_bw_date_filter' - chill.activity.export.filter_activitytype: - class: Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter + Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter: tags: - { name: chill.export_filter, alias: 'accompanyingcourse_activitytype_filter' } - chill.activity.export.location_filter: - class: Chill\ActivityBundle\Export\Filter\ACPFilters\LocationFilter + Chill\ActivityBundle\Export\Filter\LocationFilter: tags: - { name: chill.export_filter, alias: 'activity_location_filter' } - chill.activity.export.locationtype_filter: - class: Chill\ActivityBundle\Export\Filter\ACPFilters\LocationTypeFilter + Chill\ActivityBundle\Export\Filter\LocationTypeFilter: tags: - { name: chill.export_filter, alias: 'activity_locationtype_filter' } - Chill\ActivityBundle\Export\Filter\ACPFilters\ByCreatorFilter: + Chill\ActivityBundle\Export\Filter\ByCreatorFilter: tags: - { name: chill.export_filter, alias: 'activity_bycreator_filter' } - chill.activity.export.emergency_filter: - class: Chill\ActivityBundle\Export\Filter\ACPFilters\EmergencyFilter + Chill\ActivityBundle\Export\Filter\EmergencyFilter: tags: - { name: chill.export_filter, alias: 'activity_emergency_filter' } - chill.activity.export.sentreceived_filter: - class: Chill\ActivityBundle\Export\Filter\ACPFilters\SentReceivedFilter + Chill\ActivityBundle\Export\Filter\SentReceivedFilter: tags: - { name: chill.export_filter, alias: 'activity_sentreceived_filter' } - chill.activity.export.bysocialaction_filter: - class: Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter + Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter: tags: - { name: chill.export_filter, alias: 'activity_bysocialaction_filter' } - chill.activity.export.bysocialissue_filter: - class: Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter + Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter: tags: - { name: chill.export_filter, alias: 'activity_bysocialissue_filter' } - chill.activity.export.user_filter: # Creator (M2O) - class: Chill\ActivityBundle\Export\Filter\ACPFilters\UserFilter + Chill\ActivityBundle\Export\Filter\UserFilter: tags: - { name: chill.export_filter, alias: 'activity_user_filter' } - chill.activity.export.userscope_filter: - class: Chill\ActivityBundle\Export\Filter\ACPFilters\UserScopeFilter + Chill\ActivityBundle\Export\Filter\UserScopeFilter: tags: - { name: chill.export_filter, alias: 'activity_userscope_filter' } @@ -157,22 +147,19 @@ services: tags: - { name: chill.export_aggregator, alias: activity_user_aggregator } - chill.activity.export.locationtype_aggregator: - class: Chill\ActivityBundle\Export\Aggregator\ACPAggregators\LocationTypeAggregator + Chill\ActivityBundle\Export\Aggregator\LocationTypeAggregator: tags: - { name: chill.export_aggregator, alias: activity_locationtype_aggregator } - chill.activity.export.date_aggregator: - class: Chill\ActivityBundle\Export\Aggregator\ACPAggregators\DateAggregator + Chill\ActivityBundle\Export\Aggregator\DateAggregator: tags: - { name: chill.export_aggregator, alias: activity_date_aggregator } - Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByCreatorAggregator: + Chill\ActivityBundle\Export\Aggregator\ByCreatorAggregator: tags: - { name: chill.export_aggregator, alias: activity_by_creator_aggregator } - chill.activity.export.bythirdparty_aggregator: - class: Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByThirdpartyAggregator + Chill\ActivityBundle\Export\Aggregator\ByThirdpartyAggregator: tags: - { name: chill.export_aggregator, alias: activity_bythirdparty_aggregator } @@ -186,7 +173,7 @@ services: tags: - { name: chill.export_aggregator, alias: activity_bysocialissue_aggregator } - Chill\ActivityBundle\Export\Aggregator\ACPAggregators\CreatorScopeAggregator: + Chill\ActivityBundle\Export\Aggregator\CreatorScopeAggregator: tags: - { name: chill.export_aggregator, alias: activity_creator_scope_aggregator } diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index 4ddad2292..ef2494f57 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -377,6 +377,8 @@ export: Title: Filtre les parcours ayant reçu un échange entre deux dates Receiving an activity after: Ayant reçu un échange après le Receiving an activity before: Ayant reçu un échange avant le + acp_by_activity_type: + 'acp_containing_at_least_one_%activitytypes%': 'Parcours filtrés: uniquement ceux qui contiennent au moins un échange d''un des types suivants: %activitytypes%' aggregator: diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php index f12627ae3..2c998db5d 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php @@ -224,7 +224,7 @@ class SocialIssue /** * @param array|SocialIssue[] $socialIssues */ - public static function getDescendantsWithThisForIssues(array $socialIssues): Collection + public static function getDescendantsWithThisForIssues(array|Collection $socialIssues): Collection { $unique = [];