Index: branches/5.3.x/core/units/statistics/statistics_tag_processor.php =================================================================== diff -u -N -r15483 -r15698 --- branches/5.3.x/core/units/statistics/statistics_tag_processor.php (.../statistics_tag_processor.php) (revision 15483) +++ branches/5.3.x/core/units/statistics/statistics_tag_processor.php (.../statistics_tag_processor.php) (revision 15698) @@ -1,6 +1,6 @@ Application->getCache($cache_key); if ($value === false) { - $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo'); + $config = $this->Application->getUnitConfig($prefix); + $statistics_info = $this->_getPendingStatisticsInfo($prefix); + if (!$statistics_info) { return 0; } - $table = $this->Application->getUnitOption($prefix, 'TableName'); - $status_field = array_shift( $this->Application->getUnitOption($prefix, 'StatusField') ); + $status_field = $config->getStatusField(true); $this->Conn->nextQueryCachable = true; $sql = 'SELECT COUNT(*) - FROM '.$table.' + FROM '. $config->getTableName() .' WHERE '.$status_field.' = '.$statistics_info['status']; $value = $this->Conn->GetOne($sql); $this->Application->setCache($cache_key, $value); @@ -237,6 +238,20 @@ return $value; } + /** + * Returns pending statistics info + * + * @param string $prefix + * @return string + * @access protected + */ + protected function _getPendingStatisticsInfo($prefix) + { + $config = $this->Application->getUnitConfig($prefix); + + return getArrayValue($config->getStatisticsInfo(), 'pending'); + } + function GetTotalPending() { $prefixes = $this->getPendingPrefixes(); @@ -293,7 +308,7 @@ $prefixes = Array(); foreach ($check_prefixes as $prefix) { - $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo'); + $statistics_info = $this->_getPendingStatisticsInfo($prefix); if ($statistics_info) { $prefixes[] = $prefix; } @@ -303,7 +318,7 @@ foreach ($prefixes as $i => $prefix) { $block_params['prefix'] = $prefix; - $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo'); + $statistics_info = $this->_getPendingStatisticsInfo($prefix); if ($i % $columns == 0) { $column_number = 1;