From: hickert Date: Mon, 16 Aug 2010 14:21:44 +0000 (+0000) Subject: Updated statistics plugin X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a515568a6184232105b6d231fd9f36d5e0289f15;p=gosa.git Updated statistics plugin git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19398 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 6289cba69..9badf61ec 100644 --- a/gosa-core/plugins/generic/statistics/class_statistics.inc +++ b/gosa-core/plugins/generic/statistics/class_statistics.inc @@ -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] = ' '; }