chg: [users:index] Added support of table filtering

refacto/CRUDComponent
Sami Mokaddem 2023-11-02 08:09:42 +01:00
parent 63593cfd56
commit dd4ce865bf
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 13 additions and 2 deletions

View File

@ -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();

View File

@ -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',
]
]
],