From 69b178885c75146e0ee57e099aa5121b60093656 Mon Sep 17 00:00:00 2001 From: aydreeihn <adriane@enhancesoft.com> Date: Mon, 11 Jun 2018 15:17:30 -0500 Subject: [PATCH] filter service/response time by date range chosen --- include/class.report.php | 3 +++ include/staff/dashboard.inc.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/class.report.php b/include/class.report.php index c39ec47cc..12d7322d3 100644 --- a/include/class.report.php +++ b/include/class.report.php @@ -153,6 +153,9 @@ class OverviewReport { 'annulled' => 0, ), )) + ->filter(array( + 'timestamp__range' => array($start, $stop, true), + )) ->aggregate(array( 'ServiceTime' => SqlAggregate::AVG(SqlFunction::timestampdiff( new SqlCode('HOUR'), new SqlField('thread__events__timestamp'), new SqlField('timestamp')) diff --git a/include/staff/dashboard.inc.php b/include/staff/dashboard.inc.php index 8bf119595..3c91e3c5f 100644 --- a/include/staff/dashboard.inc.php +++ b/include/staff/dashboard.inc.php @@ -75,11 +75,11 @@ $plots = $report->getPlotData(); $date = str_ireplace('FROM_UNIXTIME(', '',$date); $date = str_ireplace(')', '',$date); $date = new DateTime('@'.$date); - if ($thisstaff->getTimezone()) - $date->setTimeZone(new DateTimeZone($thisstaff->getTimezone())); + $date->setTimeZone(new DateTimeZone($cfg->getTimezone())); + $timezone = $date->format('e'); $range[] = $date->format('F j, Y'); } - echo __($range[0] . ' - ' . $range[1]); + echo __($range[0] . ' - ' . $range[1] . ' (' . Format::timezone($timezone) . ')'); ?> <ul class="clean tabs"> -- GitLab