From: <gem...@li...> - 2012-03-29 09:42:23
|
Revision: 573 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=573&view=rev Author: michieltcs Date: 2012-03-29 09:42:13 +0000 (Thu, 29 Mar 2012) Log Message: ----------- Revert r571 and r572 (going another route) Revision Links: -------------- http://gemstracker.svn.sourceforge.net/gemstracker/?rev=571&view=rev http://gemstracker.svn.sourceforge.net/gemstracker/?rev=572&view=rev Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php trunk/library/classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php trunk/library/classes/Gems/Util/TrackData.php Modified: trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2012-03-28 19:45:36 UTC (rev 572) +++ trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2012-03-29 09:42:13 UTC (rev 573) @@ -733,7 +733,7 @@ $model->set('gro_id_track', 'label', $this->_('Track'), 'elementClass', 'exhibitor', 'multiOptions', MUtil_Lazy::call($this->util->getTrackData()->getAllTracks)); } - $model->set('gro_id_survey', 'label', $this->_('Survey'), 'multiOptions', $this->util->getTrackData()->getActiveSurveysAndDescriptions()); + $model->set('gro_id_survey', 'label', $this->_('Survey'), 'multiOptions', $this->util->getTrackData()->getAllSurveysAndDescriptions()); $model->set('gro_icon_file', 'label', $this->_('Icon')); $model->set('gro_id_order', 'label', $this->_('Order'), 'default', 10, 'validators[]', $model->createUniqueValidator(array('gro_id_order', 'gro_id_track'))); $model->set('gro_round_description', 'label', $this->_('Description'), 'size', '30'); //, 'minlength', 4, 'required', true); Modified: trunk/library/classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php 2012-03-28 19:45:36 UTC (rev 572) +++ trunk/library/classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php 2012-03-29 09:42:13 UTC (rev 573) @@ -182,7 +182,7 @@ } // Check the survey name - $surveys = $this->util->getTrackData()->getActiveSurveys(); + $surveys = $this->util->getTrackData()->getAllSurveys(); if (isset($surveys[$this->formData['gro_id_survey']])) { $this->formData['gro_survey_name'] = $surveys[$this->formData['gro_id_survey']]; } else { Modified: trunk/library/classes/Gems/Util/TrackData.php =================================================================== --- trunk/library/classes/Gems/Util/TrackData.php 2012-03-28 19:45:36 UTC (rev 572) +++ trunk/library/classes/Gems/Util/TrackData.php 2012-03-29 09:42:13 UTC (rev 573) @@ -82,42 +82,20 @@ return $dates; } // */ - /** - * Retrieve an array of key/value pairs for gsu_id_survey and gsu_survey_name - * only the active surveys - * - * @staticvar array $activeSurveys - * @return array - */ + /* public function getActiveSurveys() { - static $activeSurveys; + static $surveys; - if (! $activeSurveys) { - $activeSurveys = $this->db->fetchPairs('SELECT gsu_id_survey, gsu_survey_name FROM gems__surveys WHERE gsu_active = 1 AND gsu_surveyor_active = 1 ORDER BY gsu_survey_name'); + if (! $surveys) { + $surveys = $this->util->getTranslated()->getEmptyDropdownArray(); + $surveys = $surveys + $this->db->fetchPairs('SELECT gsu_id_survey, gsu_survey_name FROM gems__surveys WHERE gsu_active = 1 AND gsu_surveyor_active = 1 ORDER BY gsu_survey_name'); } - return $activeSurveys; - } + return $surveys; + } // */ - /** - * Retrieve an array of key/value pairs for gsu_id_survey and gsu_survey_name - * only the active surveys - * - * @staticvar array $activeSurveys - * @return array - */ - public function getActiveSurveysAndDescriptions() - { - static $activeSurveys; - if (! $activeSurveys) { - $activeSurveys = $this->db->fetchPairs('SELECT gsu_id_survey, LEFT(CONCAT_WS(" - ", gsu_survey_name, gsu_survey_description),50) FROM gems__surveys WHERE gsu_active = 1 AND gsu_surveyor_active = 1 ORDER BY gsu_survey_name'); - } - - return $activeSurveys; - } - /** * Retrieve an array of key/value pairs for gsu_id_survey and gsu_survey_name * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |