From fdb61161d3cf0f9d7cfc27b8f99457722df47729 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 23 Sep 2022 10:48:06 +0800 Subject: [PATCH] * Fix export error for task #69596,69595. --- module/bug/control.php | 4 +++- module/port/lang/zh-cn.php | 2 +- module/testcase/config.php | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 9698139acb..935a039090 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -2325,6 +2325,8 @@ class bug extends control $this->port->export('bug'); $this->fetch('file', 'export2' . $_POST['fileType'], $_POST); } + $product = $this->loadModel('product')->getByID($productID); + if($product->type == 'normal') $this->config->bug->exportFields = str_replace('branch,', '', $this->config->bug->exportFields); $fileName = $this->lang->bug->common; if($executionID) @@ -2334,7 +2336,7 @@ class bug extends control } else { - $productName = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch('name'); + $productName = !empty($product->name) ? $product->name : ''; $browseType = isset($this->lang->bug->featureBar['browse'][$browseType]) ? $this->lang->bug->featureBar['browse'][$browseType] : zget($this->lang->bug->moreSelects, $browseType, ''); $fileName = $productName . $this->lang->dash . $browseType . $fileName; diff --git a/module/port/lang/zh-cn.php b/module/port/lang/zh-cn.php index 5fb74999b9..649ab708bc 100644 --- a/module/port/lang/zh-cn.php +++ b/module/port/lang/zh-cn.php @@ -10,7 +10,7 @@ $lang->port->reservedWord['code'] = '代号'; $lang->port->reservedWord['name'] = '名称'; $lang->port->reservedWord['title'] = '标题'; -$lang->port->importCase = '导入EXCEL'; +$lang->port->importCase = '导入Excel'; $lang->port->importNotice = '请先导出模板,按照模板格式填写数据后再导入。'; $lang->port->noRequire = '%s行的“ %s” 是必填字段,不能为空。'; $lang->port->exportTemplate = '导出模板'; diff --git a/module/testcase/config.php b/module/testcase/config.php index e98f7572be..410dae1093 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -88,9 +88,11 @@ $config->testcase->datatable->fieldList['id']['required'] = 'yes'; $config->testcase->datatable->fieldList['product']['title'] = 'priAB'; $config->testcase->datatable->fieldList['product']['control'] = 'hidden'; +$config->testcase->datatable->fieldList['product']['dataSource'] = array('module' => 'product', 'method' => 'getPairs', 'params' => '&0&&all'); $config->testcase->datatable->fieldList['module']['title'] = 'module'; $config->testcase->datatable->fieldList['module']['control'] = 'select'; +$config->testcase->datatable->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getOptionMenu', 'params' => '$productID&case'); $config->testcase->datatable->fieldList['pri']['title'] = 'priAB'; $config->testcase->datatable->fieldList['pri']['fixed'] = 'left'; @@ -107,6 +109,7 @@ $config->testcase->datatable->fieldList['branch']['title'] = 'branch'; $config->testcase->datatable->fieldList['branch']['fixed'] = 'left'; $config->testcase->datatable->fieldList['branch']['width'] = '100'; $config->testcase->datatable->fieldList['branch']['required'] = 'no'; +$config->testcase->datatable->fieldList['branch']['dataSource'] = array('module' => 'port', 'method' => 'getRelatedObjects', 'params' => 'testcase&branch&id,name'); $config->testcase->datatable->fieldList['type']['title'] = 'type'; $config->testcase->datatable->fieldList['type']['fixed'] = 'no'; @@ -202,6 +205,7 @@ $config->testcase->datatable->fieldList['story']['fixed'] = 'no'; $config->testcase->datatable->fieldList['story']['width'] = '90'; $config->testcase->datatable->fieldList['story']['required'] = 'no'; $config->testcase->datatable->fieldList['story']['control'] = 'select'; +$config->testcase->datatable->fieldList['story']['dataSource'] = array('module' => 'story', 'method' => 'getProductStoryPairs', 'params' => '$productID&$branch'); $config->testcase->datatable->fieldList['bugs']['title'] = 'B'; $config->testcase->datatable->fieldList['bugs']['fixed'] = 'no'; @@ -216,6 +220,7 @@ $config->testcase->datatable->fieldList['results']['width'] = '32'; $config->testcase->datatable->fieldList['results']['required'] = 'no'; $config->testcase->datatable->fieldList['results']['sort'] = 'no'; $config->testcase->datatable->fieldList['results']['name'] = $lang->testcase->results; +$config->testcase->datatable->fieldList['results']['dataSource'] = array('lang' => 'resultList'); $config->testcase->datatable->fieldList['stepNumber']['title'] = 'S'; $config->testcase->datatable->fieldList['stepNumber']['fixed'] = 'no';