Code

Added a new chart and prepared data for it
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 26 Aug 2010 08:11:28 +0000 (08:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 26 Aug 2010 08:11:28 +0000 (08:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19455 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/generic/statistics/class_statistics.inc

index b685c0953f1695f434652c3e4d34dce746ca7235..85658dc7bbacfa28955e77fb0837866f52666775 100644 (file)
@@ -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();