From: hickert Date: Tue, 24 Aug 2010 14:38:04 +0000 (+0000) Subject: Updated chart generation X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9fa641ad30a287c36d8c0604bd62173cdf8422b2;p=gosa.git Updated chart generation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19439 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/generic/statistics/graphClasses/class_categoryActionOverTime.inc b/gosa-core/plugins/generic/statistics/graphClasses/class_categoryActionOverTime.inc index 2fcae6a14..a82c3fa77 100644 --- a/gosa-core/plugins/generic/statistics/graphClasses/class_categoryActionOverTime.inc +++ b/gosa-core/plugins/generic/statistics/graphClasses/class_categoryActionOverTime.inc @@ -3,17 +3,12 @@ class categoryActionsOverTime extends statChart { var $title = 'Plugin usage over time'; - var $gID = 0; - - var $graphData = array(); - var $seriesList = array(); - - var $enableCaching = FALSE; + var $enableCaching = TRUE; function __construct(&$config) { parent::__construct($config); - $this->gID = get_class(); + $this->graphName = get_class(); } @@ -40,6 +35,14 @@ class categoryActionsOverTime extends statChart $seriesCnt ++; } + // Keep a list of all selecteable data-series, to allow the user to disable + // or enable series on demand. + $this->seriesList = array(); + foreach($gData['actionsPerInterval'] as $key => $data){ + $this->seriesList[$key] = $this->getCategoryTranslation($key); + } + $this->seriesList['errorsPerInterval'] = _("Error"); + // Create a dataSet containing all series $allSeriesDataSet = clone $dataSet; if(!in_array('errorsPerInterval', $this->skipSeries)){ @@ -118,14 +121,6 @@ class categoryActionsOverTime extends statChart session::set('statistics::graphFile'.$this->graphID,$file); $pCache->WriteToCache(get_class(),$allSeriesDataSet->GetData(),$chart); - // Keep a list of all selecteable data-series, to allow the user to disable - // or enable series on demand. - $this->seriesList = array(); - foreach($gData['actionsPerInterval'] as $key => $data){ - $this->seriesList[$key] = $this->getCategoryTranslation($key); - } - $this->seriesList['errorsPerInterval'] = _("Error"); - return; } diff --git a/gosa-core/plugins/generic/statistics/graphClasses/class_statChart.inc b/gosa-core/plugins/generic/statistics/graphClasses/class_statChart.inc index 3087bf361..fcbd6f17c 100644 --- a/gosa-core/plugins/generic/statistics/graphClasses/class_statChart.inc +++ b/gosa-core/plugins/generic/statistics/graphClasses/class_statChart.inc @@ -13,6 +13,10 @@ class statChart{ var $skipSeries = array(); + var $graphName = 0; + + var $seriesList = array(); + function __construct(&$config,$gData = array()) { $this->config = $config; @@ -74,12 +78,12 @@ class statChart{ function getSeriesSelector() { - $str = ""; + $str = ""; $list = $this->getSeriesList(); foreach($list as $key => $item){ $checked = (in_array($key, $this->skipSeries))? '': 'checked'; $str .= "". - " {$item}". " "; @@ -89,11 +93,12 @@ class statChart{ function save_object() { - if(!isset($_POST["{$this->gID}_posted"])) return; + if(!isset($_POST["{$this->graphName}_posted"])) return; // Get series to enable or disable + $this->skipSeries = array(); foreach($this->seriesList as $seriesName => $seriesDesc){ - if(!isset($_POST["addSeries_{$this->gID}_{$seriesName}"])){ + if(!isset($_POST["addSeries_{$this->graphName}_{$seriesName}"])){ $this->skipSeries[] = $seriesName; } }