From: hickert Date: Thu, 26 Aug 2010 08:11:28 +0000 (+0000) Subject: Added a new chart and prepared data for it X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9a77844da61d01129214688956fea84a04977175;p=gosa.git 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 --- 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();