* Modify the file name when export requirement.

This commit is contained in:
qiyu-xie
2021-02-07 16:38:41 +08:00
parent 600adeffa3
commit 73cc080ca2
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ $lang->story->createCommon = $storyType == 'story' ? $lang->story->createStory :
$openModule = $this->app->rawModule == 'projectstory' ? 'project' : 'product';
$class = common::hasPriv('story', 'export') ? '' : "class=disabled";
$misc = common::hasPriv('story', 'export') ? "class='export' data-group='$openModule'" : "class=disabled";
$link = common::hasPriv('story', 'export') ? $this->createLink('story', 'export', "productID=$productID&orderBy=$orderBy&projectID=0&browseType=$browseType") : '#';
$link = common::hasPriv('story', 'export') ? $this->createLink('story', 'export', "productID=$productID&orderBy=$orderBy&projectID=0&browseType=$browseType&type=$storyType") : '#';
echo "<li $class>" . html::a($link, $lang->story->export, '', $misc) . "</li>";
?>
</ul>
+3 -2
View File
@@ -1761,10 +1761,11 @@ class story extends control
* @param string $orderBy
* @param int $projectID
* @param string $browseType
* @param string $type requirement|story
* @access public
* @return void
*/
public function export($productID, $orderBy, $projectID = 0, $browseType = '')
public function export($productID, $orderBy, $projectID = 0, $browseType = '', $type = 'story')
{
/* format the fields of every story in order to export data. */
if($_POST)
@@ -2003,7 +2004,7 @@ class story extends control
$this->fetch('file', 'export2' . $this->post->fileType, $_POST);
}
$fileName = $this->lang->story->common;
$fileName = $type == 'requirement' ? $this->lang->URCommon : $this->lang->SRCommon;
if($projectID)
{
$projectName = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch('name');