Skip to content
Snippets Groups Projects
Commit 830ee556 authored by aydreeihn's avatar aydreeihn
Browse files

make sure dashboard stats dont include deleted topics/agents

parent b81e03bf
No related branches found
No related tags found
No related merge requests found
...@@ -211,9 +211,10 @@ class OverviewReport { ...@@ -211,9 +211,10 @@ class OverviewReport {
$headers = array(__('Help Topic')); $headers = array(__('Help Topic'));
$header = function($row) { return Topic::getLocalNameById($row['topic_id'], $row['topic__topic']); }; $header = function($row) { return Topic::getLocalNameById($row['topic_id'], $row['topic__topic']); };
$pk = 'topic_id'; $pk = 'topic_id';
$topics = Topic::getHelpTopics();
$stats = $stats $stats = $stats
->values('topic_id', 'topic__topic', 'topic__flags') ->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 $times = $times
->values('topic_id') ->values('topic_id')
->filter(array('topic_id__gt' => 0)); ->filter(array('topic_id__gt' => 0));
...@@ -223,7 +224,10 @@ class OverviewReport { ...@@ -223,7 +224,10 @@ class OverviewReport {
$header = function($row) { return new AgentsName(array( $header = function($row) { return new AgentsName(array(
'first' => $row['staff__firstname'], 'last' => $row['staff__lastname'])); }; 'first' => $row['staff__firstname'], 'last' => $row['staff__lastname'])); };
$pk = 'staff_id'; $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'); $times = $times->values('staff_id');
$depts = $thisstaff->getManagedDepartments(); $depts = $thisstaff->getManagedDepartments();
if ($thisstaff->hasPerm(ReportModel::PERM_AGENTS)) if ($thisstaff->hasPerm(ReportModel::PERM_AGENTS))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment