From ba3a3e6ee08e3da679d140f147f835e9c0a977b3 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 23 Nov 2023 14:50:39 +0800 Subject: [PATCH] * Refactor custom::computeFeatures method. --- module/custom/model.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/custom/model.php b/module/custom/model.php index 8c50f7e9e0..0ce8d2febd 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -899,13 +899,15 @@ class customModel extends model } /** - * Compute features. + * 计算启用和不启用的功能。 + * Compute the enabled and disabled features. * * @access public * @return array */ - public function computeFeatures() + public function computeFeatures(): array { + /* Check that the project features are enabled. */ $disabledFeatures = array('program', 'productLine'); foreach($this->config->custom->dataFeatures as $feature) { @@ -930,6 +932,7 @@ class customModel extends model if(!isset($disabledFeatures['scrum'])) $disabledFeatures['scrum'] = array(); $disabledFeatures['scrum'][] = 'scrumMeasrecord'; + /* Check that the scrum project features are enabled. */ $enabledScrumFeatures = array(); $disabledScrumFeatures = array(); if(in_array($this->config->edition, array('max', 'ipd'))) @@ -1019,7 +1022,7 @@ class customModel extends model $disabledFeatures = ''; if($mode == 'light') { - /* Check whether the product or project data in tge system is empty. */ + /* Check whether the product or project data in the system is empty. */ foreach($this->config->custom->dataFeatures as $feature) { $function = 'has' . ucfirst($feature) . 'Data';