diff --git a/include/class.report.php b/include/class.report.php index 999ae22fe0ac6c6e12a70edbb1bf6fc340f2611c..5e1ac94b97f52c3c8b5f5efb50ffa06e841c3737 100644 --- a/include/class.report.php +++ b/include/class.report.php @@ -211,9 +211,10 @@ class OverviewReport { $headers = array(__('Help Topic')); $header = function($row) { return Topic::getLocalNameById($row['topic_id'], $row['topic__topic']); }; $pk = 'topic_id'; + $topics = Topic::getHelpTopics(); $stats = $stats ->values('topic_id', 'topic__topic', 'topic__flags') - ->filter(array('dept_id__in' => $thisstaff->getDepts(), 'topic_id__gt' => 0)); + ->filter(array('dept_id__in' => $thisstaff->getDepts(), 'topic_id__gt' => 0, 'topic_id__in' => array_keys($topics))); $times = $times ->values('topic_id') ->filter(array('topic_id__gt' => 0)); @@ -223,7 +224,10 @@ class OverviewReport { $header = function($row) { return new AgentsName(array( 'first' => $row['staff__firstname'], 'last' => $row['staff__lastname'])); }; $pk = 'staff_id'; - $stats = $stats->values('staff_id', 'staff__firstname', 'staff__lastname'); + $staff = Staff::getStaffMembers(); + $stats = $stats + ->values('staff_id', 'staff__firstname', 'staff__lastname') + ->filter(array('staff_id__in' => array_keys($staff))); $times = $times->values('staff_id'); $depts = $thisstaff->getManagedDepartments(); if ($thisstaff->hasPerm(ReportModel::PERM_AGENTS))