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) {
} 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,
$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);