From d07579f5eba9423dd1642ca94bfd4d729f1a6f69 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 16 Nov 2022 15:52:08 +0800 Subject: [PATCH] * fix bug #29877#29878 --- module/execution/control.php | 16 ++++++++-------- module/execution/js/create.js | 7 +++++-- module/project/lang/de.php | 9 ++++++--- module/project/lang/en.php | 9 ++++++--- module/project/lang/fr.php | 9 ++++++--- module/project/lang/zh-cn.php | 5 ++++- module/project/view/manageproducts.html.php | 6 +++--- 7 files changed, 38 insertions(+), 23 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 105c530a13..44cc438e23 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1685,12 +1685,12 @@ class execution extends control $branchGroups = $this->execution->getBranchByProduct(array_keys($products), $projectID); $linkedBranches = array(); - foreach($products as $productID => $product) + foreach($products as $productIndex => $product) { - foreach($branches[$productID] as $branchID => $branch) + foreach($branches[$productIndex] as $branchID => $branch) { - $linkedBranches[$productID][$branchID] = $branchID; - $productPlans[$productID][$branchID] = isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array(); + $linkedBranches[$productIndex][$branchID] = $branchID; + $productPlans[$productIndex][$branchID] = isset($plans[$productIndex][$branchID]) ? $plans[$productIndex][$branchID] : array(); } } @@ -1720,12 +1720,12 @@ class execution extends control $plans = $this->loadModel('productplan')->getGroupByProduct(array_keys($products), 'skipParent|unexpired'); $linkedBranches = array(); - foreach($products as $productID => $product) + foreach($products as $productIndex => $product) { - foreach($branches[$productID] as $branchID => $branch) + foreach($branches[$productIndex] as $branchID => $branch) { - $linkedBranches[$productID][$branchID] = $branchID; - $productPlans[$productID][$branchID] = isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array(); + $linkedBranches[$productIndex][$branchID] = $branchID; + $productPlans[$productIndex][$branchID] = isset($plans[$productIndex][$branchID]) ? $plans[$productIndex][$branchID] : array(); } } diff --git a/module/execution/js/create.js b/module/execution/js/create.js index 52ae3473cd..cd71e63a61 100644 --- a/module/execution/js/create.js +++ b/module/execution/js/create.js @@ -37,8 +37,11 @@ $(function() /* Assign value to the manage products by the different request type.*/ var $product = $('#products0'); if(copyExecutionID) productID = $product.val(); - $product.val(productID); - $product.trigger("chosen:updated"); + if(productID) + { + $product.val(productID); + $product.trigger("chosen:updated"); + } var adjustMainCol = function() { diff --git a/module/project/lang/de.php b/module/project/lang/de.php index b7bef1cb44..ceaf6cd041 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -190,8 +190,11 @@ $lang->project->typeList = array(); $lang->project->typeList['my'] = 'Projects Ownedbyme'; $lang->project->typeList['other'] = 'Other Projects'; -$lang->project->divisionList['1'] = 'Create by project'; -$lang->project->divisionList['0'] = 'Create by product'; +$lang->project->divisionList['0'] = 'Create by project'; +$lang->project->divisionList['1'] = 'Create by product'; + +$lang->project->divisionSwitchList['0'] = 'Close'; +$lang->project->divisionSwitchList['1'] = "Open"; $lang->project->waitProjects = 'Waiting Projects'; $lang->project->doingProjects = 'Ongoing Projects'; @@ -208,7 +211,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 a single stage, click [Create by project] to change to multiple stages, each stage is only associated with one product."; +$lang->project->noticeDivsion = "The current project is a single stage, click [Open] to change to multiple stages, each stage is only associated with one product."; $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 fc890c98cb..5cd6e93171 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -190,8 +190,11 @@ $lang->project->typeList = array(); $lang->project->typeList['my'] = 'Projects Ownedbyme'; $lang->project->typeList['other'] = 'Other Projects'; -$lang->project->divisionList['1'] = 'Create by project'; -$lang->project->divisionList['0'] = 'Create by product'; +$lang->project->divisionList['0'] = 'Create by project'; +$lang->project->divisionList['1'] = 'Create by product'; + +$lang->project->divisionSwitchList['0'] = 'Close'; +$lang->project->divisionSwitchList['1'] = "Open"; $lang->project->waitProjects = 'Waiting Projects'; $lang->project->doingProjects = 'Ongoing Projects'; @@ -208,7 +211,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 a single stage, click [Create by project] to change to multiple stages, each stage is only associated with one product."; +$lang->project->noticeDivsion = "The current project is a single stage, click [Open] to change to multiple stages, each stage is only associated with one product."; $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 2039c47420..3d38aae8b8 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -190,8 +190,11 @@ $lang->project->typeList = array(); $lang->project->typeList['my'] = 'Projects Ownedbyme'; $lang->project->typeList['other'] = 'Other Projects'; -$lang->project->divisionList['1'] = 'Create by project'; -$lang->project->divisionList['0'] = 'Create by product'; +$lang->project->divisionList['0'] = 'Create by project'; +$lang->project->divisionList['1'] = 'Create by product'; + +$lang->project->divisionSwitchList['0'] = 'Close'; +$lang->project->divisionSwitchList['1'] = "Open"; $lang->project->waitProjects = 'Waiting Projects'; $lang->project->doingProjects = 'Ongoing Projects'; @@ -208,7 +211,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 a single stage, click [Create by project] to change to multiple stages, each stage is only associated with one product."; +$lang->project->noticeDivsion = "The current project is a single stage, click [Open] to change to multiple stages, each stage is only associated with one product."; $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/zh-cn.php b/module/project/lang/zh-cn.php index 15b35b67f5..281c86d8e5 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -193,6 +193,9 @@ $lang->project->typeList['other'] = '其他项目'; $lang->project->divisionList['0'] = '按项目创建'; $lang->project->divisionList['1'] = "按{$lang->productCommon}创建"; +$lang->project->divisionSwitchList['0'] = '关闭'; +$lang->project->divisionSwitchList['1'] = "开启"; + $lang->project->waitProjects = '未开始的项目'; $lang->project->doingProjects = '进行中的项目'; $lang->project->doingExecutions = '进行中的执行(最近1个)'; @@ -208,7 +211,7 @@ $lang->project->changeProgram = '%s > 修改项目集'; $lang->project->changeProgramTip = '修改项目集后,该项目关联产品的项目集也会被修改,请确认是否修改。'; $lang->project->linkedProjectsTip = '关联的项目如下'; $lang->project->multiLinkedProductsTip = '该项目关联的如下产品还关联了其他项目,请取消关联后再操作'; -$lang->project->noticeDivsion = "当前项目为单套阶段,点击[按项目创建]可以变为多套阶段,每套阶段只关联一个{$lang->productCommon}。"; +$lang->project->noticeDivsion = "当前项目为单套阶段,点击[开启]可以变为多套阶段,每套阶段只关联一个{$lang->productCommon}。"; $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/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index 5bac169764..6cdaa40177 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -136,7 +136,7 @@ division and count($linkedProducts) == 1):?> project->noticeDivsion);?> -project->divisionList);?> +project->divisionSwitchList);?>