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); + } +}