Browse Source

Better fix for Fix #72

MOODLE_28_STABLE
Dan Marsden 10 years ago
parent
commit
b32cd8703c
  1. 7
      locallib.php
  2. 2
      renderables.php

7
locallib.php

@ -697,7 +697,7 @@ class attendance {
return $DB->count_records_select('attendance_sessions', $where, $params);
}
public function get_filtered_sessions($filtergroups = true) {
public function get_filtered_sessions() {
global $DB;
if ($this->pageparams->startdate && $this->pageparams->enddate) {
@ -707,8 +707,9 @@ class attendance {
} else {
$where = "attendanceid = :aid AND sessdate >= :csdate";
}
if ($filtergroups && $this->pageparams->get_current_sesstype() > att_page_with_filter_controls::SESSTYPE_ALL) {
$where .= " AND groupid=:cgroup";
if ($this->pageparams->get_current_sesstype() > att_page_with_filter_controls::SESSTYPE_ALL) {
$where .= " AND (groupid = :cgroup OR groupid = 0)";
}
$params = array(
'aid' => $this->id,

2
renderables.php

@ -475,7 +475,7 @@ class attendance_report_data implements renderable {
$this->groups = groups_get_all_groups($att->course->id);
$this->sessions = $att->get_filtered_sessions(false);
$this->sessions = $att->get_filtered_sessions();
$this->statuses = $att->get_statuses();
$this->allstatuses = $att->get_statuses(false);

Loading…
Cancel
Save