* Refactor custom::computeFeatures method.

This commit is contained in:
tianshujie
2023-11-23 14:50:49 +08:00
parent c62eacc83a
commit ba3a3e6ee0
+6 -3
View File
@@ -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';