Skip to content

Commit

Permalink
Fixed issue #08517: Quota Answers not in Base Language
Browse files Browse the repository at this point in the history
Dev: #08517 fixed by $surveyinfo=getSurveyInfo($surveyid,$language);
Dev: Don't understand where we can found defaultlanguage ?
Dev: Quick fix : Quota need some rewrite
  • Loading branch information
Shnoulle committed Jan 15, 2014
1 parent dacace2 commit f93f9c4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions application/helpers/common_helper.php
Expand Up @@ -6096,6 +6096,7 @@ function includeKeypad()
/**
* getQuotaInformation() returns quota information for the current survey
* @param string $surveyid - Survey identification number
* @param string $language - Language of the quota
* @param string $quotaid - Optional quotaid that restricts the result to a given quota
* @return array - nested array, Quotas->Members->Fields
*/
Expand All @@ -6111,10 +6112,11 @@ function getQuotaInformation($surveyid,$language,$iQuotaID='all')
}

$result = Quota::model()->with(array('languagesettings' => array('condition' => "quotals_language='$language'")))->findAllByAttributes($aAttributes);

$quota_info = array();
$x=0;

$surveyinfo=getSurveyInfo($surveyid);
$surveyinfo=getSurveyInfo($surveyid,$language);

// Check all quotas for the current survey
//if ($result->RecordCount() > 0)
Expand All @@ -6123,10 +6125,10 @@ function getQuotaInformation($surveyid,$language,$iQuotaID='all')
//while ($survey_quotas = $result->FetchRow())
foreach ($result as $_survey_quotas)
{
$survey_quotas = $_survey_quotas->attributes;
$survey_quotas = array_merge($_survey_quotas->attributes,$_survey_quotas->languagesettings[0]->attributes);// We have only one language, then we can use first only
// !!! Doubting this
foreach ($_survey_quotas->defaultlanguage as $k => $v)
$survey_quotas[$k] = $v;
# foreach ($_survey_quotas->defaultlanguage as $k => $v)
# $survey_quotas[$k] = $v;

array_push($quota_info,array('Name' => $survey_quotas['name'],
'Limit' => $survey_quotas['qlimit'],
Expand Down

0 comments on commit f93f9c4

Please sign in to comment.