chg: [users:filtering] Added dropdown for users filtering
parent
1111290cea
commit
96d53f4b6a
|
@ -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'];
|
||||
|
||||
|
|
|
@ -292,4 +292,9 @@ class UsersTable extends AppTable
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getAllOrganisations($currentUser) {
|
||||
$this->Individuals = TableRegistry::get('Individuals');
|
||||
return $this->Individuals->getAllOrganisations($currentUser);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue