From bdc645d4c7c90beae783331d4760332f62b64e4c Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Tue, 10 Jun 2014 20:03:13 -0300 Subject: [PATCH] =?UTF-8?q?Quadros=20resumo=20mostram=20apenas=20fun=C3=A7?= =?UTF-8?q?=C3=B5es=20de=20interesse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 679e34b..7af8ebb 100644 --- a/index.php +++ b/index.php @@ -92,11 +92,21 @@ if ($group===0 && $course->groupmode==SEPARATEGROUPS) { // Get data for user filtering $manager = new course_enrolment_manager($PAGE, $course); -$roles = $manager->get_all_roles(); $mform = new filter_form($course->id, $filterfields); $instances = $manager->get_enrolment_instances(); $contextids = $context->get_parent_context_ids(true); +// Roles +$allroles = $manager->get_all_roles(); +$role_confirmed = get_config(null, 'report_ilbenrol_confirmed'); +$role_revoked = get_config(null, 'report_ilbenrol_revoked'); + +if (!$role_confirmed or !$role_revoked) { + print_error('invalidargorconf'); +} + +$roles = array($role_confirmed=>$allroles[$role_confirmed], $role_revoked=>$allroles[$role_revoked]); + // Generate where clause $where = array(); $where_params = array(); @@ -414,7 +424,7 @@ foreach($userlist as $user) { $user_roles = $manager->get_user_roles($user->id); $display_roles = array(); foreach ($user_roles as $rid=>$rassignable) { - $display_roles[] = $roles[$rid]->localname; + $display_roles[] = $allroles[$rid]->localname; } $display_roles = implode(', ', $display_roles);