From fc2bd0bbdc6bd792cd874c9b6def0727da092db0 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 4 Mar 2022 11:00:58 +0800 Subject: [PATCH] * Fix bug #20307,18089. --- module/my/control.php | 34 ++++++++++++++++---------------- module/my/view/task.html.php | 8 ++++++-- module/testreport/lang/zh-cn.php | 2 +- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 8c62335e4c..95d130dc23 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -419,10 +419,10 @@ EOF; if($this->config->systemMode == 'new') { - $projectPairs = $this->dao->select('t2.id,t1.name')->from(TABLE_PROJECT)->alias('t1') + $projects = $this->dao->select('t1.id,t1.name,t2.id as execution')->from(TABLE_PROJECT)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.id=t2.parent') ->where('t2.id')->in($executionIDList) - ->fetchPairs(); + ->fetchAll('execution'); } foreach($tasks as $task) @@ -446,21 +446,21 @@ EOF; $this->app->loadLang('story'); /* Assign. */ - $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->task; - $this->view->position[] = $this->lang->my->task; - $this->view->tabID = 'task'; - $this->view->tasks = $tasks; - $this->view->summary = $this->loadModel('execution')->summary($tasks); - $this->view->type = $type; - $this->view->kanbanList = $this->execution->getPairs(0, 'kanban'); - $this->view->recTotal = $recTotal; - $this->view->recPerPage = $recPerPage; - $this->view->pageID = $pageID; - $this->view->orderBy = $orderBy; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->pager = $pager; - $this->view->mode = 'task'; - $this->view->projectPairs = isset($projectPairs) ? $projectPairs : array(); + $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->task; + $this->view->position[] = $this->lang->my->task; + $this->view->tabID = 'task'; + $this->view->tasks = $tasks; + $this->view->summary = $this->loadModel('execution')->summary($tasks); + $this->view->type = $type; + $this->view->kanbanList = $this->execution->getPairs(0, 'kanban'); + $this->view->recTotal = $recTotal; + $this->view->recPerPage = $recPerPage; + $this->view->pageID = $pageID; + $this->view->orderBy = $orderBy; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->pager = $pager; + $this->view->mode = 'task'; + $this->view->projects = isset($projects) ? $projects : array(); if($this->app->viewType == 'json') $this->view->tasks = array_values($this->view->tasks); $this->display(); diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index 535768923a..3b179cac85 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -100,7 +100,9 @@ children)) echo '';?> systemMode == 'new'):?> - createLink('project', 'index', "projectID=$task->project"), zget($projectPairs, $task->execution, ''));?> + execution]->name) ? $projects[$task->execution]->name : '';?> + execution]->id) ? $projects[$task->execution]->id : 0;?> + createLink('project', 'index', "projectID=$projectID"), $projectName);?> createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '');?> @@ -166,7 +168,9 @@ createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color'");?> systemMode == 'new'):?> - createLink('project', 'view', "projectID=$child->project"), $child->projectName);?> + execution]->name) ? $projects[$child->execution]->name : '';?> + execution]->id) ? $projects[$child->execution]->id : 0;?> + createLink('project', 'view', "projectID=$projectID"), $projectName);?> createLink('execution', 'task', "executionID=$child->project"), $child->executionName, '');?> diff --git a/module/testreport/lang/zh-cn.php b/module/testreport/lang/zh-cn.php index 2d56c39626..f03d1f3853 100644 --- a/module/testreport/lang/zh-cn.php +++ b/module/testreport/lang/zh-cn.php @@ -81,7 +81,7 @@ $lang->testreport->legacyBugTip = "Bug状态是激活,或Bug的解决时间 $lang->testreport->activatedBugTip = "在测试单时间范围内被激活的Bug数量。"; $lang->testreport->fromCaseBugTip = "测试时间范围内,用例执行失败后创建的Bug。"; $lang->testreport->errorTrunk = "主干版本不能创建测试报告,请修改关联版本!"; -$lang->testreport->noTestTask = "该{$lang->productCommon}下还没有关联非Trunk的测试单,不能创建报告。请先创建测试单,再创建。"; +$lang->testreport->noTestTask = "该{$lang->productCommon}下还没有关联的测试单,不能创建报告。请先创建测试单,再创建。"; $lang->testreport->noObjectID = "没有选定测试单或{$lang->executionCommon},无法创建测试报告!"; $lang->testreport->moreProduct = "只能对同一个{$lang->productCommon}生成测试报告。"; $lang->testreport->hiddenCase = "隐藏 %s 个用例";