Skip to content

Commit

Permalink
Merge pull request #97 from bdecentgmbh/dev
Browse files Browse the repository at this point in the history
Call it 2.0
  • Loading branch information
stefanscholz authored Jun 12, 2024
2 parents dfcb5aa + 46b827c commit fe627fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
32 changes: 15 additions & 17 deletions classes/local/data_grid/filter/participants_condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,26 @@ public function get_values() {

$this->values = [];

if (!is_siteadmin()) {
$courses = enrol_get_my_courses();
$courses = enrol_get_my_courses();

$users = [];
foreach ($courses as $course) {
$coursecontext = \context_course::instance($course->id);
if (has_capability('moodle/grade:viewall', $coursecontext)) {
if (has_capability('moodle/site:accessallgroups', $coursecontext)) {
$users = array_merge($users, get_users_by_capability($coursecontext, 'mod/assign:submit'));
} else {
$groups = groups_get_all_groups($course->id, $USER->id);
if ($groupids = array_keys($groups)) {
$users = array_merge($users, groups_get_groups_members($groupids));
}
$users = [];
foreach ($courses as $course) {
$coursecontext = \context_course::instance($course->id);
if (has_capability('moodle/grade:viewall', $coursecontext)) {
if (has_capability('moodle/site:accessallgroups', $coursecontext)) {
$users = array_merge($users, get_users_by_capability($coursecontext, 'mod/assign:submit'));
} else {
$groups = groups_get_all_groups($course->id, $USER->id);
if ($groupids = array_keys($groups)) {
$users = array_merge($users, groups_get_groups_members($groupids));
}
}
}
}

foreach ($users as $user) {
if (($user->id != $USER->id) && (!is_siteadmin($user->id))) {
$this->values[] = $user->id;
}
foreach ($users as $user) {
if (($user->id != $USER->id) && (!is_siteadmin($user->id))) {
$this->values[] = $user->id;
}
}

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
$plugin->version = 2024050802; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021051700; // Requires this Moodle version.
$plugin->component = 'block_dash'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_RC;
$plugin->release = '2.0 RC';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '2.0';
$plugin->supported = [401, 403];

0 comments on commit fe627fb

Please sign in to comment.