diff --git a/.changes/unreleased/Feature-20251210-032045.yaml b/.changes/unreleased/Feature-20251210-032045.yaml new file mode 100644 index 000000000..67a648b15 --- /dev/null +++ b/.changes/unreleased/Feature-20251210-032045.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: 'Add filtering to admin lists: social actions, social issues, goals, results, and evaluations' +time: 2025-12-10T03:20:45.135973502+01:00 +custom: + Issue: "478" + SchemaChange: No schema change diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php index 4d0aba918..6a933a574 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php @@ -51,6 +51,18 @@ class EvaluationController extends CRUDController return $this->repository->findFilteredEvaluations($queryString, $activeFilter, $paginator->getCurrentPageFirstItemNumber(), $paginator->getItemsPerPage()); } + protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int + { + if (!$filterOrder instanceof FilterOrderHelper) { + return parent::countEntities($action, $request, $filterOrder); + } + + return $this->repository->countFilteredEvaluations( + $filterOrder->getQueryString(), + $filterOrder->getCheckboxData('activeFilter') + ); + } + protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper { return $this->getFilterOrderHelperFactory() diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php index 1899e53a9..1eef6069e 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php @@ -56,6 +56,18 @@ class GoalController extends CRUDController ); } + protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int + { + if (!$filterOrder instanceof FilterOrderHelper) { + return parent::countEntities($action, $request, $filterOrder); + } + + return $this->repository->countFilteredGoals( + $filterOrder->getQueryString(), + $filterOrder->getCheckboxData('activeFilter') + ); + } + protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper { return $this->getFilterOrderHelperFactory() diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php index ac068f664..2fc6cb880 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php @@ -56,6 +56,18 @@ class ResultController extends CRUDController ); } + protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int + { + if (!$filterOrder instanceof FilterOrderHelper) { + return parent::countEntities($action, $request, $filterOrder); + } + + return $this->repository->countFilteredResults( + $filterOrder->getQueryString(), + $filterOrder->getCheckboxData('activeFilter') + ); + } + protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper { return $this->getFilterOrderHelperFactory() diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php index b3bf127fa..6fc82189a 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php @@ -56,6 +56,18 @@ class SocialActionController extends CRUDController ); } + protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int + { + if (!$filterOrder instanceof FilterOrderHelper) { + return parent::countEntities($action, $request, $filterOrder); + } + + return $this->repository->countFilteredSocialActions( + $filterOrder->getQueryString(), + $filterOrder->getCheckboxData('activeFilter') + ); + } + protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper { return $this->getFilterOrderHelperFactory() diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php index f92daad8a..99fffd6ff 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php @@ -70,6 +70,18 @@ class SocialIssueController extends CRUDController ); } + protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int + { + if (!$filterOrder instanceof FilterOrderHelper) { + return parent::countEntities($action, $request, $filterOrder); + } + + return $this->repository->countFilteredSocialIssues( + $filterOrder->getQueryString(), + $filterOrder->getCheckboxData('activeFilter') + ); + } + protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper { return $this->getFilterOrderHelperFactory()