From 1875b5be0ee32980a8db145414776c774c80dbbd Mon Sep 17 00:00:00 2001 From: Yagami Date: Tue, 25 Oct 2022 09:25:07 +0800 Subject: [PATCH] * Fix bug #73233. --- module/project/control.php | 4 +++- module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/vi.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/model.php | 2 ++ module/project/view/manageproducts.html.php | 16 ++++++++++++++++ 8 files changed, 26 insertions(+), 1 deletion(-) diff --git a/module/project/control.php b/module/project/control.php index f2a9437eee..64c64facf5 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -2044,6 +2044,8 @@ class project extends control $this->loadModel('program'); $this->loadModel('execution'); + $project = $this->project->getById($projectID); + if(!empty($_POST)) { if(!isset($_POST['products'])) @@ -2075,7 +2077,6 @@ class project extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); } - $project = $this->project->getById($projectID); if($this->app->tab == 'program') { $this->program->setMenu($project->parent); @@ -2120,6 +2121,7 @@ class project extends control $this->view->linkedProducts = $linkedProducts; $this->view->linkedBranches = $linkedBranches; $this->view->branches = $branches; + $this->view->project = $project; $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->unmodifiableBranches = $unmodifiableBranches; $this->view->unmodifiableMainBranches = $unmodifiableMainBranches; diff --git a/module/project/lang/de.php b/module/project/lang/de.php index b59dea8fb2..c51d365559 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -196,6 +196,7 @@ $lang->project->changeProgram = '%s > Change project'; $lang->project->changeProgramTip = 'After modifying the project set, the products linked with the project will also modify the project set to which it belongs. Please confirm whether to modify it.'; $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; +$lang->project->noticeDivsion = "The current project is associated with multiple products, you can click Confirm to open the mode by {$lang->productCommon} creation stage, click Cancel to keep the status quo."; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index e2e896ec13..ebc9540e26 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -196,6 +196,7 @@ $lang->project->changeProgram = '%s > Change project'; $lang->project->changeProgramTip = 'Once the program is edited, the product that is linked to this program will be changed. Do you want to edit it?'; $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; +$lang->project->noticeDivsion = "The current project is associated with multiple products, you can click Confirm to open the mode by {$lang->productCommon} creation stage, click Cancel to keep the status quo."; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 0f5591b24d..3e86cd7cc7 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -196,6 +196,7 @@ $lang->project->changeProgram = '%s > Change project'; $lang->project->changeProgramTip = 'After modifying the project set, the products linked with the project will also modify the project set to which it belongs. Please confirm whether to modify it.'; $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; +$lang->project->noticeDivsion = "The current project is associated with multiple products, you can click Confirm to open the mode by {$lang->productCommon} creation stage, click Cancel to keep the status quo."; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 8b3fec9d3a..2aed7d8d15 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -116,6 +116,7 @@ $lang->project->changeProgram = '%s > Change project'; $lang->project->changeProgramTip = 'After modifying the project set, the products linked with the project will also modify the project set to which it belongs. Please confirm whether to modify it.'; $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; +$lang->project->noticeDivsion = "The current project is associated with multiple products, you can click Confirm to open the mode by {$lang->productCommon} creation stage, click Cancel to keep the status quo."; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->noDevStage = 'There is no R&D stage under this project, or you do not have access permissions. The creation of builds is not supported at the moment.'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 5965287bd9..8d691dc9f8 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -196,6 +196,7 @@ $lang->project->changeProgram = '%s > 修改项目集'; $lang->project->changeProgramTip = '修改项目集后,该项目关联产品的项目集也会被修改,请确认是否修改。'; $lang->project->linkedProjectsTip = '关联的项目如下'; $lang->project->multiLinkedProductsTip = '该项目关联的如下产品还关联了其他项目,请取消关联后再操作'; +$lang->project->noticeDivsion = '当前项目关联多个产品,可以点击确认开启按产品创建阶段的模式,点击取消则保持现状。'; $lang->project->linkStoryByPlanTips = "此操作会将所选计划下面的{$lang->SRCommon}全部关联到此项目中"; $lang->project->createExecution = "该项目下没有{$lang->executionCommon},请先创建{$lang->executionCommon}"; $lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->execution->common},是否同时将其移除?(该用户所产生的数据不会受影响。)"; diff --git a/module/project/model.php b/module/project/model.php index 94c8d58ae7..84be5de600 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2164,6 +2164,8 @@ class projectModel extends model { $executions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq((int)$projectID)->fetchPairs('id'); $this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->in($executions)->andWhere('product')->notin($products)->exec(); + + if(isset($_POST['division'])) $this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec(); } $oldProductKeys = array_keys($oldProjectProducts); diff --git a/module/project/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index 1a214f23ff..8059e09759 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -75,4 +75,20 @@ +division and count($linkedProducts) == 1):?> +project->noticeDivsion);?> + +