Revision: 840
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=840&view=rev
Author: mennodekker
Date: 2012-07-13 10:02:53 +0000 (Fri, 13 Jul 2012)
Log Message:
-----------
Excel data is formatted by default, use formatExcelData to change
Modified Paths:
--------------
trunk/library/classes/Gems/Controller/BrowseEditAction.php
trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php
Modified: trunk/library/classes/Gems/Controller/BrowseEditAction.php
===================================================================
--- trunk/library/classes/Gems/Controller/BrowseEditAction.php 2012-07-13 10:01:36 UTC (rev 839)
+++ trunk/library/classes/Gems/Controller/BrowseEditAction.php 2012-07-13 10:02:53 UTC (rev 840)
@@ -64,7 +64,14 @@
public $filterStandard;
/**
+ * Should Excel output contain formatted data (date fields, select lists)
*
+ * @var boolean
+ */
+ public $formatExcelData = true;
+
+ /**
+ *
* @var Gems_Util_RequestCache
*/
public $requestCache;
@@ -430,7 +437,10 @@
$this->addExcelColumns($model); // Hook to modify the model
- $this->view->result = $this->getExcelData($model->load(), $model);
+ // Use $this->formatExcelData to switch between formatted and unformatted data
+ $excelData = new Gems_FormattedData($this->getExcelData($model->load(), $model), $model, $this->formatExcelData);
+
+ $this->view->result = $excelData;
$this->view->filename = $this->getRequest()->getControllerName() . '.xls';
$this->view->setScriptPath(GEMS_LIBRARY_DIR . '/views/scripts' );
Modified: trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php
===================================================================
--- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-07-13 10:01:36 UTC (rev 839)
+++ trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-07-13 10:02:53 UTC (rev 840)
@@ -87,7 +87,14 @@
public $escort;
/**
+ * Should Excel output contain formatted data (date fields, select lists)
*
+ * @var boolean
+ */
+ public $formatExcelData = true;
+
+ /**
+ *
* @var Gems_Menu
*/
public $menu;
@@ -190,7 +197,11 @@
// $this->addExcelColumns($model); // Hook to modify the model
- $this->view->result = $this->getExcelData($model->load(), $model);
+ // Use $this->formatExcelData to switch between formatted and unformatted data
+ $excelData = new Gems_FormattedData($this->getExcelData($model->load(), $model), $model, $this->formatExcelData);
+
+ $this->view->result = $excelData;
+
$this->view->filename = $this->getRequest()->getControllerName() . '.xls';
$this->view->setScriptPath(GEMS_LIBRARY_DIR . '/views/scripts' );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|