diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index 6ca72db..6fdbcdc 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -11,7 +11,7 @@ use Cake\Http\Exception\NotFoundException; class UsersController extends AppController { - public $filterFields = ['Individuals.uuid', 'username', 'Individuals.email', 'Individuals.first_name', 'Individuals.last_name', 'Organisations.name', 'Organisation.nationality']; + public $filterFields = ['Individuals.uuid', 'username', 'Individuals.email', 'Individuals.first_name', 'Individuals.last_name', 'Organisations.name', 'Organisations.nationality']; public $quickFilterFields = ['Individuals.uuid', ['username' => true], ['Individuals.first_name' => true], ['Individuals.last_name' => true], 'Individuals.email']; public $containFields = ['Individuals', 'Roles', 'UserSettings', 'Organisations', 'OrgGroups']; @@ -63,6 +63,11 @@ class UsersController extends AppController $this->set('validOrgIDsFOrEdition', $validOrgIDsFOrEdition); } + public function filtering() + { + $this->CRUD->filtering(); + } + public function add() { $currentUser = $this->ACL->getUser(); diff --git a/templates/Users/index.php b/templates/Users/index.php index 4071a5a..13b434d 100644 --- a/templates/Users/index.php +++ b/templates/Users/index.php @@ -17,15 +17,21 @@ echo $this->element('genericElements/IndexTable/index_table', [ ] ] ], + [ + 'type' => 'context_filters', + 'context_filters' => $filteringContexts + ], [ 'type' => 'search', 'button' => __('Search'), 'placeholder' => __('Enter value to search'), 'data' => '', - 'searchKey' => 'value' + 'searchKey' => 'value', + 'allowFilering' => true ], [ 'type' => 'table_action', + 'table_setting_id' => 'user_index', ] ] ],