diff --git a/module/metric/calc/execution/scale/count_of_dev_task_in_execution.php b/module/metric/calc/execution/scale/count_of_dev_task_in_execution.php new file mode 100644 index 0000000000..c54c9067ad --- /dev/null +++ b/module/metric/calc/execution/scale/count_of_dev_task_in_execution.php @@ -0,0 +1,43 @@ + + * @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_dev_task_in_execution extends baseCalc +{ + public $dataset = 'getTasks'; + + public $fieldList = array('t1.type', 't1.execution'); + + public $result = array(); + + public function calculate($row) + { + if($row->type == 'devel') + { + if(!isset($this->result[$row->execution])) $this->result[$row->execution] = 0; + $this->result[$row->execution] ++; + } + } + + public function getResult($options = array()) + { + $records = $this->getRecords(array('execution', 'value')); + return $this->filterByOptions($records, $options); + } +}