From 4a8622fab6f598a8a8a382a3c4e1f3ace8e43a5b Mon Sep 17 00:00:00 2001 From: Artem Andreev Date: Sat, 2 Mar 2013 11:50:38 +0400 Subject: [PATCH] Fixed bug with auto filtering users on the Taking page based on active group (thanks Molten Bean) --- renderables.php | 6 ++++-- take.php | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/renderables.php b/renderables.php index 16fe825..a5482ca 100644 --- a/renderables.php +++ b/renderables.php @@ -257,10 +257,12 @@ class attforblock_take_data implements renderable { private $att; public function __construct(attforblock $att) { - if ($att->pageparams->grouptype) + if ($att->pageparams->grouptype) { $this->users = $att->get_users($att->pageparams->grouptype); - else + } + else { $this->users = $att->get_users($att->pageparams->group); + } $this->pageparams = $att->pageparams; $this->perm = $att->perm; diff --git a/take.php b/take.php index 4f74e14..b7415d4 100644 --- a/take.php +++ b/take.php @@ -22,7 +22,6 @@ $pageparams = new att_take_page_params(); $id = required_param('id', PARAM_INT); $pageparams->sessionid = required_param('sessionid', PARAM_INT); $pageparams->grouptype = required_param('grouptype', PARAM_INT); -$pageparams->group = optional_param('group', null, PARAM_INT); $pageparams->sort = optional_param('sort', null, PARAM_INT); $pageparams->copyfrom = optional_param('copyfrom', null, PARAM_INT); $pageparams->viewmode = optional_param('viewmode', null, PARAM_INT); @@ -34,6 +33,8 @@ $att = $DB->get_record('attforblock', array('id' => $cm->instance), ' require_login($course, true, $cm); +$pageparams->group = groups_get_activity_group($cm, true); + $pageparams->init($course->id); $att = new attforblock($att, $cm, $course, $PAGE->context, $pageparams);