Skip to content

Commit

Permalink
Fixed issue #3924: Notices & warnings during runtime and statistics w…
Browse files Browse the repository at this point in the history
…hen using a language question

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@8005 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Nov 30, 2009
1 parent 7b3b329 commit 9cc6839
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 7 additions & 4 deletions admin/statistics_function.php
Expand Up @@ -109,8 +109,11 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
//no survey ID? -> come and get one
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}

// Set language for questions and labels to base language of this survey
//$language = GetBaseLanguageFromSurveyID($surveyid);
//Get an array of codes of all available languages in this survey
$surveylanguagecodes = GetAdditionalLanguagesFromSurveyID($surveyid);
$surveylanguagecodes[] = GetBaseLanguageFromSurveyID($surveyid);

// Set language for questions and labels to base language of this survey
$language='en';
//$surveyid=sanitize_int($surveyid);
$query = "SELECT language FROM {$dbprefix}surveys WHERE sid=$surveyid";
Expand Down Expand Up @@ -1576,8 +1579,8 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,


case "I": //Language
// Using previously defined $survlangs array of language codes
foreach ($survlangs as $availlang)
// Using previously defined $surveylanguagecodes array of language codes
foreach ($surveylanguagecodes as $availlang)
{
$alist[]=array($availlang, getLanguageNameFromCode($availlang,false));
}
Expand Down
11 changes: 9 additions & 2 deletions common.php
Expand Up @@ -3236,7 +3236,14 @@ function getQuestionAttributes($qid, $type='')
}

$availableattributes=questionAttributes();
$availableattributes=$availableattributes[$type];
if (isset($availableattributes[$type]))
{
$availableattributes=$availableattributes[$type];
}
else
{
return array();
}

foreach($availableattributes as $attribute){
$defaultattributes[$attribute['name']]=$attribute['default'];
Expand Down Expand Up @@ -3430,7 +3437,7 @@ function questionAttributes($returnByName=false)
"caption"=>$clang->gT('Hide tip'));

$qattributes['hidden']=array(
'types'=>'15ABCDEFGHKLMNOPQRSTUWXYZ!:;',
'types'=>'15ABCDEFGHIKLMNOPQRSTUWXYZ!:;',
'category'=>$clang->gT('Display'),
'sortorder'=>101,
'inputtype'=>'singleselect',
Expand Down

0 comments on commit 9cc6839

Please sign in to comment.