From: hickert Date: Thu, 26 Aug 2010 06:21:38 +0000 (+0000) Subject: Updated statistics X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9e3d97f8593fa4b8bfc3f578d5c86b5fae6869c1;p=gosa.git Updated statistics - Fixed detect of unsubmitted stat files - Only create statistics class once per session. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19452 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/generic/statistics/chartClasses/class_memoryUsageChart.inc b/gosa-core/plugins/generic/statistics/chartClasses/class_memoryUsageChart.inc index 73b9ec42b..da16ec54e 100644 --- a/gosa-core/plugins/generic/statistics/chartClasses/class_memoryUsageChart.inc +++ b/gosa-core/plugins/generic/statistics/chartClasses/class_memoryUsageChart.inc @@ -37,8 +37,6 @@ class memoryUsageChart extends statChart $dataSet->AddPoint($this->graphData['dates'], 'date'); $dataSet->SetAbsciseLabelSerie('date'); - echo $this->enableCaching; - // Read graph from cache? $pCache = new pCache('/var/spool/gosa/'); if($this->enableCaching && $pCache->IsInCache(get_class(),$dataSet->GetData())){ diff --git a/gosa-core/plugins/generic/statistics/class_statistics.inc b/gosa-core/plugins/generic/statistics/class_statistics.inc index 0fe4889d9..e07941418 100644 --- a/gosa-core/plugins/generic/statistics/class_statistics.inc +++ b/gosa-core/plugins/generic/statistics/class_statistics.inc @@ -21,7 +21,7 @@ class statistics extends plugin var $graph1DatePicker2 = 0; // A collection of timestamps for unsubmitted statistics data. - var $unsbmittedFiles = array(); + var $unsbmittedFiles = NULL; var $graphs = array(); var $selectedGraphType = 0; @@ -53,9 +53,6 @@ class statistics extends plugin "WyukwauWoid2", TRUE); } - - // Get list of unsubmitted files. - $this->unsbmittedFiles = $this->getUnsubmittedStatistics(); } @@ -83,8 +80,12 @@ class statistics extends plugin */ function getUnsubmittedStatistics() { - $available = $this->getLocalStatisticsFiles(); $alreadyTransmitted = $this->getStatisticsDatesFromServer(); + if($alreadyTransmitted == NULL){ + return(NULL); + } + + $available = $this->getLocalStatisticsFiles(); $unsubmitted = array(); foreach($available as $key => $day){ @@ -113,6 +114,7 @@ class statistics extends plugin $dates = array(); if(!$this->rpcHandle->success()){ msg_dialog::display(_("Error"),msgPool::rpcError($this->rpcHandle->get_error()),ERROR_DIALOG); + return(NULL); }else{ foreach($res as $date){ $dates[$date] = strtotime($date); @@ -129,6 +131,11 @@ class statistics extends plugin $smarty->assign('graph1DatePicker1', $this->graph1DatePicker1); $smarty->assign('graph1DatePicker2', $this->graph1DatePicker2); + // Get list of unsubmitted files. + if($this->unsbmittedFiles == NULL){ + $this->unsbmittedFiles = $this->getUnsubmittedStatistics(); + } + // Do not render anything if we are not prepared to send and receive data via rpc. $smarty->assign("rpcConfigured", $this->rpcConfigured); $smarty->assign("validRpcHandle", TRUE); diff --git a/gosa-core/plugins/generic/statistics/main.inc b/gosa-core/plugins/generic/statistics/main.inc index ae48640d1..c82c84c92 100644 --- a/gosa-core/plugins/generic/statistics/main.inc +++ b/gosa-core/plugins/generic/statistics/main.inc @@ -30,7 +30,7 @@ if ($remove_lock){ /* Remove this plugin from session */ if ( $cleanup ){ - session::un_set('statistics'); + # session::un_set('statistics'); }else{