From 5a777fb702c0b5ccda6bdef6e7a7ea488fecfcc3 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Mon, 10 Dec 2012 12:17:19 -0500
Subject: [PATCH] Show expanded staff report IF staff is allowed

---
 include/ajax.reports.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/ajax.reports.php b/include/ajax.reports.php
index 0ad0640a3..bf8637405 100644
--- a/include/ajax.reports.php
+++ b/include/ajax.reports.php
@@ -80,6 +80,8 @@ class OverviewReportAjaxAPI extends AjaxController {
                       (T1.staff_id='.db_input($thisstaff->getId())
                         .(($depts=$thisstaff->getManagedDepartments())?
                             (' OR T1.dept_id IN('.implode(',', db_input($depts)).')'):'')
+                        .(($thisstaff->canViewStaffStats())?
+                            (' OR T1.dept_id IN('.implode(',', db_input($thisstaff->getDepts())).')'):'')
                      .')'
                      ) 
             )
-- 
GitLab