diff --git a/module/metric/calc/execution/hour/consume_of_devel_task_in_execution.php b/module/metric/calc/execution/hour/consume_of_devel_task_in_execution.php index a98a8eea2c..1403f821c2 100644 --- a/module/metric/calc/execution/hour/consume_of_devel_task_in_execution.php +++ b/module/metric/calc/execution/hour/consume_of_devel_task_in_execution.php @@ -24,11 +24,11 @@ class consume_of_devel_task_in_execution extends baseCalc public $dataset = 'getTasks'; - public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.type'); + public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.type', 't1.isParent'); public function calculate($row) { - if($row->parent == '-1' || $row->type != 'devel') return; + if($row->isParent == '1' || $row->type != 'devel') return; if(!isset($this->result[$row->execution])) $this->result[$row->execution] = 0; $this->result[$row->execution] += $row->consumed; } diff --git a/module/metric/calc/execution/hour/consume_of_frombug_task_in_execution.php b/module/metric/calc/execution/hour/consume_of_frombug_task_in_execution.php index c71bd3257c..127dc0e4c8 100644 --- a/module/metric/calc/execution/hour/consume_of_frombug_task_in_execution.php +++ b/module/metric/calc/execution/hour/consume_of_frombug_task_in_execution.php @@ -24,11 +24,11 @@ class consume_of_frombug_task_in_execution extends baseCalc public $dataset = 'getTasks'; - public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.fromBug'); + public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.fromBug', 't1.isParent'); public function calculate($row) { - if($row->parent == '-1') return; + if($row->isParent == '1') return; if($row->parent == '0' && $row->fromBug == 0) return; if(!isset($this->result[$row->execution])) $this->result[$row->execution] = 0; diff --git a/module/metric/calc/execution/hour/consume_of_task_in_execution.php b/module/metric/calc/execution/hour/consume_of_task_in_execution.php index b53d7377e7..d1398a6560 100755 --- a/module/metric/calc/execution/hour/consume_of_task_in_execution.php +++ b/module/metric/calc/execution/hour/consume_of_task_in_execution.php @@ -22,14 +22,13 @@ class consume_of_task_in_execution extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.execution', 't1.consumed', 't1.parent'); + public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return; + if($row->isParent == '1') return; if(!isset($this->result[$row->execution])) $this->result[$row->execution] = 0; $this->result[$row->execution] += $row->consumed; diff --git a/module/metric/calc/execution/hour/consume_of_test_task_in_execution.php b/module/metric/calc/execution/hour/consume_of_test_task_in_execution.php index a3d67c6d38..f217a41b55 100644 --- a/module/metric/calc/execution/hour/consume_of_test_task_in_execution.php +++ b/module/metric/calc/execution/hour/consume_of_test_task_in_execution.php @@ -24,11 +24,11 @@ class consume_of_test_task_in_execution extends baseCalc public $dataset = 'getTasks'; - public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.type'); + public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.type', 't1.isParent'); public function calculate($row) { - if($row->parent == '-1' || $row->type != 'test') return; + if($row->isParent == '1' || $row->type != 'test') return; if(!isset($this->result[$row->execution])) $this->result[$row->execution] = 0; $this->result[$row->execution] += $row->consumed; diff --git a/module/metric/calc/execution/hour/estimate_of_task_in_execution.php b/module/metric/calc/execution/hour/estimate_of_task_in_execution.php index 19b986af1d..5bacf605f8 100755 --- a/module/metric/calc/execution/hour/estimate_of_task_in_execution.php +++ b/module/metric/calc/execution/hour/estimate_of_task_in_execution.php @@ -22,16 +22,13 @@ class estimate_of_task_in_execution extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.execution', 't1.estimate', 't1.parent', 't1.status'); + public $fieldList = array('t1.execution', 't1.estimate', 't1.parent', 't1.status', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - $status = $row->status; - - if($parent == '-1' || $status == 'cancel') return false; + if($row->isParent == '1' || $row->status == 'cancel') return false; if(!isset($this->result[$row->execution])) $this->result[$row->execution] = 0; $this->result[$row->execution] += $row->estimate; diff --git a/module/metric/calc/execution/hour/left_of_task_in_execution.php b/module/metric/calc/execution/hour/left_of_task_in_execution.php index 66ba232034..3bd3e2d5f2 100755 --- a/module/metric/calc/execution/hour/left_of_task_in_execution.php +++ b/module/metric/calc/execution/hour/left_of_task_in_execution.php @@ -22,16 +22,13 @@ class left_of_task_in_execution extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.execution', 't1.left', 't1.parent', 't1.status'); + public $fieldList = array('t1.execution', 't1.left', 't1.parent', 't1.status', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - $status = $row->status; - - if($parent == '-1' || $status == 'cancel') return false; + if($row->isParent == '1' || $row->status == 'cancel' || $row->status == 'closed') return false; if(!isset($this->result[$row->execution])) $this->result[$row->execution] = 0; $this->result[$row->execution] += $row->left; diff --git a/module/metric/calc/execution/rate/consume_rate_of_frombug_task_in_execution.php b/module/metric/calc/execution/rate/consume_rate_of_frombug_task_in_execution.php index f0a4838982..5a67a66d32 100644 --- a/module/metric/calc/execution/rate/consume_rate_of_frombug_task_in_execution.php +++ b/module/metric/calc/execution/rate/consume_rate_of_frombug_task_in_execution.php @@ -24,11 +24,11 @@ class consume_rate_of_frombug_task_in_execution extends baseCalc public $dataset = 'getTasks'; - public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.fromBug'); + public $fieldList = array('t1.execution', 't1.consumed', 't1.parent', 't1.fromBug', 't1.isParent'); public function calculate($row) { - if($row->parent == '-1') return; + if($row->isParent == '1') return; if(!isset($this->result[$row->execution])) $this->result[$row->execution] = array('fromBug' => 0, 'total' => 0); diff --git a/module/metric/calc/execution/scale/scale_of_story_in_execution.php b/module/metric/calc/execution/scale/scale_of_story_in_execution.php index 17e548c721..4b429650e9 100644 --- a/module/metric/calc/execution/scale/scale_of_story_in_execution.php +++ b/module/metric/calc/execution/scale/scale_of_story_in_execution.php @@ -28,7 +28,7 @@ class scale_of_story_in_execution extends baseCalc public function calculate($row) { - if($row->isParent == 1) return; + if($row->isParent == '1') return; if(!isset($this->result[$row->project])) $this->result[$row->project] = 0; $this->result[$row->project] += $row->estimate; } diff --git a/module/metric/calc/product/scale/scale_of_annual_closed_story_in_product.php b/module/metric/calc/product/scale/scale_of_annual_closed_story_in_product.php index 3e2f6942df..9eb40bf0f0 100755 --- a/module/metric/calc/product/scale/scale_of_annual_closed_story_in_product.php +++ b/module/metric/calc/product/scale/scale_of_annual_closed_story_in_product.php @@ -22,7 +22,7 @@ class scale_of_annual_closed_story_in_product extends baseCalc { public $dataset = 'getDevStories'; - public $fieldList = array('t1.product', 't1.closedDate', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.product', 't1.closedDate', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); @@ -31,9 +31,8 @@ class scale_of_annual_closed_story_in_product extends baseCalc $product = $data->product; $closedDate = $data->closedDate; $estimate = $data->estimate; - $parent = $data->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; $year = $this->getYear($closedDate); if(!$year) return false; @@ -49,10 +48,7 @@ class scale_of_annual_closed_story_in_product extends baseCalc $records = array(); foreach($this->result as $product => $years) { - foreach($years as $year => $value) - { - $records[] = array('product' => $product, 'year' => $year, 'value' => $value); - } + foreach($years as $year => $value) $records[] = array('product' => $product, 'year' => $year, 'value' => $value); } return $this->filterByOptions($records, $options); diff --git a/module/metric/calc/product/scale/scale_of_annual_delivered_story_in_product.php b/module/metric/calc/product/scale/scale_of_annual_delivered_story_in_product.php index 5a810b7fce..ef82571c58 100755 --- a/module/metric/calc/product/scale/scale_of_annual_delivered_story_in_product.php +++ b/module/metric/calc/product/scale/scale_of_annual_delivered_story_in_product.php @@ -22,7 +22,7 @@ class scale_of_annual_delivered_story_in_product extends baseCalc { public $dataset = 'getDevStories'; - public $fieldList = array('t1.product', 't1.stage', 't1.releasedDate', 't1.closedReason', 't1.closedDate', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.product', 't1.stage', 't1.releasedDate', 't1.closedReason', 't1.closedDate', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); @@ -34,9 +34,8 @@ class scale_of_annual_delivered_story_in_product extends baseCalc $closedReason = $row->closedReason; $closedDate = $row->closedDate; $estimate = $row->estimate; - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; $year = null; if($stage == 'released') diff --git a/module/metric/calc/product/scale/scale_of_annual_finished_story_in_product.php b/module/metric/calc/product/scale/scale_of_annual_finished_story_in_product.php index 43c054ad7e..c1ea5b5f8c 100755 --- a/module/metric/calc/product/scale/scale_of_annual_finished_story_in_product.php +++ b/module/metric/calc/product/scale/scale_of_annual_finished_story_in_product.php @@ -22,7 +22,7 @@ class scale_of_annual_finished_story_in_product extends baseCalc { public $dataset = 'getDevStories'; - public $fieldList = array('t1.product', 't1.closedDate', 't1.closedReason', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.product', 't1.closedDate', 't1.closedReason', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); @@ -32,9 +32,8 @@ class scale_of_annual_finished_story_in_product extends baseCalc $closedDate = $data->closedDate; $closedReason = $data->closedReason; $estimate = $data->estimate; - $parent = $data->parent; - if($parent == '-1') return false; + if($data->isParent == '1') return false; $year = $this->getYear($closedDate); if(!$year) return false; diff --git a/module/metric/calc/product/scale/scale_of_monthly_finished_story_in_product.php b/module/metric/calc/product/scale/scale_of_monthly_finished_story_in_product.php index bc44416ea8..9a05ff9556 100755 --- a/module/metric/calc/product/scale/scale_of_monthly_finished_story_in_product.php +++ b/module/metric/calc/product/scale/scale_of_monthly_finished_story_in_product.php @@ -22,7 +22,7 @@ class scale_of_monthly_finished_story_in_product extends baseCalc { public $dataset = 'getDevStories'; - public $fieldList = array('t1.product', 't1.closedDate', 't1.closedReason', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.product', 't1.closedDate', 't1.closedReason', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); @@ -32,10 +32,8 @@ class scale_of_monthly_finished_story_in_product extends baseCalc $closedDate = $data->closedDate; $closedReason = $data->closedReason; $estimate = $data->estimate; - $parent = $data->parent; - - if($parent == '-1') return false; + if($row->isParent == '1') return false; if($closedReason != 'done') return false; $year = $this->getYear($closedDate); diff --git a/module/metric/calc/product/scale/scale_of_story_in_product.php b/module/metric/calc/product/scale/scale_of_story_in_product.php index f269c6be39..56ad5fd7a8 100755 --- a/module/metric/calc/product/scale/scale_of_story_in_product.php +++ b/module/metric/calc/product/scale/scale_of_story_in_product.php @@ -22,7 +22,7 @@ class scale_of_story_in_product extends baseCalc { public $dataset = 'getDevStories'; - public $fieldList = array('t1.product', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.product', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); @@ -30,9 +30,8 @@ class scale_of_story_in_product extends baseCalc { $product = $data->product; $estimate = $data->estimate; - $parent = $data->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; if(!isset($this->result[$product])) $this->result[$product] = 0; diff --git a/module/metric/calc/project/hour/consume_of_task_in_project.php b/module/metric/calc/project/hour/consume_of_task_in_project.php index 5de21491fc..f491ca92e6 100755 --- a/module/metric/calc/project/hour/consume_of_task_in_project.php +++ b/module/metric/calc/project/hour/consume_of_task_in_project.php @@ -22,14 +22,13 @@ class consume_of_task_in_project extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.consumed', 't1.project', 't1.parent'); + public $fieldList = array('t1.consumed', 't1.project', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return; + if($row->isParent == '1') return; if(!isset($this->result[$row->project])) $this->result[$row->project] = 0; $this->result[$row->project] += $row->consumed; diff --git a/module/metric/calc/project/hour/estimate_of_task_in_project.php b/module/metric/calc/project/hour/estimate_of_task_in_project.php index f8cba31c0c..3c400729bb 100755 --- a/module/metric/calc/project/hour/estimate_of_task_in_project.php +++ b/module/metric/calc/project/hour/estimate_of_task_in_project.php @@ -22,16 +22,13 @@ class estimate_of_task_in_project extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.estimate', 't1.project', 't1.parent', 't1.status'); + public $fieldList = array('t1.estimate', 't1.project', 't1.parent', 't1.status', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - $status = $row->status; - - if($parent == '-1' || $status == 'cancel') return false; + if($row->isParent == '1' || $row->status == 'cancel') return false; if(!isset($this->result[$row->project])) $this->result[$row->project] = 0; $this->result[$row->project] += $row->estimate; diff --git a/module/metric/calc/project/hour/left_of_task_in_project.php b/module/metric/calc/project/hour/left_of_task_in_project.php index 766a53697d..de4de9a200 100755 --- a/module/metric/calc/project/hour/left_of_task_in_project.php +++ b/module/metric/calc/project/hour/left_of_task_in_project.php @@ -22,16 +22,13 @@ class left_of_task_in_project extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.left', 't1.project', 't1.parent', 't1.status'); + public $fieldList = array('t1.left', 't1.project', 't1.parent', 't1.status', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - $status = $row->status; - - if($parent == '-1' || $status == 'cancel') return false; + if($row->isParent == '1' || $row->status == 'cancel' || $row->status == 'closed') return false; if(!isset($this->result[$row->project])) $this->result[$row->project] = 0; $this->result[$row->project] += $row->left; diff --git a/module/metric/calc/project/scale/scale_of_annual_finished_story_in_project.php b/module/metric/calc/project/scale/scale_of_annual_finished_story_in_project.php index db3cc0ac5b..16b9643fed 100755 --- a/module/metric/calc/project/scale/scale_of_annual_finished_story_in_project.php +++ b/module/metric/calc/project/scale/scale_of_annual_finished_story_in_project.php @@ -22,7 +22,7 @@ class scale_of_annual_finished_story_in_project extends baseCalc { public $dataset = 'getDevStoriesWithProject'; - public $fieldList = array('t3.project', 't1.closedDate', 't1.closedReason', 't1.estimate', 't1.parent'); + public $fieldList = array('t3.project', 't1.closedDate', 't1.closedReason', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); @@ -30,9 +30,8 @@ class scale_of_annual_finished_story_in_project extends baseCalc { $project = $row->project; $closedDate = $row->closedDate; - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; $year = $this->getYear($closedDate); if(!$year) return false; diff --git a/module/metric/calc/system/hour/consume_of_task.php b/module/metric/calc/system/hour/consume_of_task.php index 692d061915..371617fb70 100755 --- a/module/metric/calc/system/hour/consume_of_task.php +++ b/module/metric/calc/system/hour/consume_of_task.php @@ -22,15 +22,13 @@ class consume_of_task extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.consumed', 't1.parent'); + public $fieldList = array('t1.consumed', 't1.parent', 't1.isParent'); public $result = 0; public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; - + if($row->isParent == '1') return false; if(empty($row->consumed)) return false; $this->result += $row->consumed; diff --git a/module/metric/calc/system/hour/estimate_of_annual_closed_project.php b/module/metric/calc/system/hour/estimate_of_annual_closed_project.php index b303f6f4f5..2f04b953c7 100755 --- a/module/metric/calc/system/hour/estimate_of_annual_closed_project.php +++ b/module/metric/calc/system/hour/estimate_of_annual_closed_project.php @@ -22,18 +22,14 @@ class estimate_of_annual_closed_project extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.estimate', 't1.parent', 't3.status', 't3.closedDate', 't1.parent', 't2.status'); + public $fieldList = array('t1.estimate', 't1.parent', 't1.status', 't1.isParent', 't3.status AS projectStatus', 't3.closedDate'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - $status = $row->status; - - if($parent == '-1' || $status == 'cancel') return false; - - if($row->status != 'closed' || empty($row->closedDate) || $row->parent == -1) return false; + if($row->isParent == '1' || $row->status == 'cancel') return false; + if($row->projectStatus != 'closed' || empty($row->closedDate)) return false; $year = $this->getYear($row->closedDate); diff --git a/module/metric/calc/system/hour/estimate_of_task.php b/module/metric/calc/system/hour/estimate_of_task.php index 3be2168f81..a4ae34d97c 100755 --- a/module/metric/calc/system/hour/estimate_of_task.php +++ b/module/metric/calc/system/hour/estimate_of_task.php @@ -22,15 +22,13 @@ class estimate_of_task extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.estimate', 't1.parent'); + public $fieldList = array('t1.estimate', 't1.parent', 't1.isParent'); public $result = 0; public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; - + if($row->isParent == '1') return false; if(empty($row->estimate)) return false; $this->result += $row->estimate; diff --git a/module/metric/calc/system/hour/left_of_task.php b/module/metric/calc/system/hour/left_of_task.php index 9848410957..e0d1b75149 100755 --- a/module/metric/calc/system/hour/left_of_task.php +++ b/module/metric/calc/system/hour/left_of_task.php @@ -22,15 +22,13 @@ class left_of_task extends baseCalc { public $dataset = 'getTasks'; - public $fieldList = array('t1.left', 't1.parent'); + public $fieldList = array('t1.left', 't1.parent', 't1.isParent'); public $result = 0; public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; - + if($row->isParent == '1') return false; if(empty($row->left)) return false; $this->result += $row->left; diff --git a/module/metric/calc/system/scale/scale_of_annual_closed_story.php b/module/metric/calc/system/scale/scale_of_annual_closed_story.php index 76e9a132f7..b442f127fa 100755 --- a/module/metric/calc/system/scale/scale_of_annual_closed_story.php +++ b/module/metric/calc/system/scale/scale_of_annual_closed_story.php @@ -22,14 +22,13 @@ class scale_of_annual_closed_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.estimate', 't1.status', 't1.closedDate', 't1.parent'); + public $fieldList = array('t1.estimate', 't1.status', 't1.closedDate', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; if(empty($row->closedDate) or !isset($row->estimate)) return false; diff --git a/module/metric/calc/system/scale/scale_of_annual_delivered_story.php b/module/metric/calc/system/scale/scale_of_annual_delivered_story.php index 603a56e834..35ddd52a18 100755 --- a/module/metric/calc/system/scale/scale_of_annual_delivered_story.php +++ b/module/metric/calc/system/scale/scale_of_annual_delivered_story.php @@ -22,14 +22,13 @@ class scale_of_annual_delivered_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.stage', 't1.releasedDate', 't1.closedReason', 't1.closedDate', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.stage', 't1.releasedDate', 't1.closedReason', 't1.closedDate', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; $date = null; if($row->closedReason == 'done') $date = $row->closedDate; diff --git a/module/metric/calc/system/scale/scale_of_annual_finished_story.php b/module/metric/calc/system/scale/scale_of_annual_finished_story.php index 3aabf6d10e..8cc0b8299b 100755 --- a/module/metric/calc/system/scale/scale_of_annual_finished_story.php +++ b/module/metric/calc/system/scale/scale_of_annual_finished_story.php @@ -22,14 +22,13 @@ class scale_of_annual_finished_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.estimate', 't1.status', 't1.closedDate', 't1.closedReason', 't1.parent'); + public $fieldList = array('t1.estimate', 't1.status', 't1.closedDate', 't1.closedReason', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; if(empty($row->closedDate) or !isset($row->estimate)) return false; diff --git a/module/metric/calc/system/scale/scale_of_finished_story.php b/module/metric/calc/system/scale/scale_of_finished_story.php index aba40481bc..82821c462c 100755 --- a/module/metric/calc/system/scale/scale_of_finished_story.php +++ b/module/metric/calc/system/scale/scale_of_finished_story.php @@ -22,15 +22,13 @@ class scale_of_finished_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.estimate', 't1.closedReason', 't1.parent'); + public $fieldList = array('t1.estimate', 't1.closedReason', 't1.parent', 't1.isParent'); public $result = 0; public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; - + if($row->isParent == '1') return false; if(empty($row->estimate)) return null; if($row->closedReason == 'done') $this->result += $row->estimate; diff --git a/module/metric/calc/system/scale/scale_of_invalid_story.php b/module/metric/calc/system/scale/scale_of_invalid_story.php index 6468f2a7ef..128f0ff2e5 100755 --- a/module/metric/calc/system/scale/scale_of_invalid_story.php +++ b/module/metric/calc/system/scale/scale_of_invalid_story.php @@ -22,14 +22,13 @@ class scale_of_invalid_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.estimate', 't1.closedReason', 't1.parent'); + public $fieldList = array('t1.estimate', 't1.closedReason', 't1.parent', 't1.isParent'); public $result = 0; public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; if(empty($row->estimate)) return null; diff --git a/module/metric/calc/system/scale/scale_of_monthly_closed_story.php b/module/metric/calc/system/scale/scale_of_monthly_closed_story.php index 25b8f02694..df1f1591e0 100755 --- a/module/metric/calc/system/scale/scale_of_monthly_closed_story.php +++ b/module/metric/calc/system/scale/scale_of_monthly_closed_story.php @@ -22,15 +22,13 @@ class scale_of_monthly_closed_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.status', 't1.closedDate', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.status', 't1.closedDate', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; - + if($row->isParent == '1') return false; if(empty($row->closedDate) || $row->status != 'closed') return false; $year = $this->getYear($row->closedDate); diff --git a/module/metric/calc/system/scale/scale_of_monthly_delivered_story.php b/module/metric/calc/system/scale/scale_of_monthly_delivered_story.php index 3ec383d447..8232afc220 100755 --- a/module/metric/calc/system/scale/scale_of_monthly_delivered_story.php +++ b/module/metric/calc/system/scale/scale_of_monthly_delivered_story.php @@ -22,14 +22,13 @@ class scale_of_monthly_delivered_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.stage', 't1.releasedDate', 't1.closedReason', 't1.closedDate', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.stage', 't1.releasedDate', 't1.closedReason', 't1.closedDate', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; $date = null; if($row->closedReason == 'done') $date = $row->closedDate; diff --git a/module/metric/calc/system/scale/scale_of_monthly_finished_story.php b/module/metric/calc/system/scale/scale_of_monthly_finished_story.php index 93f8c1ac9f..c3ec99fa86 100755 --- a/module/metric/calc/system/scale/scale_of_monthly_finished_story.php +++ b/module/metric/calc/system/scale/scale_of_monthly_finished_story.php @@ -22,14 +22,13 @@ class scale_of_monthly_finished_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.closedDate', 't1.closedReason', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.closedDate', 't1.closedReason', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; if(empty($row->closedDate) || $row->closedReason != 'done') return false; diff --git a/module/metric/calc/system/scale/scale_of_story.php b/module/metric/calc/system/scale/scale_of_story.php index 989678b8f4..0e312b59ec 100755 --- a/module/metric/calc/system/scale/scale_of_story.php +++ b/module/metric/calc/system/scale/scale_of_story.php @@ -22,14 +22,13 @@ class scale_of_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.estimate', 't1.parent'); + public $fieldList = array('t1.estimate', 't1.parent', 't1.isParent'); public $result = 0; public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; if(empty($row->estimate)) return null; diff --git a/module/metric/calc/system/scale/scale_of_valid_story.php b/module/metric/calc/system/scale/scale_of_valid_story.php index 9f83bac10f..a67f7a8050 100755 --- a/module/metric/calc/system/scale/scale_of_valid_story.php +++ b/module/metric/calc/system/scale/scale_of_valid_story.php @@ -22,15 +22,13 @@ class scale_of_valid_story extends baseCalc { public $dataset = 'getAllDevStories'; - public $fieldList = array('t1.estimate', 't1.closedReason', 't1.parent'); + public $fieldList = array('t1.estimate', 't1.closedReason', 't1.parent', 't1.isParent'); public $result = 0; public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; - + if($row->isParent == '1') return false; if(empty($row->estimate)) return null; if(!in_array($row->closedReason, array('duplicate', 'willnotdo', 'bydesign', 'cancel'))) $this->result += $row->estimate; diff --git a/module/metric/calc/system/scale/scale_of_weekly_finished_story.php b/module/metric/calc/system/scale/scale_of_weekly_finished_story.php index 6ce40769b8..d7974d91e3 100755 --- a/module/metric/calc/system/scale/scale_of_weekly_finished_story.php +++ b/module/metric/calc/system/scale/scale_of_weekly_finished_story.php @@ -22,14 +22,13 @@ class scale_of_weekly_finished_story extends baseCalc { public $dataset = 'getStories'; - public $fieldList = array('t1.status', 't1.closedReason', 't1.closedDate', 't1.estimate', 't1.parent'); + public $fieldList = array('t1.status', 't1.closedReason', 't1.closedDate', 't1.estimate', 't1.parent', 't1.isParent'); public $result = array(); public function calculate($row) { - $parent = $row->parent; - if($parent == '-1') return false; + if($row->isParent == '1') return false; $year = $this->getYear($row->closedDate); $week = $this->getWeek($row->closedDate); diff --git a/module/metric/model.php b/module/metric/model.php index c02abb9548..642bd7664a 100755 --- a/module/metric/model.php +++ b/module/metric/model.php @@ -1150,9 +1150,7 @@ class metricModel extends model $record->calcType = $calcType; $record->calculatedBy = $calcType == 'inference' ? $this->app->user->account : 'system'; - $sql = $this->dao->insert(TABLE_METRICLIB) - ->data($record) - ->get(); + $sql = $this->dao->insert(TABLE_METRICLIB)->data($record)->get(); $position = strpos($sql, 'VALUES');