Code

Updated statistics plugin
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Aug 2010 14:21:44 +0000 (14:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Aug 2010 14:21:44 +0000 (14:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19398 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 6289cba6956958bc61ae5b7f998c5cc4b4426d1f..9badf61ecd343d4e10d260c14944534133b425a2 100644 (file)
@@ -132,37 +132,22 @@ class statistics extends plugin
                     // Build up DataSet. 
                     $DataSet2 = new pData;  
                     $intervalEntries = array();
-                    $max =0;
-                    foreach($res['actionsPerInterval'] as $id => $data){
-                        
-                        $category = $data['category'];
-                        $date =  $data['date'];
-                        $iDate =  strtotime($date);
-                        $count =  $data['count'];
-
+                    $max = 500;
+                    foreach($res['actionsPerInterval'] as $category => $dates){
                         if(!isset($mostUsedCategories[$category])) continue;
-                        $intervalEntries[$category][$date] = $count;
-                        if($data['count'] > $max) $max = $data['count'];
-                        $dates[$iDate]=$iDate;
-                    }
-                    
-                    foreach($intervalEntries as $category => $data){
-                        ksort($intervalEntries[$category]);
-                        $DataSet2->AddPoint($intervalEntries[$category], $category);
+                        ksort($res['actionsPerInterval'][$category]);
+                        $DataSet2->AddPoint($res['actionsPerInterval'][$category], $category);
                         $DataSet2->SetSerieName(_($category), $category);
                     }
-
                     $DataSet2->AddAllSeries();  
 
-                    $tmp = array();
-                    $cnt = 0;
-                    ksort($dates);
                     $Xam = 5;
-
-                    foreach($dates as $key => $date){
+                    $cnt =0;
+                    foreach($res['actionsPerIntervalDates'] as $key => $date){
+                        $date = strtotime($date);
                         if((count($dates) <= $Xam) || 
                             ($cnt % (floor(count($dates) / $Xam )) == 0)){
-                            $tmp[$date] = date('d.m.Y', $date);
+                            $tmp[$date] = date('d.m.Y',$date);
                         }else{
                             $tmp[$date] = ' ';
                         }