|
From: <gem...@li...> - 2011-09-22 14:13:38
|
Revision: 70
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=70&view=rev
Author: mennodekker
Date: 2011-09-22 14:13:27 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
Fixed Spss export (forgot to rename zsd to gems)
Fixed Excel export (first row should not be formatted)
Made bulk email a separate privilege from normal mail
Fixed a problem with tableform (not used yet) and File elements
Modified Paths:
--------------
trunk/library/classes/Gems/Export/Spss.php
trunk/library/classes/Gems/Form/TableForm.php
trunk/library/classes/Gems/Menu/MenuAbstract.php
trunk/library/classes/Gems/View/Helper/Excel.php
Modified: trunk/library/classes/Gems/Export/Spss.php
===================================================================
--- trunk/library/classes/Gems/Export/Spss.php 2011-09-22 09:31:24 UTC (rev 69)
+++ trunk/library/classes/Gems/Export/Spss.php 2011-09-22 14:13:27 UTC (rev 70)
@@ -205,7 +205,7 @@
//We should create a model with the transformations we need
//think of date translations, numers and strings
$answerRow = reset($answers);
- $spssModel = new Zsd_Export_ExportModel();
+ $spssModel = new Gems_Export_ExportModel();
foreach($answerRow as $key => $value) {
$options = array();
$type = $answerModel->get($key,'type');
Modified: trunk/library/classes/Gems/Form/TableForm.php
===================================================================
--- trunk/library/classes/Gems/Form/TableForm.php 2011-09-22 09:31:24 UTC (rev 69)
+++ trunk/library/classes/Gems/Form/TableForm.php 2011-09-22 14:13:27 UTC (rev 70)
@@ -69,6 +69,8 @@
if (isset($decorators['Zend_Form_Decorator_ViewHelper'])) {
$dec1 = $decorators['Zend_Form_Decorator_ViewHelper'];
+ } elseif (isset($decorators['Zend_Form_Decorator_File'])) {
+ $dec1 = $decorators['Zend_Form_Decorator_File'];
} else {
foreach($decorators as $name=>$decorator) {
if (substr($name, 0, 5) == 'ZendX') {
Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php
===================================================================
--- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-09-22 09:31:24 UTC (rev 69)
+++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-09-22 14:13:27 UTC (rev 70)
@@ -253,7 +253,7 @@
foreach ($plans as $plan) {
$plan->addAutofilterAction();
- $plan->addAction($this->_('Bulk mail'), 'pr.token.mail', 'email', array('routeReset' => false));
+ $plan->addAction($this->_('Bulk mail'), 'pr.token.bulkmail', 'email', array('routeReset' => false));
$plan->addExcelAction();
}
Modified: trunk/library/classes/Gems/View/Helper/Excel.php
===================================================================
--- trunk/library/classes/Gems/View/Helper/Excel.php 2011-09-22 09:31:24 UTC (rev 69)
+++ trunk/library/classes/Gems/View/Helper/Excel.php 2011-09-22 14:13:27 UTC (rev 70)
@@ -3,7 +3,7 @@
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
@@ -14,7 +14,7 @@
* * Neither the name of Erasmus MC nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -29,7 +29,7 @@
/**
* Outputs an array of arrays (or a Zend_Db_Table_Rowset) as a table
- *
+ *
* The first 'record' is rendered bold, being the header for the table
*
* @category Gems
@@ -49,25 +49,35 @@
Zend_Controller_Front::getInstance()->unregisterPlugin('ZFDebug_Controller_Plugin_Debug');
} catch (Exception $e) {}
$this->view->layout()->setLayout('excel');
+ if ($rowset instanceof Gems_FormattedData) {
+ $rowset->setFormatted(false);
+ }
$rowcnt = 0;
foreach ($rowset as $row) {
- if ($row instanceof Zend_Db_Table_Row) $row = $row->toArray();
- if (!is_array($row)) $row = (array) $row;
+ if ($row instanceof Zend_Db_Table_Row) {
+ $row = $row->toArray();
+ }
+ if (!is_array($row)) {
+ $row = (array) $row;
+ }
if ($rowcnt == 0) {
//Only for the first row: output headers
$output = "<table>\r\n";
$output .= "\t<thead>\r\n";
$output .= "\t\t<tr>\r\n";
foreach ($row as $name => $value) {
- $output .= "\t\t\t<th>$value</th>\r\n";
+ $output .= "\t\t\t<th>$value</th>\r\n";
}
$output .= "\t\t</tr>\r\n";
$output .= "\t</thead>\r\n";
$output .= "\t<tbody>\r\n";
- } else {
- $output .= "\t\t<tr>\r\n";
+ if ($rowset instanceof Gems_FormattedData) {
+ $rowset->setFormatted(true);
+ }
+ } else {
+ $output .= "\t\t<tr>\r\n";
foreach ($row as $name => $value) {
- $output .= "\t\t\t<td>$value</td>\r\n";
+ $output .= "\t\t\t<td>$value</td>\r\n";
}
$output .= "\t\t</tr>\r\n";
}
@@ -76,7 +86,7 @@
if (isset($output)) {
$output .= "\t</tbody>\r\n";
$output .= "</table>\r\n";
- return $output;
+ return $output;
} else {
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|