From: <gem...@li...> - 2011-10-27 13:30:08
|
Revision: 147 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=147&view=rev Author: mennodekker Date: 2011-10-27 13:29:59 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Added caching to LS fieldmap Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2011-10-27 09:03:59 UTC (rev 146) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2011-10-27 13:29:59 UTC (rev 147) @@ -59,6 +59,11 @@ protected $_titlesMap; /** + * @var Zend_Cache_Core + */ + protected $cache; + + /** * The language of this fieldmap * * @var string @@ -108,6 +113,7 @@ $this->lsDb = $lsDb; $this->translate = $translate; $this->tablePrefix = $tablePrefix; + $this->cache = GemsEscort::getInstance()->cache; //Load the cache from escort } /** @@ -198,7 +204,9 @@ protected function _getMap() { - if (! $this->_fieldMap) { + $cacheId = 'lsFieldMap'.$this->sourceSurveyId.$this->language; + + if( ($this->_fieldMap = $this->cache->load($cacheId)) === false ) { $gTable = $this->_getGroupsTableName(); $qTable = $this->_getQuestionsTableName(); @@ -333,9 +341,10 @@ } } $this->_fieldMap = $map; - // MUtil_Echo::track($this->_fieldMap); + $this->cache->save($this->_fieldMap, $cacheId); } + return $this->_fieldMap; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-06 11:51:26
|
Revision: 533 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=533&view=rev Author: mennodekker Date: 2012-03-06 11:51:15 +0000 (Tue, 06 Mar 2012) Log Message: ----------- Fixed problem with display of answers for dual scale questions Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2012-03-01 16:41:08 UTC (rev 532) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2012-03-06 11:51:15 UTC (rev 533) @@ -241,6 +241,7 @@ $map[$row1['sgq']] = $row1; $row2 = $row; + $row2['scale_id'] = 1; $row2['sgq'] .= $row['sq_title'] . '#1'; $row2['code'] = $row['title'] . '_' . $row['sq_title'] . '#1'; $row2['sq_question1'] = $this->_getQuestionAttribute($row['qid'], 'dualscale_headerB', 'scale 2'); @@ -619,16 +620,13 @@ // Juggle the labels for sub-questions etc.. if (isset($field['sq_question'])) { - if (isset($field['sq_question1'])) { - $tmpres['label'] = MUtil_Html::raw(sprintf($this->translate->_('%s: %s'), $field['sq_question'], $field['sq_question1'])); - } - if (! isset($tmpres['label'])) { - $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['sq_question'])); - } else { + if (isset($tmpres['label'])) { // Add non answered question for grouping $model->set('_' . $name . '_', $tmpres); - - // "Next" question + } + if (isset($field['sq_question1'])) { + $tmpres['label'] = MUtil_Html::raw(sprintf($this->translate->_('%s: %s'), $this->removeHtml($field['sq_question']), $this->removeHtml($field['sq_question1']))); + } else { $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['sq_question'])); } $tmpres['thClass'] = 'question_sub'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-07-18 11:53:27
|
Revision: 855 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=855&view=rev Author: michieltcs Date: 2012-07-18 11:53:21 +0000 (Wed, 18 Jul 2012) Log Message: ----------- Pass the title of the question as well Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2012-07-18 11:20:43 UTC (rev 854) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2012-07-18 11:53:21 UTC (rev 855) @@ -667,6 +667,7 @@ $tmpres['class'] = 'question'; $tmpres['group'] = $field['gid']; $tmpres['type'] = $field['type']; + $tmpres['title'] = $field['title']; if (! isset($oldfld) || ($oldfld['question'] !== $field['question'])) { $tmpres['question'] = $this->removeMarkup($field['question']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-01-31 14:36:24
|
Revision: 1129 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1129&view=rev Author: mennodekker Date: 2013-01-31 14:36:17 +0000 (Thu, 31 Jan 2013) Log Message: ----------- Set lifetime for limesurvey fieldmaps to 1 day to allow better response times Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2013-01-30 12:23:04 UTC (rev 1128) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2013-01-31 14:36:17 UTC (rev 1129) @@ -342,7 +342,8 @@ } } $this->_fieldMap = $map; - $this->cache->save($this->_fieldMap, $cacheId); + // Use a tag (for cleaning if supported) and 1 day lifetime, maybe clean cache on sync survey? + $this->cache->save($this->_fieldMap, $cacheId, array('fieldmap'), 86400); //60*60*24=86400 } return $this->_fieldMap; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |