From ed17f3b7bb04a532a6d7cf7c0267939b1d1294c1 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 18 Mar 2022 05:17:53 +0000 Subject: [PATCH 1/2] * Finish task#51105,51102 --- module/action/lang/en.php | 2 +- module/action/lang/zh-cn.php | 2 +- module/bug/control.php | 4 ++-- module/tutorial/model.php | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 589c12de13..8849e59bd2 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -644,7 +644,7 @@ $lang->action->label->kanbancolumn = 'Kanban Column|execution|kanban|execution=% $lang->action->label->kanbanlane = 'Kanban Lane|execution|kanban|execution=%s&type=all'; $lang->action->label->kanbancard = 'Kanban Card|kanban|view|kanbanID=%s'; $lang->action->label->mr = 'Merge Request|mr|view|id=%s'; -$lang->action->label->gitlab = 'GitLab|gitlab|view|id=%s'; +$lang->action->label->gitlab = 'GitLab Server|gitlab|view|id=%s'; /* Object type. */ $lang->action->search = new stdclass(); diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 0a9ffaa025..9b277451d7 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -644,7 +644,7 @@ $lang->action->label->kanbancolumn = '看板列|execution|kanban|execution=%s'; $lang->action->label->kanbanlane = '看板泳道|execution|kanban|execution=%s&type=all'; $lang->action->label->kanbancard = '看板卡片|kanban|view|kanbanID=%s'; $lang->action->label->mr = '合并请求|mr|view|id=%s'; -$lang->action->label->gitlab = 'GitLab|gitlab|view|id=%s'; +$lang->action->label->gitlab = 'GitLab服务器|gitlab|view|id=%s'; /* Object type. */ $lang->action->search = new stdclass(); diff --git a/module/bug/control.php b/module/bug/control.php index 77185c8bad..319170fd80 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -612,9 +612,9 @@ class bug extends control $this->view->productName = isset($this->products[$productID]) ? $this->products[$productID] : ''; $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->stories = $stories; - $this->view->projects = $projects; + $this->view->projects = defined('TUTORIAL') ? $this->loadModel('tutorial')->getProject() : $projects; $this->view->project = $project; - $this->view->executions = $executions; + $this->view->executions = defined('TUTORIAL') ? $this->loadModel('tutorial')->getExecutionPairs() : $executions; $this->view->builds = $builds; $this->view->moduleID = (int)$moduleID; $this->view->projectID = $projectID; diff --git a/module/tutorial/model.php b/module/tutorial/model.php index 150a7d7666..c291004054 100644 --- a/module/tutorial/model.php +++ b/module/tutorial/model.php @@ -275,6 +275,7 @@ class tutorialModel extends model $execution->name = 'Test execution'; $execution->code = 'test'; $execution->lifetime = ''; + $execution->attribute = ''; $execution->begin = date('Y-m-d', strtotime('-7 days')); $execution->end = date('Y-m-d', strtotime('+7 days')); $execution->days = 10; From d048268f4d4c0a742f25bcc9dd0b567f6136aafe Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 18 Mar 2022 06:20:44 +0000 Subject: [PATCH 2/2] * Finish task#51106 --- module/tree/model.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/tree/model.php b/module/tree/model.php index bde165aa6e..a67643938f 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -124,7 +124,15 @@ class treeModel extends model public function getOptionMenu($rootID, $type = 'story', $startModule = 0, $branch = 0) { if(empty($branch)) $branch = 0; - if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getModulePairs(); + if(defined('TUTORIAL')) + { + $modulePairs = $this->loadModel('tutorial')->getModulePairs(); + if(!is_array($branch)) return $modulePairs; + + $modules = array(); + foreach($branch as $b) $modules[$b] = $modulePairs; + return $modules; + } /* If type of $branch is array, get modules of these branches. */ if(gettype($branch) == 'array')