|
From: <gem...@li...> - 2012-06-26 09:22:55
|
Revision: 786
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=786&view=rev
Author: mennodekker
Date: 2012-06-26 09:22:49 +0000 (Tue, 26 Jun 2012)
Log Message:
-----------
improved display of tableforms in print
Modified Paths:
--------------
trunk/library/classes/Gems/Form/TableForm.php
trunk/library/classes/Gems/Tracker/SurveyModel.php
Modified: trunk/library/classes/Gems/Form/TableForm.php
===================================================================
--- trunk/library/classes/Gems/Form/TableForm.php 2012-06-26 09:22:13 UTC (rev 785)
+++ trunk/library/classes/Gems/Form/TableForm.php 2012-06-26 09:22:49 UTC (rev 786)
@@ -225,11 +225,16 @@
if ($this->loadDefaultDecoratorsIsDisabled()) {
return $this;
}
+
+ $class = $this->getAttrib('class');
+ if (empty($class)) {
+ $class = 'formTable';
+ }
$decorators = $this->getDecorators();
if (empty($decorators)) {
$this->addDecorator('FormElements')
- ->addDecorator(array('table' => 'HtmlTag'), array('tag' => 'table', 'class'=>'formTable'))
+ ->addDecorator(array('table' => 'HtmlTag'), array('tag' => 'table', 'class'=>$class))
->addDecorator(array('tab' => 'HtmlTag'), array('tag' => 'div', 'class' => 'displayGroup'))
->addDecorator('Form');
}
Modified: trunk/library/classes/Gems/Tracker/SurveyModel.php
===================================================================
--- trunk/library/classes/Gems/Tracker/SurveyModel.php 2012-06-26 09:22:13 UTC (rev 785)
+++ trunk/library/classes/Gems/Tracker/SurveyModel.php 2012-06-26 09:22:49 UTC (rev 786)
@@ -133,7 +133,8 @@
*/
public function loadFirst($filter = true, $sort = true)
{
- return reset($this->addAnswers(array(parent::loadFirst($filter, $sort))));
+ $result = $this->addAnswers(array(parent::loadFirst($filter, $sort)));
+ return reset($result);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|