From f856d8b4d244564783063eefcddd7d649f5e5d85 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 10 Jun 2025 13:44:00 +0800 Subject: [PATCH] + [task#144593,doing,0.4h] add scale_of_closed_story metric. --- .../system/scale/scale_of_closed_story.php | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 module/metric/calc/system/scale/scale_of_closed_story.php 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); + } +}