From c1300115e711c30881ff8d3ecda1e2d74f478440 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Thu, 15 Sep 2022 09:29:17 +0800 Subject: [PATCH] * Code for task #69026/69027. --- db/update17.6.1.sql | 2 +- module/block/control.php | 1 + module/block/view/scrumtestblock.html.php | 4 ++-- module/execution/control.php | 9 +++++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/db/update17.6.1.sql b/db/update17.6.1.sql index 6c2f458e73..9846b7562f 100644 --- a/db/update17.6.1.sql +++ b/db/update17.6.1.sql @@ -1,2 +1,2 @@ ALTER TABLE `zt_product` ADD `shadow` tinyint(1) unsigned NOT NULL AFTER `code`; -ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL AFTER `code`; +ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL DEFAULT 1 AFTER `code`; diff --git a/module/block/control.php b/module/block/control.php index 668d64ac3a..5d49b33c6d 100755 --- a/module/block/control.php +++ b/module/block/control.php @@ -1503,6 +1503,7 @@ class block extends control $count = zget($this->params, 'count', 10); $status = isset($this->params->type) ? $this->params->type : 'wait'; + $this->view->project = $this->loadModel('project')->getByID($this->session->project); $this->view->testtasks = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName') ->from(TABLE_TESTTASK)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') diff --git a/module/block/view/scrumtestblock.html.php b/module/block/view/scrumtestblock.html.php index 4f28fd1c7f..6224d739e0 100644 --- a/module/block/view/scrumtestblock.html.php +++ b/module/block/view/scrumtestblock.html.php @@ -18,7 +18,7 @@ testtask->name;?> - + hasProduct):?> testtask->product;?> @@ -39,7 +39,7 @@ ?> > name);?> - + hasProduct):?> productName);?> diff --git a/module/execution/control.php b/module/execution/control.php index dea8b3e57b..6eeeddbe7e 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -630,7 +630,10 @@ class execution extends control $bugs = $this->execution->getSearchBugs($products, $executionID, $bugQuery, $pager, 'id_desc'); } - /* Build the search form. */ + $execution = $this->execution->getByID($executionID); + $project = $this->loadModel('project')->getByID($execution->project); + + /* Build the search form. */ $this->config->bug->search['actionURL'] = $this->createLink('execution', 'importBug', "executionID=$executionID&browseType=bySearch¶m=myQueryID"); $this->config->bug->search['queryID'] = $queryID; if(!empty($products)) @@ -674,6 +677,8 @@ class execution extends control unset($this->config->bug->search['fields']['resolvedDate']); unset($this->config->bug->search['fields']['closedDate']); unset($this->config->bug->search['fields']['branch']); + if(!$project->hasProduct) unset($this->config->bug->search['fields']['product']); + unset($this->config->bug->search['params']['resolvedBy']); unset($this->config->bug->search['params']['closedBy']); unset($this->config->bug->search['params']['status']); @@ -697,7 +702,7 @@ class execution extends control $this->view->browseType = $browseType; $this->view->param = $param; $this->view->users = $users; - $this->view->execution = $this->execution->getByID($executionID); + $this->view->execution = $execution; $this->view->executionID = $executionID; $this->view->requiredFields = explode(',', $this->config->task->create->requiredFields); $this->display();