From a35032c35f73562e9a3cb77adce26208e16667c9 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 1 Jun 2021 14:30:38 +0800 Subject: [PATCH 1/5] * Fix bug #12781. --- module/my/control.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/my/control.php b/module/my/control.php index 3b8db82b08..93b7db6e7b 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -181,7 +181,11 @@ class my extends control public function story($type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session. */ - if($this->app->viewType != 'json') $this->session->set('storyList', $this->app->getURI(true), 'product'); + if($this->app->viewType != 'json') + { + $this->session->set('storyList', $this->app->getURI(true), 'product'); + $this->session->set('storyList', $this->app->getURI(true), 'my'); + } /* Load pager. */ $this->app->loadClass('pager', $static = true); From 6957fa70a4ac2f3d31d740a67c67424b60a0486a Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 1 Jun 2021 14:31:11 +0800 Subject: [PATCH 2/5] * Adjust code style. --- module/product/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/model.php b/module/product/model.php index e85063ac07..82e1511268 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -507,7 +507,7 @@ class productModel extends model ->remove('uid,newLine,lineName') ->get(); - if(!empty($this->post->lineName)) + if(!empty($_POST['lineName'])) { /* Insert product line. */ $maxOrder = $this->dao->select("max(`order`) as maxOrder")->from(TABLE_MODULE)->where('type')->eq('line')->fetch('maxOrder'); From 27538bc0179661c097df27eedb92264bf5614953 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Tue, 1 Jun 2021 14:38:09 +0800 Subject: [PATCH 3/5] * Finish task#38637. --- module/common/lang/menu.php | 4 ++-- module/execution/control.php | 1 + module/execution/view/testtask.html.php | 2 +- module/project/view/testtask.html.php | 6 +++--- module/testreport/control.php | 11 +++++++---- module/testreport/model.php | 4 ++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 521eb0ceb2..0eeae40a93 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -182,10 +182,10 @@ $lang->project->homeMenu->browse = array('link' => ($config->systemMode == 'new' /* Scrum menu. */ $lang->scrum->menu = new stdclass(); $lang->scrum->menu->index = array('link' => "{$lang->dashboard}|project|index|project=%s"); -$lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|status=all&projectID=%s"); +$lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|status=all&projectID=%s", 'exclude' => 'execution-testreport'); $lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track'); $lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=project&objectID=%s", 'subModule' => 'doc'); -$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport'); +$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport,execution', 'alias' => 'bug,testtask,testcase,testreport'); $lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); $lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); $lang->scrum->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease'); diff --git a/module/execution/control.php b/module/execution/control.php index 660ac89976..e4020b911f 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -966,6 +966,7 @@ class execution extends control */ public function testreport($executionID = 0, $objectType = 'execution', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { + if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($this->session->project); echo $this->fetch('testreport', 'browse', "objectID=$executionID&objectType=$objectType&extra=$extra&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); } diff --git a/module/execution/view/testtask.html.php b/module/execution/view/testtask.html.php index 10a7a89016..00b651bb89 100644 --- a/module/execution/view/testtask.html.php +++ b/module/execution/view/testtask.html.php @@ -103,7 +103,7 @@ common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); if(common::hasPriv('execution', 'testreport')) { - echo html::a($this->createLink('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="qa"'); + echo html::a($this->createLink('execution', 'testreport', "executionID=$executionID&objctType=execution&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="execution"'); } common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'list', 'trash', 'hiddenwin'); diff --git a/module/project/view/testtask.html.php b/module/project/view/testtask.html.php index 742c9fd007..58a961ce5f 100644 --- a/module/project/view/testtask.html.php +++ b/module/project/view/testtask.html.php @@ -60,7 +60,7 @@ testtask->begin);?> testtask->end);?> statusAB);?> - actions;?> + text-center'>actions;?> @@ -92,9 +92,9 @@ { common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap'); common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); - if(common::hasPriv('execution', 'testreport')) + if(common::hasPriv('execution', 'testreport') and $project->model == 'scrum') { - echo html::a($this->createLink('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="qa"'); + echo html::a($this->createLink('execution', 'testreport', "executionID=$task->execution&objectType=execution&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="project"'); } common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'list', 'trash', 'hiddenwin'); diff --git a/module/testreport/control.php b/module/testreport/control.php index e13c21359a..2261c17c24 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -97,9 +97,9 @@ class testreport extends control $reports = $this->testreport->getList($objectID, $objectType, $extra, $orderBy, $pager); - if(strpos('project|execution', $objectType) !== false and isset($_POST['taskIdList'])) + if(strpos('project|execution', $objectType) !== false and ($extra or isset($_POST['taskIdList']))) { - $taskIdList = $_POST['taskIdList']; + $taskIdList = isset($_POST['taskIdList']) ? $_POST['taskIdList'] : array($extra); foreach($reports as $reportID => $report) { $tasks = explode(',', $report->tasks); @@ -114,8 +114,8 @@ class testreport extends control if($objectType == 'product' and $extra) $param = "objectID=$extra&objectType=testtask"; if(($objectType == 'project' or $objectType == 'execution') and ($extra or !empty($_POST['taskIdList']))) { - $param = "objectID=$objectID&objectType=$objectType"; - if(isset($_POST['taskIdList'])) $param .= '&extra=' . join(',', $_POST['taskIdList']); + $param = "objectID=$objectID&objectType=$objectType"; + $param .= isset($_POST['taskIdList']) ? '&extra=' . join(',', $_POST['taskIdList']) : '&extra=' . $extra; } if($param) $this->locate($this->createLink('testreport', 'create', $param)); } @@ -196,6 +196,9 @@ class testreport extends control $productID = $this->commonAction($task->product, 'product'); } $this->view->taskPairs = $taskPairs; + + if($this->app->openApp == 'execution') $this->execution->setMenu($task->execution); + if($this->app->openApp == 'project') $this->project->setMenu($task->project); } if(empty($objectID)) die(js::alert($this->lang->testreport->noObjectID) . js::locate('back')); diff --git a/module/testreport/model.php b/module/testreport/model.php index 08a686d8f7..c049c38052 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -115,8 +115,8 @@ class testreportModel extends model $objectID = (int)$objectID; return $this->dao->select('*')->from(TABLE_TESTREPORT) ->where('deleted')->eq(0) - ->beginIF($objectType == 'execution')->andWhere('objectID')->eq($objectID)->andWhere('objectType')->eq('execution')->fi() - ->beginIF($objectType == 'project')->andWhere('project')->eq($objectID)->andWhere('objectType')->eq('execution')->fi() + ->beginIF($objectType == 'execution')->andWhere('execution')->eq($objectID)->fi() + ->beginIF($objectType == 'project')->andWhere('project')->eq($objectID)->fi() ->beginIF($objectType == 'product' and $extra)->andWhere('objectID')->eq((int)$extra)->andWhere('objectType')->eq('testtask')->fi() ->beginIF($objectType == 'product' and empty($extra))->andWhere('product')->eq($objectID)->fi() ->orderBy($orderBy) From d98ea76e53b7cf0152593b38146b9c027505a803 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 1 Jun 2021 15:23:14 +0800 Subject: [PATCH 4/5] * Add historical record condition judgment. --- module/common/model.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index bb120dbde1..cb0c3d7740 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1399,9 +1399,12 @@ EOD; if(strtolower($key) == 'editedby') continue; if(strtolower($key) == 'editeddate') continue; if(strtolower($key) == 'uid') continue; - if(strtolower($key) == 'finisheddate' && $value == '') continue; - if(strtolower($key) == 'canceleddate' && $value == '') continue; - if(strtolower($key) == 'closeddate' && $value == '') continue; + if(strtolower($key) == 'finisheddate' && $value == '') continue; + if(strtolower($key) == 'canceleddate' && $value == '') continue; + if(strtolower($key) == 'hangupeddate' && $value == '') continue; + if(strtolower($key) == 'lastcheckeddate' && $value == '') continue; + if(strtolower($key) == 'activateddate' && $value == '') continue; + if(strtolower($key) == 'closeddate' && $value == '') continue; if(isset($old->$key) and $value != stripslashes($old->$key)) { From 0e7439591e60f09120273390fd9330a0515be2f6 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 1 Jun 2021 15:27:14 +0800 Subject: [PATCH 5/5] =?UTF-8?q?*=20Fix=20bug=20#12861.=20=20#=20=E8=AF=B7?= =?UTF-8?q?=E4=B8=BA=E6=82=A8=E7=9A=84=E5=8F=98=E6=9B=B4=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=B4=E6=98=8E=E3=80=82=E4=BB=A5=20'#'=20?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=9A=84=E8=A1=8C=E5=B0=86=E8=A2=AB=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=EF=BC=8C=E8=80=8C=E4=B8=80=E4=B8=AA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/story/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index 2436c7cdbc..a99c27539b 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2470,7 +2470,7 @@ class storyModel extends model ->fi() ->beginIF($execution->type != 'project') ->beginIF(!empty($productParam))->andWhere('t1.product')->eq($productParam)->fi() - ->beginIF($this->session->executionStoryBrowseType == 'unclosed')->andWhere('t2.status')->in(array_keys($unclosedStatus))->fi() + ->beginIF(strpos('changed|closed', $this->session->executionStoryBrowseType) !== false)->andWhere('t2.status')->in(array_keys($unclosedStatus))->fi() ->fi() ->beginIF($this->session->storyBrowseType == 'unclosed')->andWhere('t2.status')->in(array_keys($unclosedStatus))->fi() ->beginIF(!empty($branchParam))->andWhere('t2.branch')->eq($branchParam)->fi()