Fixed broken CSV export

This commit is contained in:
Frederic Guillot
2016-06-23 15:43:37 -04:00
parent 5939ae61d2
commit 95751f391f
2 changed files with 21 additions and 16 deletions

View File

@@ -5,6 +5,10 @@ Improvements:
* Make embedded documentation available in multiple languages * Make embedded documentation available in multiple languages
Bug fixes:
* Fixed broken CSV exports
Version 1.0.30 Version 1.0.30
-------------- --------------

View File

@@ -31,22 +31,23 @@ class ExportController extends BaseController
$data = $this->$model->$method($project['id'], $from, $to); $data = $this->$model->$method($project['id'], $from, $to);
$this->response->withFileDownload($filename.'.csv'); $this->response->withFileDownload($filename.'.csv');
$this->response->csv($data); $this->response->csv($data);
} } else {
$this->response->html($this->helper->layout->project('export/'.$action, array( $this->response->html($this->helper->layout->project('export/'.$action, array(
'values' => array( 'values' => array(
'controller' => 'ExportController', 'controller' => 'ExportController',
'action' => $action, 'action' => $action,
'project_id' => $project['id'], 'project_id' => $project['id'],
'from' => $from, 'from' => $from,
'to' => $to, 'to' => $to,
), ),
'errors' => array(), 'errors' => array(),
'date_format' => $this->configModel->get('application_date_format'), 'date_format' => $this->configModel->get('application_date_format'),
'date_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateFormats()), 'date_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateFormats()),
'project' => $project, 'project' => $project,
'title' => $page_title, 'title' => $page_title,
), 'export/sidebar')); ), 'export/sidebar'));
}
} }
/** /**
@@ -76,7 +77,7 @@ class ExportController extends BaseController
*/ */
public function summary() public function summary()
{ {
$this->common('projectDailyColumnStats', 'getAggregatedMetrics', t('Summary'), 'summary', t('Daily project summary export')); $this->common('projectDailyColumnStatsModel', 'getAggregatedMetrics', t('Summary'), 'summary', t('Daily project summary export'));
} }
/** /**