From ae8ecf39555b93b6805be463b9eb0380f40a5234 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Tue, 15 Nov 2022 11:41:30 +0100 Subject: [PATCH] chg: [organisation:index] Added quickfilter showing all orgs having the same nationality as logged user.org --- src/Controller/OrganisationsController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Controller/OrganisationsController.php b/src/Controller/OrganisationsController.php index e5d9ad5..aa522c0 100644 --- a/src/Controller/OrganisationsController.php +++ b/src/Controller/OrganisationsController.php @@ -56,6 +56,16 @@ class OrganisationsController extends AppController // ], ]; + $loggedUserOrganisationNationality = $this->ACL->getUser()['organisation']['nationality']; + if (!empty($loggedUserOrganisationNationality)) { + $customContextFilters[] = [ + 'label' => __('Country: {0}', $loggedUserOrganisationNationality), + 'filterCondition' => [ + 'nationality' => $loggedUserOrganisationNationality, + ] + ]; + } + $this->CRUD->index([ 'filters' => $this->filterFields, 'quickFilters' => $this->quickFilterFields,