From 45d957cc9fd4d679ab947d41bd22e7f8f7a9f4e2 Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 28 Sep 2022 02:16:14 +0000 Subject: [PATCH] * Disable issue, risk, urstory when switch to lean mode for task #70565,#70566. --- module/custom/config.php | 2 ++ module/custom/lang/de.php | 6 ++-- module/custom/lang/en.php | 6 ++-- module/custom/lang/fr.php | 6 ++-- module/custom/lang/zh-cn.php | 6 ++-- module/custom/model.php | 51 ++++++++++++++++++++++++++++++-- module/custom/view/flow.html.php | 40 ++++++++++++++++--------- 7 files changed, 88 insertions(+), 29 deletions(-) diff --git a/module/custom/config.php b/module/custom/config.php index c5d4c332b4..60fe5646f6 100644 --- a/module/custom/config.php +++ b/module/custom/config.php @@ -22,6 +22,8 @@ $config->custom->requiredModules[35] = 'execution'; $config->custom->requiredModules[40] = 'task'; $config->custom->requiredModules[45] = 'build'; +$config->custom->features = array('waterfall', 'URStory', 'scrumOpportunity', 'scrumMeeting', 'scrumAuditplan', 'scrumProcess', 'scrumIssue', 'scrumRisk'); + $config->custom->requiredModules[50] = 'bug'; $config->custom->requiredModules[55] = 'testcase'; $config->custom->requiredModules[60] = 'testsuite'; diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 12dbfad1a8..43b81464fa 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -273,9 +273,9 @@ $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; $lang->custom->moduleName['execution'] = $lang->custom->execution; -$lang->custom->conceptQuestions['overview'] = "1. Which combination of management fits your company?"; -$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; -$lang->custom->conceptQuestions['storypoint'] = "3. Which of the following units is your company using for scale estimation?"; +$lang->custom->conceptQuestions['overview'] = "Which combination of management fits your company?"; +$lang->custom->conceptQuestions['URAndSR'] = "Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['storypoint'] = "Which of the following units is your company using for scale estimation?"; $lang->custom->conceptOptions = new stdclass; $lang->custom->conceptOptions->story = array(); diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 943adcf1e9..a51714846f 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -273,9 +273,9 @@ $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; $lang->custom->moduleName['execution'] = $lang->custom->execution; -$lang->custom->conceptQuestions['overview'] = "1. Which combination of management fits your company?"; -$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; -$lang->custom->conceptQuestions['storypoint'] = "3. Which of the following units is your company using for scale estimation?"; +$lang->custom->conceptQuestions['overview'] = "Which combination of management fits your company?"; +$lang->custom->conceptQuestions['URAndSR'] = "Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['storypoint'] = "Which of the following units is your company using for scale estimation?"; $lang->custom->conceptOptions = new stdclass; $lang->custom->conceptOptions->story = array(); diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 84e7d6d6e1..f43ab88db5 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -273,9 +273,9 @@ $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; $lang->custom->moduleName['execution'] = $lang->custom->execution; -$lang->custom->conceptQuestions['overview'] = "1. Quelle combinaison de gestion convient le mieux à votre entreprise ?"; -$lang->custom->conceptQuestions['URAndSR'] = "2. Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; -$lang->custom->conceptQuestions['storypoint'] = "3. Which of the following units is your company using for scale estimation?"; +$lang->custom->conceptQuestions['overview'] = "Quelle combinaison de gestion convient le mieux à votre entreprise ?"; +$lang->custom->conceptQuestions['URAndSR'] = "Do you want to use the concept of {$lang->URCommon} and {$lang->SRCommon} in ZenTao?"; +$lang->custom->conceptQuestions['storypoint'] = "Which of the following units is your company using for scale estimation?"; $lang->custom->conceptOptions = new stdclass; $lang->custom->conceptOptions->story = array(); diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 5979770f35..0a9561262e 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -273,9 +273,9 @@ $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = '计划'; $lang->custom->moduleName['execution'] = $lang->custom->execution; -$lang->custom->conceptQuestions['overview'] = "1. 下述哪种组合方式更适合您公司的管理现状?"; -$lang->custom->conceptQuestions['URAndSR'] = "2. 是否启用{$lang->URCommon}和{$lang->SRCommon}概念?"; -$lang->custom->conceptQuestions['storypoint'] = "3. 您公司是在使用以下哪种单位来做规模估算?"; +$lang->custom->conceptQuestions['overview'] = "下述哪种组合方式更适合您公司的管理现状?"; +$lang->custom->conceptQuestions['URAndSR'] = "是否启用{$lang->URCommon}和{$lang->SRCommon}概念?"; +$lang->custom->conceptQuestions['storypoint'] = "您公司是在使用以下哪种单位来做规模估算?"; $lang->custom->conceptOptions = new stdclass; $lang->custom->conceptOptions->story = array(); diff --git a/module/custom/model.php b/module/custom/model.php index 87de231e46..0c330e1a5a 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -828,7 +828,7 @@ class customModel extends model $counts = array(); $counts['waterfall'] = $this->dao->select('COUNT(*) AS waterfallCount')->from(TABLE_PROJECT)->where('model')->eq('waterfall')->andWhere('deleted')->eq('0')->fetch('waterfallCount'); $counts['URStory'] = $this->dao->select('COUNT(*) AS URStoryCount')->from(TABLE_STORY)->where('type')->eq('requirement')->andWhere('deleted')->eq('0')->fetch('URStoryCount'); - if($this->config->edition == 'max') $count['assetLib'] = $this->dao->select('COUNT(*) AS assetLibCount')->from(TABLE_ASSETLIB)->where('deleted')->eq('0')->fetch('assetLibCount'); + if($this->config->edition == 'max') $counts['assetLib'] = $this->dao->select('COUNT(*) AS assetLibCount')->from(TABLE_ASSETLIB)->where('deleted')->eq('0')->fetch('assetLibCount'); return $counts; } @@ -903,8 +903,7 @@ class customModel extends model $disabledFeatures = ''; if($mode == 'lean') { - $features = array('scrumOpportunity', 'scrumMeeting', 'scrumAuditplan', 'scrumProcess'); - foreach($features as $feature) + foreach($this->config->custom->features as $feature) { $function = 'has' . ucfirst($feature) . 'Data'; if(!$this->$function()) $disabledFeatures .= "$feature,"; @@ -913,6 +912,52 @@ class customModel extends model $this->loadModel('setting')->setItem('system.common.disabledFeatures', rtrim($disabledFeatures, ',')); } + /** + * Check for URStory data. + * + * @access public + * @return int + */ + public function hasURStoryData() + { + return $this->dao->select('*')->from(TABLE_STORY)->where('type')->eq('requirement')->andWhere('deleted')->eq('0')->count(); + } + + /** + * Check for waterfall project data. + * + * @access public + * @return int + */ + public function hasWaterfallData() + { + return $this->dao->select('*')->from(TABLE_PROJECT)->where('model')->eq('waterfall')->andWhere('deleted')->eq('0')->count(); + } + + /** + * Check for issue data. + * + * @access public + * @return bool|int + */ + public function hasScrumIssueData() + { + if($this->config->edition == 'max') return $this->dao->select('*')->from(TABLE_ISSUE)->where('deleted')->eq('0')->andWhere('execution')->ne(0)->count(); + return false; + } + + /** + * Check for risk data. + * + * @access public + * @return bool + */ + public function hasScrumRiskData() + { + if($this->config->edition == 'max') return $this->dao->select('*')->from(TABLE_RISK)->where('deleted')->eq('0')->andWhere('execution')->ne(0)->count(); + return false; + } + /** * Verify whether there is scrum opportunity data * diff --git a/module/custom/view/flow.html.php b/module/custom/view/flow.html.php index fbac50f2db..c4f1fc5587 100644 --- a/module/custom/view/flow.html.php +++ b/module/custom/view/flow.html.php @@ -26,20 +26,32 @@