diff --git a/module/bug/control.php b/module/bug/control.php index 31a22977b5..a677d1bcb6 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1421,10 +1421,11 @@ class bug extends control * * @param string $productID * @param string $orderBy + * @param string $browseType * @access public * @return void */ - public function export($productID, $orderBy) + public function export($productID, $orderBy, $browseType = '') { if($_POST) { @@ -1603,6 +1604,18 @@ class bug extends control $this->fetch('file', 'export2' . $this->post->fileType, $_POST); } + $fileName = $this->lang->bug->common; + $productName = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch('name'); + if(isset($this->lang->bug->featureBar['browse'][$browseType])) + { + $browseType = $this->lang->bug->featureBar['browse'][$browseType]; + } + else + { + $browseType = $this->lang->bug->moreSelects[$browseType]; + } + + $this->view->fileName = $productName . $this->lang->dash . $browseType . $fileName; $this->view->allExportFields = $this->config->bug->list->exportFields; $this->view->customExport = true; $this->display(); diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 5a47f96f91..b0a4281607 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -129,7 +129,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 12e86a966a..b99b142c6a 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -18,6 +18,7 @@ $lang->downArrow = '↓'; $lang->null = 'null'; $lang->ellipsis = '…'; $lang->percent = '%'; +$lang->dash = '-'; $lang->zentaoPMS = 'ZenTao'; $lang->welcome = "%s PMS"; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 5abfe88a64..b38d24a877 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -18,6 +18,7 @@ $lang->downArrow = '↓'; $lang->null = '空'; $lang->ellipsis = '…'; $lang->percent = '%'; +$lang->dash = '-'; $lang->zentaoPMS = '禅道'; $lang->welcome = "%s项目管理系统"; diff --git a/module/file/view/export.html.php b/module/file/view/export.html.php index dd94d5819a..7de5044b7e 100644 --- a/module/file/view/export.html.php +++ b/module/file/view/export.html.php @@ -156,7 +156,7 @@ if($isCustomExport) file->fileName;?> - file->untitled}'");?> + file->untitled}'");?> diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 2a08b4fd6e..f5a4ad6f79 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -97,7 +97,7 @@ diff --git a/module/story/control.php b/module/story/control.php index ebdd26f07e..bc5dd02993 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1370,10 +1370,11 @@ class story extends control * @param int $productID * @param string $orderBy * @param int $projectID + * @param string $browseType * @access public * @return void */ - public function export($productID, $orderBy, $projectID = 0) + public function export($productID, $orderBy, $projectID = 0, $browseType = '') { /* format the fields of every story in order to export data. */ if($_POST) @@ -1582,6 +1583,28 @@ class story extends control $this->fetch('file', 'export2' . $this->post->fileType, $_POST); } + $fileName = $this->lang->story->common; + if($projectID) + { + $projectName = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch('name'); + $fileName = $projectName . $this->lang->dash . $fileName; + } + else + { + $productName = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch('name'); + if(isset($this->lang->product->featureBar['browse'][$browseType])) + { + $browseType = $this->lang->product->featureBar['browse'][$browseType]; + } + else + { + $browseType = isset($this->lang->product->moreSelects[$browseType]) ? $this->lang->product->moreSelects[$browseType] : ''; + } + + $fileName = $productName . $this->lang->dash . $browseType . $fileName; + } + + $this->view->fileName = $fileName; $this->view->allExportFields = $this->config->story->list->exportFields; $this->view->customExport = true; $this->display(); diff --git a/module/task/control.php b/module/task/control.php index c7670f1f57..27fed012a2 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1431,6 +1431,19 @@ class task extends control $this->fetch('file', 'export2' . $this->post->fileType, $_POST); } + $this->app->loadLang('project'); + $fileName = $this->lang->task->common; + $projectName = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch('name'); + if(isset($this->lang->project->featureBar['task'][$type])) + { + $browseType = $this->lang->project->featureBar['task'][$type]; + } + else + { + $browseType = isset($this->lang->project->statusSelects[$type]) ? $this->lang->project->statusSelects[$type] : ''; + } + + $this->view->fileName = $projectName . $this->lang->dash . $browseType . $fileName; $this->view->allExportFields = $allExportFields; $this->view->customExport = true; $this->view->orderBy = $orderBy; diff --git a/module/testcase/control.php b/module/testcase/control.php index e9ff779fb5..cf871bb1ae 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1009,10 +1009,11 @@ class testcase extends control * @param int $productID * @param string $orderBy * @param int $taskID + * @param string $browseType * @access public * @return void */ - public function export($productID, $orderBy, $taskID = 0) + public function export($productID, $orderBy, $taskID = 0, $browseType = '') { $product = $this->loadModel('product')->getById($productID); if($product->type != 'normal') $this->lang->testcase->branch = $this->lang->product->branchName[$product->type]; @@ -1192,6 +1193,11 @@ class testcase extends control $this->fetch('file', 'export2' . $this->post->fileType, $_POST); } + $fileName = $this->lang->testcase->common; + $productName = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch('name'); + $browseType = isset($this->lang->testcase->featureBar['browse'][$browseType]) ? $this->lang->testcase->featureBar['browse'][$browseType] : ''; + + $this->view->fileName = $productName . $this->lang->dash . $browseType . $fileName; $this->view->allExportFields = $this->config->testcase->exportFields; $this->view->customExport = true; $this->display(); diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index 351d4b986e..6a24c0ac48 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -125,7 +125,7 @@