From: <gem...@li...> - 2011-12-02 12:30:07
|
Revision: 334 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=334&view=rev Author: matijsdejong Date: 2011-12-02 12:29:57 +0000 (Fri, 02 Dec 2011) Log Message: ----------- Small fixes to FieldMap to remove display bugs Modified Paths: -------------- branches/1.5.0-pulse/library/classes/Gems/Default/TokenPlanAction.php branches/1.5.0-pulse/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php branches/1.5.0-pulse/library/classes/Gems/Tracker.php branches/1.5.0-pulse/library/languages/default-nl.mo branches/1.5.0-pulse/library/languages/default-nl.po Modified: branches/1.5.0-pulse/library/classes/Gems/Default/TokenPlanAction.php =================================================================== --- branches/1.5.0-pulse/library/classes/Gems/Default/TokenPlanAction.php 2011-12-02 12:28:15 UTC (rev 333) +++ branches/1.5.0-pulse/library/classes/Gems/Default/TokenPlanAction.php 2011-12-02 12:29:57 UTC (rev 334) @@ -289,26 +289,28 @@ // Add track selection if ($this->escort instanceof Gems_Project_Tracks_MultiTracksInterface) { - $sql = "SELECT gtr_id_track, gtr_track_name FROM gems__tracks WHERE gtr_active=1 AND gtr_track_type='T' AND INSTR(gtr_organizations, '|$orgId|') > 0"; + $sql = "SELECT gtr_id_track, gtr_track_name FROM gems__tracks WHERE gtr_active=1 AND gtr_track_type='T' AND INSTR(gtr_organizations, '|$orgId|') > 0 ORDER BY gtr_track_name"; $elements[] = $this->_createSelectElement('gto_id_track', $sql, $this->_('(all tracks)')); } - $sql = "SELECT gro_round_description, gro_round_description + $sql = "SELECT DISTINCT gro_round_description, gro_round_description FROM gems__rounds INNER JOIN gems__tracks ON gro_id_track = gtr_id_track WHERE gro_active=1 AND LENGTH(gro_round_description) > 0 AND gtr_active=1 AND gtr_track_type='T' AND - INSTR(gtr_organizations, '|$orgId|') > 0"; + INSTR(gtr_organizations, '|$orgId|') > 0 + ORDER BY gro_round_description"; $elements[] = $this->_createSelectElement('gto_round_description', $sql, $this->_('(all rounds)')); - $sql = "SELECT gsu_id_survey, gsu_survey_name + $sql = "SELECT DISTINCT gsu_id_survey, gsu_survey_name FROM gems__surveys INNER JOIN gems__rounds ON gsu_id_survey = gro_id_survey INNER JOIN gems__tracks ON gro_id_track = gtr_id_track WHERE gsu_active=1 AND gro_active=1 AND gtr_active=1 AND - INSTR(gtr_organizations, '|$orgId|') > 0"; + INSTR(gtr_organizations, '|$orgId|') > 0 + ORDER BY gsu_survey_name"; /* TODO: use this when we can update this list using ajax if (isset($data['gsu_id_primary_group'])) { $sql .= $this->db->quoteInto(" AND gsu_id_primary_group = ?", $data['gsu_id_primary_group']); @@ -326,7 +328,7 @@ ); $elements[] = $this->_createSelectElement('main_filter', $options); - $sql = "SELECT ggp_id_group, ggp_name + $sql = "SELECT DISTINCT ggp_id_group, ggp_name FROM gems__groups INNER JOIN gems__surveys ON ggp_id_group = gsu_id_primary_group INNER JOIN gems__rounds ON gsu_id_survey = gro_id_survey INNER JOIN gems__tracks ON gro_id_track = gtr_id_track @@ -334,7 +336,8 @@ gro_active=1 AND gtr_active=1 AND gtr_track_type='T' AND - INSTR(gtr_organizations, '|$orgId|') > 0"; + INSTR(gtr_organizations, '|$orgId|') > 0 + ORDER BY ggp_name"; $elements[] = $this->_createSelectElement('gsu_id_primary_group', $sql, $this->_('(all fillers)')); if (($this->escort instanceof Gems_Project_Organization_MultiOrganizationInterface) && @@ -344,7 +347,7 @@ $elements[] = $this->_createSelectElement('gto_id_organization', $options); } - $sql = "SELECT gsf_id_user, CONCAT( + $sql = "SELECT DISTINCT gsf_id_user, CONCAT( COALESCE(gems__staff.gsf_last_name, ''), ', ', COALESCE(gems__staff.gsf_first_name, ''), @@ -352,7 +355,8 @@ ) AS gsf_name FROM gems__staff INNER JOIN gems__respondent2track ON gsf_id_user = gr2t_created_by WHERE gr2t_id_organization = $orgId AND - gr2t_active = 1"; + gr2t_active = 1 + ORDER BY 2"; $elements[] = $this->_createSelectElement('gr2t_created_by', $sql, $this->_('(all staff)')); return $elements; Modified: branches/1.5.0-pulse/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php =================================================================== --- branches/1.5.0-pulse/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2011-12-02 12:28:15 UTC (rev 333) +++ branches/1.5.0-pulse/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2011-12-02 12:29:57 UTC (rev 334) @@ -287,20 +287,19 @@ $row['sq_title'] = 'other'; $row['code'] = $row['title'] . '_' . $row['sq_title']; $row['sq_question'] = $this->translate->_('Other'); - if ($row['type'] === 'P') { + if ($row['type'] === 'P' || $row['type'] === 'M') { $row['type'] = 'S'; } $map[$row['sgq']] = $row; - // Removed if, this field is always added with questions - // if ($row['type'] !== 'M') { - $row['sgq'] .= 'comment'; - $row['code'] .= 'comment'; - $row['sq_title'] .= 'comment'; - $row['sq_question'] = ($rows[$i]['type'] === 'O') ? $this->translate->_('Comment') : $row['sq_question'] . $this->translate->_(' (comment)'); - $row['type'] = 'S'; - $map[$row['sgq']] = $row; - //} + if ($rows[$i]['type'] !== 'M') { + $row['sgq'] .= 'comment'; + $row['code'] .= 'comment'; + $row['sq_title'] .= 'comment'; + $row['sq_question'] = ($rows[$i]['type'] === 'O') ? $this->translate->_('Comment') : $row['sq_question'] . $this->translate->_(' (comment)'); + $row['type'] = 'S'; + $map[$row['sgq']] = $row; + } } break; @@ -613,6 +612,7 @@ // $tmpres['formatFunction'] } + MUtil_Echo::track($field); if (! isset($oldfld) || ($oldfld['question'] !== $field['question'])) { $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['question'])); } @@ -620,7 +620,7 @@ // Juggle the labels for sub-questions etc.. if (isset($field['sq_question'])) { if (isset($field['sq_question1'])) { - $field['label'] = MUtil_Html::raw(sprintf($this->translate->_('%s: %s'), $field['sq_question'], $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'])); @@ -729,7 +729,6 @@ // Optional type check if ((! $forType) || ($field['type'] == $forType)) { - // Juggle the labels for sub-questions etc.. if (isset($field['sq_question1'])) { $squestion = sprintf($this->translate->_('%s: %s'), $this->removeMarkup($field['sq_question']), $this->removeMarkup($field['sq_question1'])); Modified: branches/1.5.0-pulse/library/classes/Gems/Tracker.php =================================================================== --- branches/1.5.0-pulse/library/classes/Gems/Tracker.php 2011-12-02 12:28:15 UTC (rev 333) +++ branches/1.5.0-pulse/library/classes/Gems/Tracker.php 2011-12-02 12:29:57 UTC (rev 334) @@ -485,7 +485,7 @@ $surveyData['gsu_surveyor_id'] = $sourceSurveyId; $surveyData['gsu_id_source'] = $sourceId; - MUtil_Echo::track($surveyData); + // MUtil_Echo::track($surveyData); } return $this->getSurvey($surveyData); Modified: branches/1.5.0-pulse/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: branches/1.5.0-pulse/library/languages/default-nl.po =================================================================== --- branches/1.5.0-pulse/library/languages/default-nl.po 2011-12-02 12:28:15 UTC (rev 333) +++ branches/1.5.0-pulse/library/languages/default-nl.po 2011-12-02 12:29:57 UTC (rev 334) @@ -3389,7 +3389,7 @@ #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:277 #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:300 msgid " (comment)" -msgstr "(opmerkingen)" +msgstr " (opmerkingen)" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:475 msgid "Free number" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |