From 11ca786545a53e502298bc52932697ccd77d56d2 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 8 Dec 2022 15:35:48 +0000 Subject: [PATCH] * Fix stories and bug when no associate. --- module/build/control.php | 15 +++++++-------- module/build/lang/de.php | 6 +++--- module/build/lang/en.php | 6 +++--- module/build/lang/fr.php | 6 +++--- module/build/lang/zh-cn.php | 8 ++++---- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index f13ca09759..947aa35603 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -715,8 +715,8 @@ class build extends control { $build = $this->build->getByID($buildID); $oldBranch = $build->branch; - $buildStories = $this->loadModel('story')->getByList($build->allStories); - $buildBugs = $this->loadModel('bug')->getByList($build->allBugs); + $buildStories = $build->allStories ? $this->loadModel('story')->getByList($build->allStories) : array(); + $buildBugs = $build->allBugs ? $this->loadModel('bug')->getByList($build->allBugs) : array(); $branchPairs = $this->loadModel('branch')->getPairs($build->product); $removeBranches = ''; @@ -742,22 +742,22 @@ class build extends control if($unlinkStoryCounts and $unlinkBugCounts) { - printf($this->lang->build->confirmChangeBuild, trim($removeBranches, ','), $unlinkStoryCounts, $unlinkBugCounts); + printf($this->lang->build->confirmChangeBuild, $this->lang->product->branchName[$build->productType], trim($removeBranches, ','), $unlinkStoryCounts, $unlinkBugCounts); } elseif($unlinkStoryCounts) { - printf($this->lang->build->confirmRemoveStory, trim($removeBranches, ','), $unlinkStoryCounts); + printf($this->lang->build->confirmRemoveStory, $this->lang->product->branchName[$build->productType], trim($removeBranches, ','), $unlinkStoryCounts); } elseif($unlinkBugCounts) { - printf($this->lang->build->confirmRemoveBug, trim($removeBranches, ','), $unlinkBugCounts); + printf($this->lang->build->confirmRemoveBug, $this->lang->product->branchName[$build->productType], trim($removeBranches, ','), $unlinkBugCounts); } } /** * Batch unlink story. * - * @param string $confirm + * @param int $buildID * @access public * @return void */ @@ -769,8 +769,7 @@ class build extends control /** * Unlink story and bug when edit branch of build. - * @param int $buildID - * @param int $oldBranch + * @param array $changes * @access protected * @return void */ diff --git a/module/build/lang/de.php b/module/build/lang/de.php index 7063290779..80f5a2d525 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -69,9 +69,9 @@ $lang->build->finishStories = " %s {$lang->SRCommon} sind abgeschlossen."; $lang->build->resolvedBugs = ' %s Bugs sind gelöst.'; $lang->build->createdBugs = ' %s Bugs wurden erstellt.'; -$lang->build->confirmChangeBuild = "After branch『%s』disassociation,the branch exists %s {$lang->SRCommon} and %s Bug will remove synchronization from version, whether to cancel?"; -$lang->build->confirmRemoveStory = "After branch『%s』disassociation,the branch exists %s {$lang->SRCommon} will remove synchronization from version, whether to cancel?"; -$lang->build->confirmRemoveBug = "After branch『%s』disassociation,the branch exists %s Bug will remove synchronization from version, whether to cancel?"; +$lang->build->confirmChangeBuild = "After branch『%s』disassociation,%s {$lang->SRCommon} and %s Bug will remove synchronization from version, whether to cancel?"; +$lang->build->confirmRemoveStory = "After branch『%s』disassociation,%s {$lang->SRCommon} will remove synchronization from version, whether to cancel?"; +$lang->build->confirmRemoveBug = "After branch『%s』disassociation,%s Bug will remove synchronization from version, whether to cancel?"; $lang->build->placeholder = new stdclass(); $lang->build->placeholder->scmPath = ' Source code repository, z.B. Subversion/Git Pfad'; diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 472e7c1b07..90358a0c6a 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -69,9 +69,9 @@ $lang->build->finishStories = " Finished {$lang->SRCommon} %s"; $lang->build->resolvedBugs = ' Resolved Bug %s'; $lang->build->createdBugs = ' Reported Bug %s'; -$lang->build->confirmChangeBuild = "After branch『%s』disassociation,the branch exists %s {$lang->SRCommon} and %s Bug will remove synchronization from version, whether to cancel?"; -$lang->build->confirmRemoveStory = "After branch『%s』disassociation,the branch exists %s {$lang->SRCommon} will remove synchronization from version, whether to cancel?"; -$lang->build->confirmRemoveBug = "After branch『%s』disassociation,the branch exists %s Bug will remove synchronization from version, whether to cancel?"; +$lang->build->confirmChangeBuild = "After branch『%s』disassociation,%s {$lang->SRCommon} and %s Bug will remove synchronization from version, whether to cancel?"; +$lang->build->confirmRemoveStory = "After branch『%s』disassociation,%s {$lang->SRCommon} will remove synchronization from version, whether to cancel?"; +$lang->build->confirmRemoveBug = "After branch『%s』disassociation,%s Bug will remove synchronization from version, whether to cancel?"; $lang->build->placeholder = new stdclass(); $lang->build->placeholder->scmPath = ' Source code repository, e.g. Subversion/Git Library path'; diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index 65d85299bb..3d5eebf778 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -69,9 +69,9 @@ $lang->build->finishStories = " {$lang->SRCommon} Terminées %s"; $lang->build->resolvedBugs = ' Bugs Résolus %s'; $lang->build->createdBugs = ' Bugs Signalés %s'; -$lang->build->confirmChangeBuild = "After branch『%s』disassociation,the branch exists %s {$lang->SRCommon} and %s Bug will remove synchronization from version, whether to cancel?"; -$lang->build->confirmRemoveStory = "After branch『%s』disassociation,the branch exists %s {$lang->SRCommon} will remove synchronization from version, whether to cancel?"; -$lang->build->confirmRemoveBug = "After branch『%s』disassociation,the branch exists %s Bug will remove synchronization from version, whether to cancel?"; +$lang->build->confirmChangeBuild = "After branch『%s』disassociation,%s {$lang->SRCommon} and %s Bug will remove synchronization from version, whether to cancel?"; +$lang->build->confirmRemoveStory = "After branch『%s』disassociation,%s {$lang->SRCommon} will remove synchronization from version, whether to cancel?"; +$lang->build->confirmRemoveBug = "After branch『%s』disassociation,%s Bug will remove synchronization from version, whether to cancel?"; $lang->build->placeholder = new stdclass(); $lang->build->placeholder->scmPath = ' Répertoire des codes sources, ex: chemin de la bibliothèque Subversion / GitSource'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index e0db140e9b..018193ffed 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -65,10 +65,10 @@ $lang->build->notice->changeBuilds = "提交测试单的版本,不能修改 $lang->build->notice->autoRelation = "相关版本下完成的需求、解决的Bug、产生的Bug将会自动关联到项目版本中"; $lang->build->notice->createTest = "该版本所属执行已删除,不能提交测试"; -$lang->build->confirmChangeBuild = "分支『%s』解除关联后,分支下的%s个{$lang->SRCommon}和%s个Bug将同步从版本移除,是否解除?"; -$lang->build->confirmRemoveStory = "分支『%s』解除关联后,分支下的%s个{$lang->SRCommon}将同步从计划中移除,是否解除?"; -$lang->build->confirmRemoveBug = "分支『%s』解除关联后,分支下的%s个Bug将同步从计划中移除,是否解除?"; -$lang->build->confirmRemoveTips = "确认删除分支『%s』吗?"; +$lang->build->confirmChangeBuild = "%s『%s』解除关联后,%s个{$lang->SRCommon}和%s个Bug将同步从版本移除,是否解除?"; +$lang->build->confirmRemoveStory = "%s『%s』解除关联后,%s个{$lang->SRCommon}将同步从计划中移除,是否解除?"; +$lang->build->confirmRemoveBug = "%s『%s』解除关联后,%s个Bug将同步从计划中移除,是否解除?"; +$lang->build->confirmRemoveTips = "确认删除%s『%s』吗?"; $lang->build->finishStories = " 本次共完成 %s 个{$lang->SRCommon}"; $lang->build->resolvedBugs = ' 本次共解决 %s 个Bug';