From 89a72fc20e86628e44b9a0265ad26e82269fecc2 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Thu, 29 Sep 2022 13:53:54 +0800 Subject: [PATCH] * Code for bug export bug. --- module/bug/control.php | 5 +++++ module/bug/model.php | 2 +- module/port/control.php | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index 935a039090..35430cbafe 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -2328,6 +2328,11 @@ class bug extends control $product = $this->loadModel('product')->getByID($productID); if($product->type == 'normal') $this->config->bug->exportFields = str_replace('branch,', '', $this->config->bug->exportFields); + if($this->app->tab == 'project' or $this->app->tab == 'execution') + { + if($product->shadow) $this->config->bug->exportFields = str_replace('product,', '', $this->config->bug->exportFields); + } + $fileName = $this->lang->bug->common; if($executionID) { diff --git a/module/bug/model.php b/module/bug/model.php index 6ba2f45fc1..5f13d0d3d5 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -3639,7 +3639,7 @@ class bugModel extends model public function getRelatedObjects($object, $pairs = '') { /* Get bugs. */ - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where($this->session->bugQueryCondition)->fetchAll('id'); + $bugs = $this->loadModel('port')->getQueryDatas('bug'); /* Get related objects id lists. */ $relatedObjectIdList = array(); diff --git a/module/port/control.php b/module/port/control.php index 9daa51ee2b..e5bf7d6739 100755 --- a/module/port/control.php +++ b/module/port/control.php @@ -169,6 +169,7 @@ class port extends control { $product = $this->loadModel('product')->getByID($this->session->bugPortParams['productID']); if($product->type == 'normal') unset($fields['branch']); + if($product->shadow and ($this->app->tab == 'execution' or $this->app->tab == 'project')) unset($fields['product']); } if($model == 'task') $datas = $this->task->processDatas4Task($datas); $html = $this->port->buildNextList($datas->datas, $lastID, $fields, $pagerID, $model);