From 164cca5ffe2121df24dafdbfa18a5674d626a046 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 21 Dec 2022 10:31:46 +0800 Subject: [PATCH] * code task #80451. --- module/bug/control.php | 13 ++++++++----- module/project/view/build.html.php | 2 +- module/story/control.php | 2 +- module/transfer/model.php | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 3dfb211290..874b8389b4 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -2345,15 +2345,18 @@ class bug extends control { $this->loadModel('transfer'); $this->session->set('bugTransferParams', array('productID' => $productID, 'executionID' => $executionID, 'branch' => 'all')); - if(!$productID) + if(!$productID or $browseType == 'bysearch') { $this->config->bug->datatable->fieldList['module']['dataSource']['method'] = 'getAllModulePairs'; $this->config->bug->datatable->fieldList['module']['dataSource']['params'] = 'bug'; - $object = $this->dao->findById($executionID)->from(TABLE_EXECUTION)->fetch(); - $projectID = $object->type == 'project' ? $object->id : $object->parent; - $this->config->bug->datatable->fieldList['project']['dataSource'] = array('module' => 'project', 'method' => 'getPairsByIdList', 'params' => $projectID); - $this->config->bug->datatable->fieldList['execution']['dataSource'] = array('module' => 'execution', 'method' => 'getPairs', 'params' => $projectID); + if($executionID) + { + $object = $this->dao->findById($executionID)->from(TABLE_EXECUTION)->fetch(); + $projectID = $object->type == 'project' ? $object->id : $object->parent; + $this->config->bug->datatable->fieldList['project']['dataSource'] = array('module' => 'project', 'method' => 'getPairsByIdList', 'params' => $projectID); + $this->config->bug->datatable->fieldList['execution']['dataSource'] = array('module' => 'execution', 'method' => 'getPairs', 'params' => $projectID); + } } $this->transfer->export('bug'); diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 58aeb65870..b4f70f7c3c 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -89,7 +89,7 @@ executionDeleted) $executionName = "$executionName";?> executionDeleted):?> - build->deleted;?> + build->deleted;?> diff --git a/module/story/control.php b/module/story/control.php index ae93eff8be..b5bbe25816 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -2839,7 +2839,7 @@ class story extends control { $this->session->set('storyTransferParams', array('productID' => $productID, 'executionID' => $executionID)); /* Create field lists. */ - if(!$productID) + if(!$productID or $browseType == 'bysearch') { $this->config->story->datatable->fieldList['branch']['dataSource'] = array('module' => 'branch', 'method' => 'getAllPairs', 'params' => 1); $this->config->story->datatable->fieldList['module']['dataSource']['method'] = 'getAllModulePairs'; diff --git a/module/transfer/model.php b/module/transfer/model.php index c9172785c8..8c0f856ed7 100644 --- a/module/transfer/model.php +++ b/module/transfer/model.php @@ -649,7 +649,7 @@ class transferModel extends model { foreach($values as $field => $value) { - if($fieldList[$field]['from'] == 'workflow') continue; + if(isset($fieldList[$field]['from']) and $fieldList[$field]['from'] == 'workflow') continue; if(in_array($field, $dataSourceList)) { if($fieldList[$field]['control'] == 'multiple')