chg: [users:filtering] Added dropdown for users filtering

perm_community_admin
Sami Mokaddem 2024-04-02 14:06:25 +02:00
parent 1111290cea
commit 96d53f4b6a
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 14 additions and 1 deletions

View File

@ -11,7 +11,15 @@ use Cake\Http\Exception\NotFoundException;
class UsersController extends AppController
{
public $filterFields = ['Individuals.uuid', 'username', 'Individuals.email', 'Individuals.first_name', 'Individuals.last_name', 'Organisations.name', 'Organisations.nationality'];
public $filterFields = [
'Individuals.uuid',
'username',
'Individuals.email',
'Individuals.first_name',
'Individuals.last_name',
['name' => 'Organisations.id', 'multiple' => true, 'options' => 'getAllOrganisations', 'select2' => true],
'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'];

View File

@ -292,4 +292,9 @@ class UsersTable extends AppTable
}
return true;
}
public function getAllOrganisations($currentUser) {
$this->Individuals = TableRegistry::get('Individuals');
return $this->Individuals->getAllOrganisations($currentUser);
}
}