From 9a77844da61d01129214688956fea84a04977175 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 26 Aug 2010 08:11:28 +0000 Subject: [PATCH] Added a new chart and prepared data for it git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19455 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../generic/statistics/class_statistics.inc | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gosa-core/plugins/generic/statistics/class_statistics.inc b/gosa-core/plugins/generic/statistics/class_statistics.inc index b685c0953..85658dc7b 100644 --- a/gosa-core/plugins/generic/statistics/class_statistics.inc +++ b/gosa-core/plugins/generic/statistics/class_statistics.inc @@ -36,6 +36,7 @@ class statistics extends plugin $this->graphs[] = new renderTimeChart($config); $this->graphs[] = new durationTimeChart($config); $this->graphs[] = new objectCountChart($config); + $this->graphs[] = new actionSelectChart($config); $this->staticChart1 = new pieChart1($config); $this->staticChart2 = new pieChart2($config); @@ -275,6 +276,31 @@ class statistics extends plugin ksort($gData['actionsPerInterval'][$category]); } + /* Prepare actions-per-interval array. + */ + $gData['actionsAndCategoryPerInterval'] = array(); + foreach($res['actionsAndCategoryPerInterval'] as $action => $aData){ + foreach($aData as $category => $data){ + if(empty($category)) continue; + + $list = preg_split("/, /", $category); + if(count(array_intersect($mapSystems, $list))){ + $category = 'systems'; + } + + // Add missing date stamps + foreach($gData['dates'] as $timestamp => $value){ + $gData['actionsAndCategoryPerInterval'][$action][$category][$timestamp]=0; + } + + foreach($data as $dateStr => $count){ + $date = strtotime($dateStr); + $gData['actionsAndCategoryPerInterval'][$action][$category][$date]=$count; + } + ksort($gData['actionsAndCategoryPerInterval'][$action][$category]); + } + } + /* Prepare object count per interval array. */ $gData['objectCountPerInterval'] = array(); -- 2.30.2