Merge branch 'feedback_lyk_953' into 'master'
* Fix export excel bugs. See merge request easycorp/zentaopms!5480
This commit is contained in:
@@ -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 = '';
|
||||
}
|
||||
|
||||
@@ -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¶m=$param&storyType=$storyType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user