From: <gem...@li...> - 2013-04-15 12:37:03
|
Revision: 1231 http://sourceforge.net/p/gemstracker/code/1231 Author: mennodekker Date: 2013-04-15 12:37:00 +0000 (Mon, 15 Apr 2013) Log Message: ----------- Minor fixes to export Modified Paths: -------------- trunk/library/classes/Gems/Default/ExportAction.php trunk/library/classes/Gems/Export/Spss.php Modified: trunk/library/classes/Gems/Default/ExportAction.php =================================================================== --- trunk/library/classes/Gems/Default/ExportAction.php 2013-04-15 12:36:24 UTC (rev 1230) +++ trunk/library/classes/Gems/Default/ExportAction.php 2013-04-15 12:37:00 UTC (rev 1231) @@ -281,7 +281,7 @@ */ public function handleExport($data) { - if (isset($data['type'])) { + if (isset($data['type']) && !empty($data['sid'])) { //Do the logging $message = Zend_Json::encode($data); Gems_AccessLog::getLog()->log('export', $this->getRequest(), $message, null, true); Modified: trunk/library/classes/Gems/Export/Spss.php =================================================================== --- trunk/library/classes/Gems/Export/Spss.php 2013-04-15 12:36:24 UTC (rev 1230) +++ trunk/library/classes/Gems/Export/Spss.php 2013-04-15 12:37:00 UTC (rev 1231) @@ -137,6 +137,22 @@ return $input; } + /** + * This method handles setting up all needed steps for the batch export + * + * Normally this will initialize the file to download and set up as much + * steps as needed and the final job to close the file. + * + * To offer a file for download, add a message with the key 'file' to the + * batch. The message must be an array of 'headers' that contains an array + * of headers to set for the download and 'file' that holds the path to the + * file relative to GEMS_ROOT_DIR . '/var/tmp/' + * + * @param Gems_Task_TaskRunnerBatch $batch The batch to start + * @param array $filter The filter to use + * @param string $language The language used / to use for the export + * @param array $data The formdata + */ public function handleExportBatch($batch, $filter, $language, $data) { $survey = $this->loader->getTracker()->getSurvey($data['sid']); @@ -144,8 +160,8 @@ $answers = $survey->getRawTokenAnswerRows(array('limit'=>1,'offset'=>1) + $filter); // Limit to one response if (count($answers) === 0) { - $noData = sprintf($this->_('No %s found.'), $this->_('data')); - $answers = array($noData => $noData); + // don't export empty data + return; } else { $answers = reset($answers); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |