Browse Source

Fixed bug with auto filtering users on the Taking page based on active group (thanks Molten Bean)

MOODLE_23_STABLE
Artem Andreev 12 years ago
parent
commit
4a8622fab6
  1. 6
      renderables.php
  2. 3
      take.php

6
renderables.php

@ -257,10 +257,12 @@ class attforblock_take_data implements renderable {
private $att; private $att;
public function __construct(attforblock $att) { public function __construct(attforblock $att) {
if ($att->pageparams->grouptype) if ($att->pageparams->grouptype) {
$this->users = $att->get_users($att->pageparams->grouptype); $this->users = $att->get_users($att->pageparams->grouptype);
else }
else {
$this->users = $att->get_users($att->pageparams->group); $this->users = $att->get_users($att->pageparams->group);
}
$this->pageparams = $att->pageparams; $this->pageparams = $att->pageparams;
$this->perm = $att->perm; $this->perm = $att->perm;

3
take.php

@ -22,7 +22,6 @@ $pageparams = new att_take_page_params();
$id = required_param('id', PARAM_INT); $id = required_param('id', PARAM_INT);
$pageparams->sessionid = required_param('sessionid', PARAM_INT); $pageparams->sessionid = required_param('sessionid', PARAM_INT);
$pageparams->grouptype = required_param('grouptype', 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->sort = optional_param('sort', null, PARAM_INT);
$pageparams->copyfrom = optional_param('copyfrom', null, PARAM_INT); $pageparams->copyfrom = optional_param('copyfrom', null, PARAM_INT);
$pageparams->viewmode = optional_param('viewmode', 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); require_login($course, true, $cm);
$pageparams->group = groups_get_activity_group($cm, true);
$pageparams->init($course->id); $pageparams->init($course->id);
$att = new attforblock($att, $cm, $course, $PAGE->context, $pageparams); $att = new attforblock($att, $cm, $course, $PAGE->context, $pageparams);

Loading…
Cancel
Save