From e3658d178f10ac150259eb44c59267682d96c630 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Sun, 9 Oct 2022 09:04:06 +0800 Subject: [PATCH] * code for task #71601. --- module/block/control.php | 24 +++++++++++++++++++++--- module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/zh-cn.php | 1 + 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index 911c88a11f..6dc5b008e6 100755 --- a/module/block/control.php +++ b/module/block/control.php @@ -856,14 +856,32 @@ class block extends control $productIdList = array(); foreach($productStats as $product) $productIdList[] = $product->id; - $this->view->executions = $this->dao->select('t1.product,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1') + $this->app->loadLang('project'); + $executions = $this->dao->select('t1.product,t2.id,t2.project,t2.name,t2.multiple')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') ->where('t1.product')->in($productIdList) ->andWhere('t2.type')->in('stage,sprint') - ->andWhere('t2.multiple')->eq('1') ->andWhere('t2.deleted')->eq(0) ->orderBy('t1.project') - ->fetchPairs('product', 'name'); + ->fetchAll('product'); + + $executionPairs = array(); + $noMultiples = array(); + foreach($executions as $execution) + { + if(empty($execution->multiple)) $noMultiples[$execution->product] = $execution->project; + $executionPairs[$execution->product] = $execution->name; + } + if($noMultiples) + { + $noMultipleProjects = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($noMultiples)->fetchPairs('id', 'name'); + foreach($noMultiples as $productID => $projectID) + { + if(isset($noMultipleProjects[$projectID])) $executionPairs[$productID] = $noMultipleProjects[$projectID] . "({$this->lang->project->noMultiple})"; + } + } + + $this->view->executions = $executionPairs; $this->view->productStats = $productStats; } diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 1fdc21cf66..d8a74a642e 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -64,6 +64,7 @@ $lang->project->budgetNumber = '『Budget』must be numbers.'; $lang->project->budgetGe0 = '『Budget』must be greater than or equal to 0.'; $lang->project->allProjects = 'All Projects'; $lang->project->ignore = 'Ignore'; +$lang->project->noMultiple = 'Project of disable iteration'; /* Fields. */ $lang->project->common = 'Project'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 36746735c2..ac76aeaaf7 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -64,6 +64,7 @@ $lang->project->budgetNumber = '『Budget』must be numbers.'; $lang->project->budgetGe0 = '『Budget』must be greater than or equal to 0.'; $lang->project->allProjects = 'All Projects'; $lang->project->ignore = 'Ignore'; +$lang->project->noMultiple = 'Project of disable iteration'; /* Fields. */ $lang->project->common = 'Project'; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index aaaddff0e8..285fda6969 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -64,6 +64,7 @@ $lang->project->budgetNumber = '『Budget』must be numbers.'; $lang->project->budgetGe0 = '『Budget』must be greater than or equal to 0.'; $lang->project->allProjects = 'All Projects'; $lang->project->ignore = 'Ignorer'; +$lang->project->noMultiple = 'Project of disable iteration'; /* Fields. */ $lang->project->common = 'Projets'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 5d58d05e70..b4e9836ef7 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -64,6 +64,7 @@ $lang->project->budgetNumber = '『预算』金额必须为数字。'; $lang->project->budgetGe0 = '『预算』金额必须大于等于0。'; $lang->project->allProjects = '所有项目'; $lang->project->ignore = '忽略'; +$lang->project->noMultiple = '不启用迭代的项目'; /* Fields. */ $lang->project->common = '项目';