mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'MDL-62209-master' of git://github.com/junpataleta/moodle
This commit is contained in:
commit
cb3cd93b39
@ -220,6 +220,7 @@ class api {
|
||||
public static function get_data_requests($userid = 0) {
|
||||
global $USER;
|
||||
$results = [];
|
||||
$sort = 'status ASC, timemodified ASC';
|
||||
if ($userid) {
|
||||
// Get the data requests for the user or data requests made by the user.
|
||||
$select = "userid = :userid OR requestedby = :requestedby";
|
||||
@ -227,11 +228,11 @@ class api {
|
||||
'userid' => $userid,
|
||||
'requestedby' => $userid
|
||||
];
|
||||
$results = data_request::get_records_select($select, $params, 'status DESC, timemodified DESC');
|
||||
$results = data_request::get_records_select($select, $params, $sort);
|
||||
} else {
|
||||
// If the current user is one of the site's Data Protection Officers, then fetch all data requests.
|
||||
if (self::is_site_dpo($USER->id)) {
|
||||
$results = data_request::get_records(null, 'status DESC, timemodified DESC', '');
|
||||
$results = data_request::get_records(null, $sort, '');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user