mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-73916 reportbuilder: Allow to set default condition values
- Changes on datasource class to allow to set default condition values - Added default condition 'suspended' set to 'no' on users datasource
This commit is contained in:
parent
5500d143f4
commit
c6777c9cbf
4 changed files with 47 additions and 2 deletions
|
@ -20,6 +20,7 @@ namespace core_user\reportbuilder\datasource;
|
|||
|
||||
use core_reportbuilder\datasource;
|
||||
use core_reportbuilder\local\entities\user;
|
||||
use core_reportbuilder\local\filters\boolean_select;
|
||||
use core_reportbuilder\local\helpers\database;
|
||||
|
||||
/**
|
||||
|
@ -87,6 +88,22 @@ class users extends datasource {
|
|||
* @return string[]
|
||||
*/
|
||||
public function get_default_conditions(): array {
|
||||
return ['user:fullname', 'user:username', 'user:email'];
|
||||
return [
|
||||
'user:fullname',
|
||||
'user:username',
|
||||
'user:email',
|
||||
'user:suspended',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the conditions values that will be added to the report once is created
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_default_condition_values(): array {
|
||||
return [
|
||||
'user:suspended_operator' => boolean_select::NOT_CHECKED,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue