diff --git a/module/metric/calc/system/scale/count_of_changed_story.php b/module/metric/calc/system/scale/count_of_changed_story.php new file mode 100644 index 0000000000..ef89d3546e --- /dev/null +++ b/module/metric/calc/system/scale/count_of_changed_story.php @@ -0,0 +1,42 @@ + + * @package + * @uses func + * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) + * @Link https://www.zentao.net + */ +class count_of_changed_story extends baseCalc +{ + public $dataset = ''; + + public $fieldList = array(); + + public $result = 0; + + public function calculate($row) + { + if(empty($row->changedDate) || $row->status == 'changing' || $row->status == 'reviewing') return false; + + if(!empty($row->executionStartDate) && !empty($row->executionEndDate) && $row->changedDate < $row->executionStartDate || $row->changedDate > $row->executionEndDate) return false; + $this->result ++; + } + + public function getResult($options = array()) + { + $records = array(array('value' => $this->result)); + return $this->filterByOptions($records, $options); + } +} diff --git a/module/metric/calc/system/scale/count_of_tested_story.php b/module/metric/calc/system/scale/count_of_tested_story.php new file mode 100644 index 0000000000..3175ef2e0d --- /dev/null +++ b/module/metric/calc/system/scale/count_of_tested_story.php @@ -0,0 +1,39 @@ + + * @package + * @uses func + * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) + * @Link https://www.zentao.net + */ +class count_of_tested_story extends baseCalc +{ + public $dataset = ''; + + public $fieldList = array(); + + public $result = 0; + + public function calculate($row) + { + if($row->stage == 'tested') $this->result ++; + } + + public function getResult($options = array()) + { + $records = array(array('value' => $this->result)); + return $this->filterByOptions($records, $options); + } +} diff --git a/module/metric/calc/system/scale/scale_of_changed_story.php b/module/metric/calc/system/scale/scale_of_changed_story.php new file mode 100644 index 0000000000..4d176f3996 --- /dev/null +++ b/module/metric/calc/system/scale/scale_of_changed_story.php @@ -0,0 +1,45 @@ + + * @package + * @uses func + * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) + * @Link https://www.zentao.net + */ +class scale_of_changed_story extends baseCalc +{ + public $dataset = ''; + + public $fieldList = array(); + + public $result = 0; + + public function calculate($row) + { + if($row->isParent == '1') return false; + if(empty($row->estimate)) return false; + + if(empty($row->changedDate) || $row->status == 'changing' || $row->status == 'reviewing') return false; + if(!empty($row->executionStartDate) && !empty($row->executionEndDate) && $row->changedDate < $row->executionStartDate || $row->changedDate > $row->executionEndDate) return false; + + $this->result += $row->estimate; + } + + public function getResult($options = array()) + { + $records = $this->getRecords(array('value')); + return $this->filterByOptions($records, $options); + } +} diff --git a/module/metric/calc/system/scale/scale_of_closed_story.php b/module/metric/calc/system/scale/scale_of_closed_story.php new file mode 100644 index 0000000000..bec8f088aa --- /dev/null +++ b/module/metric/calc/system/scale/scale_of_closed_story.php @@ -0,0 +1,42 @@ + + * @package + * @uses func + * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) + * @Link https://www.zentao.net + */ +class scale_of_closed_story extends baseCalc +{ + public $dataset = ''; + + public $fieldList = array(); + + public $result = 0; + + public function calculate($row) + { + if($row->isParent == '1') return false; + if(empty($row->estimate)) return null; + + if($row->status == 'closed') $this->result += $row->estimate; + } + + public function getResult($options = array()) + { + $records = $this->getRecords(array('value')); + return $this->filterByOptions($records, $options); + } +} diff --git a/module/metric/calc/system/scale/scale_of_tested_story.php b/module/metric/calc/system/scale/scale_of_tested_story.php new file mode 100644 index 0000000000..079626d10e --- /dev/null +++ b/module/metric/calc/system/scale/scale_of_tested_story.php @@ -0,0 +1,42 @@ + + * @package + * @uses func + * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) + * @Link https://www.zentao.net + */ +class scale_of_tested_story extends baseCalc +{ + public $dataset = ''; + + public $fieldList = array(); + + public $result = 0; + + public function calculate($row) + { + if($row->isParent == '1') return false; + if(empty($row->estimate)) return null; + + if($row->stage == 'tested') $this->result += $row->estimate; + } + + public function getResult($options = array()) + { + $records = $this->getRecords(array('value')); + return $this->filterByOptions($records, $options); + } +}