From d3cec627178d44a4a15b99d35e48970f0407034b Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 20 Sep 2022 15:38:00 +0800 Subject: [PATCH] * finish task #69706 --- module/install/control.php | 3 +- module/install/view/step4.html.php | 144 +++++++++++++------------ module/upgrade/control.php | 57 ++-------- module/upgrade/css/to15guide.css | 2 - module/upgrade/lang/de.php | 7 +- module/upgrade/lang/en.php | 6 +- module/upgrade/lang/fr.php | 7 +- module/upgrade/lang/zh-cn.php | 8 +- module/upgrade/model.php | 108 +++++++++++++++++++ module/upgrade/systemfiles.txt | 2 - module/upgrade/view/to15guide.html.php | 60 ----------- module/upgrade/view/to18guide.html.php | 26 +++-- 12 files changed, 226 insertions(+), 204 deletions(-) delete mode 100644 module/upgrade/css/to15guide.css delete mode 100644 module/upgrade/view/to15guide.html.php diff --git a/module/install/control.php b/module/install/control.php index 1bd16fb17d..9149796c20 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -216,7 +216,8 @@ class install extends control else { $this->app->loadLang('upgrade'); - $this->view->title = $this->lang->install->selectMode; + $this->view->edition = $this->config->edition; + $this->view->title = $this->lang->install->selectMode; $this->display(); } } diff --git a/module/install/view/step4.html.php b/module/install/view/step4.html.php index eeb6c429e4..4c1d0d3346 100644 --- a/module/install/view/step4.html.php +++ b/module/install/view/step4.html.php @@ -42,75 +42,81 @@ - - lang->upgrade->usage;?> - lang->upgrade->leanUsage;?> - lang->upgrade->newUsage;?> - - - lang->upgrade->program;?> - - - - - lang->upgrade->productRR;?> - - - - - lang->upgrade->productUR;?> - - - - - lang->upgrade->productLine;?> - - - - - lang->upgrade->projectScrum;?> - - - - - lang->upgrade->scrumDetail;?> - - - - - lang->upgrade->projectWaterfull;?> - - - - - lang->upgrade->projectKanban;?> - - - - - lang->upgrade->execution;?> - - - - - lang->upgrade->assetlib;?> - - - - - lang->upgrade->oa;?> - - - - - lang->upgrade->selectUsage;?> - - - - - lang->upgrade->remark;?> - lang->upgrade->remarkDesc;?> - + + lang->upgrade->usage;?> + lang->upgrade->leanUsage;?> + lang->upgrade->newUsage;?> + + + lang->upgrade->program;?> + + + + + lang->upgrade->productRR;?> + + + + + lang->upgrade->productUR;?> + + + + + lang->upgrade->productLine;?> + + + + + lang->upgrade->projectScrum;?> + + + + + + lang->upgrade->scrumDetail;?> + + + + + + lang->upgrade->projectWaterfall;?> + + + + + lang->upgrade->projectKanban;?> + + + + + lang->upgrade->execution;?> + + + + + + lang->upgrade->assetlib;?> + + + + + + + lang->upgrade->oa;?> + + + + + + lang->upgrade->selectUsage;?> + + + + + lang->upgrade->remark;?> + lang->upgrade->remarkDesc;?> + diff --git a/module/upgrade/control.php b/module/upgrade/control.php index 783bcf5fbc..2551a9cc58 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -187,54 +187,6 @@ class upgrade extends control $this->display(); } - /** - * Guide to 15 version. - * - * @param string $fromVersion - * @access public - * @return void - */ - public function to15Guide($fromVersion) - { - if($_POST) - { - $mode = fixer::input('post')->get('mode'); - $this->loadModel('setting')->setItem('system.common.global.mode', $mode); - - /* Update sprint concept. */ - $sprintConcept = 0; - if(isset($this->config->custom->sprintConcept)) - { - if($this->config->custom->sprintConcept == 2 and $mode == 'new') $sprintConcept = 1; - } - elseif(isset($this->config->custom->productProject)) - { - list($productConcept, $projectConcept) = explode('_', $this->config->custom->productProject); - if($mode == 'classic') $sprintConcept = $projectConcept; - if($mode == 'new' and $projectConcept == 2) $sprintConcept = 1; - } - $this->setting->setItem('system.custom.sprintConcept', $sprintConcept); - - if($mode == 'classic') $this->locate(inlink('afterExec', "fromVersion=$fromVersion")); - if($mode == 'new') $this->locate(inlink('mergeTips')); - } - - $title = $this->lang->upgrade->toPMS15Guide; - if($this->config->edition == 'max') - { - $this->lang->upgrade->to15Desc = str_replace('15.0', $this->lang->maxName, $this->lang->upgrade->to15Desc); - $title = $this->lang->upgrade->toMAXGuide; - } - elseif($this->config->edition == 'biz') - { - $this->lang->upgrade->to15Desc = str_replace('15', $this->lang->bizName . '5', $this->lang->upgrade->to15Desc); - $title = $this->lang->upgrade->toBIZ5Guide; - } - - $this->view->title = $title; - $this->display(); - } - /** * Guide to 18 version. * @@ -278,7 +230,14 @@ class upgrade extends control if($mode == 'new') $this->locate(inlink('selectMergeMode', "fromVersion=$fromVersion&mode=new")); } - $this->view->title = $this->lang->upgrade->selectMode; + $checkHistoryResult = $this->upgrade->checkHistoryDataForLeanMode(); + + $this->view->ur = $checkHistoryResult['ur']; + $this->view->cmmi = $checkHistoryResult['cmmi']; + $this->view->waterfall = $checkHistoryResult['waterfall']; + $this->view->assetlib = $checkHistoryResult['assetlib']; + $this->view->title = $this->lang->upgrade->selectMode; + $this->view->edition = $this->config->edition; $this->display(); } diff --git a/module/upgrade/css/to15guide.css b/module/upgrade/css/to15guide.css deleted file mode 100644 index f0218df3f0..0000000000 --- a/module/upgrade/css/to15guide.css +++ /dev/null @@ -1,2 +0,0 @@ -#selectedModeTips {padding-top: 10px} -#upgradeTips {padding-bottom: 10px;} diff --git a/module/upgrade/lang/de.php b/module/upgrade/lang/de.php index ef269ef914..b028b3aff1 100644 --- a/module/upgrade/lang/de.php +++ b/module/upgrade/lang/de.php @@ -185,16 +185,17 @@ $lang->upgrade->productRR = 'Product - R&D requirements'; $lang->upgrade->productUR = 'Product - User requirements'; $lang->upgrade->productLine = 'Product - Product Line'; $lang->upgrade->projectScrum = 'Project - Scrum model'; -$lang->upgrade->scrumDetail = 'Scrum - Issues, risks, opportunities, processes, QA, meetings';$lang->upgrade->projectWaterfull = 'Project - Waterfall model'; +$lang->upgrade->scrumDetail = 'Scrum - Issues, risks, opportunities, processes, QA, meetings'; +$lang->upgrade->projectWaterfall = 'Project - waterfall model'; $lang->upgrade->projectKanban = 'Project - Kanban model'; $lang->upgrade->execution = 'Execute, test, DevOps, Kanban, document, statistics, organize'; $lang->upgrade->assetlib = 'Assetlib'; -$lang->upgrade->oa = 'OA, operation and maintenance, feedback, school, workflow, background'; +$lang->upgrade->oa = 'OA, operation and maintenance, feedback, school, workflow'; $lang->upgrade->selectUsage = 'Select a scenario'; $lang->upgrade->useLean = 'Use Lean mode'; $lang->upgrade->useNew = 'User New mode'; $lang->upgrade->remark = 'Remark'; -$lang->upgrade->remarkDesc = 'You can also switch between the background customization of the system later'; +$lang->upgrade->remarkDesc = 'You can also switch the mode in the background customization of the system.'; $lang->upgrade->to18Mode['lean'] = 'Lean Mode'; $lang->upgrade->to18Mode['new'] = 'Program Mode'; diff --git a/module/upgrade/lang/en.php b/module/upgrade/lang/en.php index f6688dd70f..f5663eb3be 100644 --- a/module/upgrade/lang/en.php +++ b/module/upgrade/lang/en.php @@ -186,16 +186,16 @@ $lang->upgrade->productUR = 'Product - User requirements'; $lang->upgrade->productLine = 'Product - Product Line'; $lang->upgrade->projectScrum = 'Project - Scrum model'; $lang->upgrade->scrumDetail = 'Scrum - Issues, risks, opportunities, processes, QA, meetings'; -$lang->upgrade->projectWaterfull = 'Project - Waterfall model'; +$lang->upgrade->projectWaterfall = 'Project - Waterfall model'; $lang->upgrade->projectKanban = 'Project - Kanban model'; $lang->upgrade->execution = 'Execute, test, DevOps, Kanban, document, statistics, organize'; $lang->upgrade->assetlib = 'Assetlib'; -$lang->upgrade->oa = 'OA, operation and maintenance, feedback, school, workflow, background'; +$lang->upgrade->oa = 'OA, operation and maintenance, feedback, school, workflow'; $lang->upgrade->selectUsage = 'Select a scenario'; $lang->upgrade->useLean = 'Use Lean mode'; $lang->upgrade->useNew = 'User New mode'; $lang->upgrade->remark = 'Remark'; -$lang->upgrade->remarkDesc = 'You can also switch between the background customization of the system later'; +$lang->upgrade->remarkDesc = 'You can also switch the mode in the background customization of the system.'; $lang->upgrade->to18Mode['lean'] = 'Lean Mode'; $lang->upgrade->to18Mode['new'] = 'Program Mode'; diff --git a/module/upgrade/lang/fr.php b/module/upgrade/lang/fr.php index 6565fab136..935b0d13a6 100644 --- a/module/upgrade/lang/fr.php +++ b/module/upgrade/lang/fr.php @@ -185,16 +185,17 @@ $lang->upgrade->productRR = 'Product - R&D requirements'; $lang->upgrade->productUR = 'Product - User requirements'; $lang->upgrade->productLine = 'Product - Product Line'; $lang->upgrade->projectScrum = 'Project - Scrum model'; -$lang->upgrade->scrumDetail = 'Scrum - Issues, risks, opportunities, processes, QA, meetings';$lang->upgrade->projectWaterfull = 'Project - Waterfall model'; +$lang->upgrade->scrumDetail = 'Scrum - Issues, risks, opportunities, processes, QA, meetings'; +$lang->upgrade->projectWaterfall = 'Project - Waterfall model'; $lang->upgrade->projectKanban = 'Project - Kanban model'; $lang->upgrade->execution = 'Execute, test, DevOps, Kanban, document, statistics, organize'; $lang->upgrade->assetlib = 'Assetlib'; -$lang->upgrade->oa = 'OA, operation and maintenance, feedback, school, workflow, background'; +$lang->upgrade->oa = 'OA, operation and maintenance, feedback, school, workflow'; $lang->upgrade->selectUsage = 'Select a scenario'; $lang->upgrade->useLean = 'Use Lean mode'; $lang->upgrade->useNew = 'User New mode'; $lang->upgrade->remark = 'Remark'; -$lang->upgrade->remarkDesc = 'You can also switch between the background customization of the system later'; +$lang->upgrade->remarkDesc = 'You can also switch the mode in the background customization of the system.'; $lang->upgrade->to18Mode['lean'] = 'Lean Mode'; $lang->upgrade->to18Mode['new'] = 'Program Mode'; diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php index d28982dac3..c31ab6d8b3 100644 --- a/module/upgrade/lang/zh-cn.php +++ b/module/upgrade/lang/zh-cn.php @@ -186,16 +186,16 @@ $lang->upgrade->productUR = '产品-用户需求'; $lang->upgrade->productLine = '产品-产品线'; $lang->upgrade->projectScrum = '项目-敏捷模型'; $lang->upgrade->scrumDetail = '敏捷项目-问题、风险、机会、过程、QA、会议'; -$lang->upgrade->projectWaterfull = '项目-瀑布模型'; +$lang->upgrade->projectWaterfall = '项目-瀑布模型'; $lang->upgrade->projectKanban = '项目-看板模型'; -$lang->upgrade->execution = '执行、测试DevOps、看板、文档、统计、组织'; +$lang->upgrade->execution = '执行、测试、DevOps、看板、文档、统计、组织'; $lang->upgrade->assetlib = '资产库'; -$lang->upgrade->oa = '办公、运维、反馈、学堂、工作流、后台'; +$lang->upgrade->oa = '办公、运维、反馈、学堂、工作流'; $lang->upgrade->selectUsage = '请选择使用场景'; $lang->upgrade->useLean = '使用迅捷模式'; $lang->upgrade->useNew = '使用综合模式'; $lang->upgrade->remark = '备注'; -$lang->upgrade->remarkDesc = '后续您还可以在系统的后台自定义中进行切换。'; +$lang->upgrade->remarkDesc = '后续您还可以在系统的后台自定义中进行模式切换。'; $lang->upgrade->to18Mode['lean'] = '迅捷模式'; $lang->upgrade->to18Mode['new'] = '综合模式'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index c7693ee634..f4be29dbdd 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -7793,4 +7793,112 @@ class upgradeModel extends model return true; } + + /** + * Check history data form lean mode. + * 简要迅捷模式历史数据是否存在 + * + * @access public + * @return array + */ + public function checkHistoryDataForLeanMode() + { + $returnData = array( + 'ur' => false, + 'cmmi' => false, + 'waterfall' => false, + 'assetlib' => false, + ); + + if($this->config->systemMode == 'new') + { + /* User requriement */ + $requirementStory = $this->dao->select('count(1) as total')->from(TABLE_STORY)->where('type')->eq('requirement')->andWhere('deleted')->eq('0')->fetch('total'); + if($requirementStory > 0) $returnData['ur'] = true; + if($this->config->edition == 'max') + { + /* issue,risk,opportunity,process,QA,meeting */ + $issue = $this->dao->select('count(1) as total')->from(TABLE_ISSUE)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->fetch('total'); + if($issue > 0) + { + $returnData['cmmi'] = true; + goto next; + } + + $risk = $this->dao->select('count(1) as total')->from(TABLE_RISK)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->fetch('total'); + if($risk > 0) + { + $returnData['cmmi'] = true; + goto next; + } + + $opportunity = $this->dao->select('count(1) as total')->from(TABLE_OPPORTUNITY)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->fetch('total'); + if($opportunity > 0) + { + $returnData['cmmi'] = true; + goto next; + } + + $process = $this->dao->select('count(1) as total')->from(TABLE_PROCESS) + ->where('deleted')->eq(0) + ->fetch('total'); + if($process > 0) + { + $returnData['cmmi'] = true; + goto next; + } + + $auditplans = $this->dao->select('count(1) as total')->from(TABLE_AUDITPLAN) + ->where('deleted')->eq(0) + ->fetch('total'); + if($auditplans > 0) + { + $returnData['cmmi'] = true; + goto next; + } + + $meeting = $this->dao->select('count(1) as total')->from(TABLE_MEETING)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->fetch('total'); + if($meeting > 0) + { + $returnData['cmmi'] = true; + goto next; + } + } + + next: + /* Waterfull mode */ + $waterfull = $this->dao->select('count(1) as total')->from(TABLE_PROJECT) + ->where('model')->eq('waterfall') + ->andWhere('deleted')->eq(0) + ->fetch('total'); + if($waterfull > 0) $returnData['waterfall'] = true; + + if($this->config->edition == 'max') + { + /* assetlib */ + $assetlib = $this->dao->select('count(1) as total')->from(TABLE_ASSETLIB) + ->where('deleted')->eq(0) + ->fetch('total'); + if($assetlib > 0) $returnData['assetlib'] = true; + } + } + + return $returnData; + } } diff --git a/module/upgrade/systemfiles.txt b/module/upgrade/systemfiles.txt index a02d182d17..6b495e3c91 100644 --- a/module/upgrade/systemfiles.txt +++ b/module/upgrade/systemfiles.txt @@ -5461,7 +5461,6 @@ ,upgrade/css/index.html, ,upgrade/css/mergeprogram.css, ,upgrade/css/mergerepo.css, -,upgrade/css/to15guide.css, ,upgrade/ext/config/bizext.php, ,upgrade/ext/config/zentaobiz.php, ,upgrade/ext/config/zentaomax.php, @@ -5534,7 +5533,6 @@ ,upgrade/view/mergetips.html.php, ,upgrade/view/renameobject.html.php, ,upgrade/view/selectversion.html.php, -,upgrade/view/to15guide.html.php, ,user/config.php, ,user/control.php, ,user/css/batchcreate.css, diff --git a/module/upgrade/view/to15guide.html.php b/module/upgrade/view/to15guide.html.php deleted file mode 100644 index 6ad0528cb5..0000000000 --- a/module/upgrade/view/to15guide.html.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @package upgrade - * @version $Id$ - * @link http://www.zentao.net - */ -?> - -
-
-
-
- edition == 'max') - { - echo $lang->upgrade->toMAXGuide; - } - elseif($config->edition == 'biz') - { - echo $lang->upgrade->toBIZ5Guide; - } - else - { - echo $lang->upgrade->toPMS15Guide; - } - ?> -
-
-
- upgrade->to15Desc;?> - upgrade->to15Mode['classic']) ? 'classic' : 'new';?> - upgrade->to15Mode, $systemMode);?> -
upgrade->selectedModeTips[$systemMode];?>
-
-
-
- -
-
-
-upgrade->selectedModeTips);?> - - diff --git a/module/upgrade/view/to18guide.html.php b/module/upgrade/view/to18guide.html.php index 6065aa2a59..f1e316b327 100644 --- a/module/upgrade/view/to18guide.html.php +++ b/module/upgrade/view/to18guide.html.php @@ -28,8 +28,8 @@ lang->upgrade->usage;?> - lang->upgrade->leanUsage;?> - lang->upgrade->newUsage;?> + lang->upgrade->leanUsage;?> + lang->upgrade->newUsage;?> lang->upgrade->program;?> @@ -41,9 +41,10 @@ + lang->upgrade->productUR;?> - + @@ -56,14 +57,18 @@ + + lang->upgrade->scrumDetail;?> - + + + - lang->upgrade->projectWaterfull;?> - + lang->upgrade->projectWaterfall;?> + @@ -76,18 +81,23 @@ + + lang->upgrade->assetlib;?> - + + + lang->upgrade->oa;?> + - lang->upgrade->selectUsage;?> + lang->upgrade->selectUsage;?>