Skip to content
Snippets Groups Projects
Unverified Commit 7fc0c971 authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4585 from aydreeihn/issue/dashboard-stats

Dashboard Statistics Issue
parents 12176a1b 51a6504f
No related branches found
No related tags found
No related merge requests found
...@@ -219,7 +219,8 @@ class OverviewReport { ...@@ -219,7 +219,8 @@ class OverviewReport {
->distinct('dept__id'); ->distinct('dept__id');
$times = $times $times = $times
->filter(array('dept_id__in' => $thisstaff->getDepts())) ->filter(array('dept_id__in' => $thisstaff->getDepts()))
->values('dept__id'); ->values('dept__id')
->distinct('dept__id');
break; break;
case 'topic': case 'topic':
$headers = array(__('Help Topic')); $headers = array(__('Help Topic'));
...@@ -232,7 +233,8 @@ class OverviewReport { ...@@ -232,7 +233,8 @@ class OverviewReport {
->distinct('topic_id'); ->distinct('topic_id');
$times = $times $times = $times
->values('topic_id') ->values('topic_id')
->filter(array('topic_id__gt' => 0)); ->filter(array('topic_id__gt' => 0))
->distinct('topic_id');
break; break;
case 'staff': case 'staff':
$headers = array(__('Agent')); $headers = array(__('Agent'));
...@@ -244,7 +246,7 @@ class OverviewReport { ...@@ -244,7 +246,7 @@ class OverviewReport {
->values('staff_id', 'staff__firstname', 'staff__lastname') ->values('staff_id', 'staff__firstname', 'staff__lastname')
->filter(array('staff_id__in' => array_keys($staff))) ->filter(array('staff_id__in' => array_keys($staff)))
->distinct('staff_id'); ->distinct('staff_id');
$times = $times->values('staff_id'); $times = $times->values('staff_id')->distinct('staff_id');
$depts = $thisstaff->getManagedDepartments(); $depts = $thisstaff->getManagedDepartments();
if ($thisstaff->hasPerm(ReportModel::PERM_AGENTS)) if ($thisstaff->hasPerm(ReportModel::PERM_AGENTS))
$depts = array_merge($depts, $thisstaff->getDepts()); $depts = array_merge($depts, $thisstaff->getDepts());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment