From e661948d675737b7f131e89be2c15a36ac8b2a65 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 09:21:05 +0800 Subject: [PATCH 1/5] * Finish story #32879,#32887,#32935,#32934. --- module/common/lang/menu.php | 12 +++++++++--- module/execution/model.php | 3 +++ module/project/model.php | 9 ++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index f0027aabb1..a5effd5d81 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -291,9 +291,15 @@ $lang->waterfall->menu->design['subMenu']->ads = array('link' => "{$lang->d $lang->waterfall->menu->design['subMenu']->bysearch = array('link' => ' ' . $lang->searchAB . ''); /* Kanban project menu. */ -$lang->kanban->menu = new stdclass(); -$lang->kanban->menuOrder = array(); -$lang->kanban->dividerMenu = ''; +$lang->kanbanProject = new stdclass(); +$lang->kanbanProject->menu = new stdclass(); +$lang->kanbanProject->menu->index = array('link' => "{$lang->kanban->common}|project|index|project=%s"); +$lang->kanbanProject->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); + +$lang->kanbanProject->menuOrder = array(); +$lang->kanbanProject->menuOrder[5] = 'index'; +$lang->kanbanProject->menuOrder[10] = 'build'; +$lang->kanbanProject->dividerMenu = ''; /* Execution menu. */ $lang->execution->homeMenu = new stdclass(); diff --git a/module/execution/model.php b/module/execution/model.php index 5f8e1727b2..482348b260 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -67,6 +67,9 @@ class executionModel extends model if($execution and $execution->type == 'kanban') { $this->lang->execution->menu = new stdclass(); + $this->lang->execution->menu->kanban = array('link' => "{$this->lang->kanban->common}|execution|kanban|executionID=%s"); + $this->lang->execution->menu->build = array('link' => "{$this->lang->build->common}|execution|build|executionID=%s"); + $this->lang->execution->dividerMenu = ''; $this->lang->execution->accessDenied = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->accessDenied); } diff --git a/module/project/model.php b/module/project/model.php index 86027b4422..4e2373a169 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2483,7 +2483,14 @@ class projectModel extends model $project = $this->getByID($objectID); $model = 'scrum'; - if($project) $model = $project->model; + if($project and $project->model == 'waterfall') $model = $project->model; + if($project and $project->model == 'kanban') + { + $model = $project->model . 'Project'; + + global $lang; + $lang->executionCommon = $lang->project->kanban; + } if(isset($lang->$model)) { From d58008d99c1feb5b2f7b2d527cb700f1c25cc746 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 13:28:52 +0800 Subject: [PATCH 2/5] * Finish task #55684. --- module/build/model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/build/model.php b/module/build/model.php index 3283ec5786..b43b55adfb 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -544,10 +544,12 @@ class buildModel extends model if($type == 'browse') { $executionID = $tab == 'execution' ? $extraParams['executionID'] : $build->execution; + $execution = $this->loadModel('execution')->getByID($executionID); + $testtaskApp = (!empty($execution->type) and $execution->type == 'kanban') ? 'data-app="qa"' : "data-app='{$tab}'"; if(common::hasPriv('build', 'linkstory') and common::canBeChanged('build', $build)) $menu .= $this->buildMenu('build', 'view', "{$params}&type=story&link=true", $build, $type, 'link', '', '', '', "data-app={$tab}", $this->lang->build->linkStory); - $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id", $build, $type, 'bullhorn', '', '', '', "data-app='{$tab}'"); + $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id", $build, $type, 'bullhorn', '', '', '', $testtaskApp); if($tab == 'execution') $menu .= $this->buildMenu('execution', 'bug', "execution={$extraParams['executionID']}&productID={$extraParams['productID']}&orderBy=status&build=$build->id", $build, $type, '', '', '', '', $this->lang->execution->viewBug); if($tab == 'project') $menu .= $this->buildMenu('build', 'view', "{$params}&type=generatedBug", $build, $type, 'bug', '', '', '', "data-app='project'", $this->lang->project->bug); From 04d79592c4882f73a667b1de416955954f8ab62d Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 13:44:05 +0800 Subject: [PATCH 3/5] * Finish task #55684. --- module/testtask/control.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/testtask/control.php b/module/testtask/control.php index d295f3639d..6130e64327 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -248,6 +248,13 @@ class testtask extends control $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID); $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk'); + $execution = $this->loadModel('execution')->getByID($executionID); + if(!empty($execution) and $execution->type == 'kanban') + { + global $lang; + $this->lang->testtask->execution = str_replace($lang->execution->common, $lang->kanban->common, $this->lang->testtask->execution); + } + /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); From 1b89018e2f19389c0d27b1fafa9112be9db9fa92 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 13:55:59 +0800 Subject: [PATCH 4/5] * Optimized code for task #55684, #55683. --- module/project/model.php | 4 +--- module/testtask/control.php | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 4e2373a169..6f00881165 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2486,9 +2486,7 @@ class projectModel extends model if($project and $project->model == 'waterfall') $model = $project->model; if($project and $project->model == 'kanban') { - $model = $project->model . 'Project'; - - global $lang; + $model = $project->model . 'Project'; $lang->executionCommon = $lang->project->kanban; } diff --git a/module/testtask/control.php b/module/testtask/control.php index 6130e64327..8d29af46bc 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -249,11 +249,7 @@ class testtask extends control $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk'); $execution = $this->loadModel('execution')->getByID($executionID); - if(!empty($execution) and $execution->type == 'kanban') - { - global $lang; - $this->lang->testtask->execution = str_replace($lang->execution->common, $lang->kanban->common, $this->lang->testtask->execution); - } + if(!empty($execution) and $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution); /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); From ad8459599203928325558cc0428bb398580ddd80 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 14:00:13 +0800 Subject: [PATCH 5/5] * Optimized code for task #55683. --- module/project/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/project/model.php b/module/project/model.php index 6f00881165..54e445c67c 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2486,7 +2486,8 @@ class projectModel extends model if($project and $project->model == 'waterfall') $model = $project->model; if($project and $project->model == 'kanban') { - $model = $project->model . 'Project'; + $model = $project->model . 'Project'; + $lang->executionCommon = $lang->project->kanban; }