Merge branch 'feedback_lyk_953' into 'master'

* Fix export excel bugs.

See merge request easycorp/zentaopms!5480
This commit is contained in:
孙广明
2022-09-23 05:09:48 +00:00
3 changed files with 23 additions and 1 deletions
+5 -1
View File
@@ -554,6 +554,10 @@ class portModel extends model
if(!empty($pairs[0])) $valuePairs[$value[$pairs[0]]] = $value[$pairs[1]];
}
$values = $valuePairs;
if(reset($values))
{
if(current($values) or (current($values) == 0)) $values[0] = '';
}
}
return $values;
@@ -624,7 +628,7 @@ class portModel extends model
}
/* if value = 0 or value = 0000:00:00 set value = ''*/
if(helper::isZeroDate($value))
if(helper::isZeroDate($rows[$id]->$field))
{
$rows[$id]->$field = '';
}
+4
View File
@@ -37,6 +37,10 @@ class projectStory extends control
public function story($projectID = 0, $productID = 0, $branch = 0, $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->products = $this->loadModel('product')->getProductPairsByProject($projectID);
/* Set product list for export. */
$this->session->set('exportProductList', $this->products);
if(empty($this->products)) return print($this->locate($this->createLink('product', 'showErrorNone', 'moduleName=project&activeMenu=story&projectID=' . $projectID)));
echo $this->fetch('product', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&storyType=$storyType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
}
+14
View File
@@ -2528,6 +2528,20 @@ class story extends control
{
$this->session->set('storyPortParams', array('productID' => $productID, 'executionID' => $executionID));
/* Create field lists. */
if(!$productID)
{
$this->config->story->datatable->fieldList['branch']['dataSource'] = array('module' => 'branch', 'method' => 'getAllPairs', 'params' => 1);
$this->config->story->datatable->fieldList['module']['dataSource']['method'] = 'getAllModulePairs';
$this->config->story->datatable->fieldList['module']['dataSource']['params'] = 'story';
$this->config->story->datatable->fieldList['project']['dataSource'] = array('module' => 'project', 'method' => 'getPairsByIdList', 'params' => $executionID);
$this->config->story->datatable->fieldList['execution']['dataSource'] = array('module' => 'execution', 'method' => 'getPairs', 'params' => $executionID);
$productIdList = implode(',', array_flip($this->session->exportProductList));
$this->config->story->datatable->fieldList['plan']['dataSource'] = array('module' => 'productplan', 'method' => 'getPairs', 'params' => $productIdList);
}
$this->post->set('rows', $this->story->getExportStorys($executionID, $orderBy));
$this->fetch('port', 'export', 'model=story');
}