Revert "* Fix metric scope order in config."
This reverts commit b0c102d42d.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
$config->metric = new stdclass();
|
||||
$config->metric->scopeList = array('system', 'program', 'product', 'project', 'execution', 'dept', 'user', 'code', 'pipeline');
|
||||
$config->metric->scopeList = array('system', 'program', 'project', 'execution', 'product', 'user', 'dept');
|
||||
$config->metric->objectList = array('program', 'line', 'product', 'project', 'productplan', 'execution', 'release', 'story', 'requirement', 'task', 'bug', 'case', 'user', 'effort', 'doc', 'feedback', 'risk', 'issue', 'review');
|
||||
$config->metric->purposeList = array('scale', 'qc', 'hour', 'cost', 'rate', 'time');
|
||||
$config->metric->dateList = array('year', 'month', 'week', 'day');
|
||||
|
||||
@@ -271,16 +271,11 @@ class metricModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getScopePairs($all = true)
|
||||
public function getScopePairs()
|
||||
{
|
||||
$scopePairs = array();
|
||||
foreach($this->config->metric->scopeList as $scope)
|
||||
{
|
||||
if(!$all)
|
||||
{
|
||||
$metrics = $this->metricTao->fetchMetricsByScope($scope, 1);
|
||||
if(empty($metrics)) continue;
|
||||
}
|
||||
$scopePair = new stdclass();
|
||||
$scopePair->value = $scope;
|
||||
$scopePair->label = $this->lang->metric->scopeList[$scope];
|
||||
@@ -1091,7 +1086,7 @@ class metricModel extends model
|
||||
{
|
||||
foreach($this->lang->metric->scopeList as $scope => $name)
|
||||
{
|
||||
$metrics = $this->metricTao->fetchMetricsByScope($scope, 1);
|
||||
$metrics = $this->metricTao->fetchMetrics($scope, $stage);
|
||||
if(empty($metrics))
|
||||
{
|
||||
unset($this->lang->metric->scopeList[$scope]);
|
||||
|
||||
@@ -43,27 +43,6 @@ class metricTao extends metricModel
|
||||
return $metrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据范围获取度量项。
|
||||
* Fetch metric by scope.
|
||||
*
|
||||
* @param string $scope
|
||||
* @param int $limit
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function fetchMetricsByScope($scope, $limit = -1)
|
||||
{
|
||||
$metrics = $this->dao->select('*')->from(TABLE_METRIC)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere('scope')->eq($scope)
|
||||
->andWhere('object')->in(array_keys($this->lang->metric->objectList))
|
||||
->beginIF($limit > 0)->limit($limit)->fi()
|
||||
->fetchAll();
|
||||
|
||||
return $metrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编号获取度项。
|
||||
* Fetch metric by id.
|
||||
|
||||
@@ -200,7 +200,7 @@ class screen extends control
|
||||
$data->treeData = $this->screen->getTreeData($dimensions);
|
||||
$data->dimensions = $dimensions;
|
||||
$data->dimension = $screen->dimension;
|
||||
$data->scopeList = $this->loadModel('metric')->getScopePairs(false);
|
||||
$data->scopeList = $this->loadModel('metric')->getScopePairs();
|
||||
$data->scope = 'system';
|
||||
$data->fieldConfig = $this->screen->getTreeSelectOptions();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user