Skip to content

Commit

Permalink
Fixed issue #6348: Bar chart not translated in statistics when changi…
Browse files Browse the repository at this point in the history
…ng statistics language
  • Loading branch information
c-schmitz committed Jul 23, 2012
1 parent 1b837e9 commit e2aca66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions application/helpers/admin/statistics_helper.php
Expand Up @@ -114,9 +114,9 @@ function createChart($iQuestionID, $iSurveyID, $type, $lbl, $gdata, $grawdata, $
$counter++;
}

if ($cache->IsInCache("graph".$statlang->langcode.$iSurveyID,$DataSet->GetData()))
if ($cache->IsInCache("graph".$language.$iSurveyID,$DataSet->GetData()))
{
$cachefilename=basename($cache->GetFileFromCache("graph".$statlang->langcode.$iSurveyID,$DataSet->GetData()));
$cachefilename=basename($cache->GetFileFromCache("graph".$language.$iSurveyID,$DataSet->GetData()));
}
else
{
Expand Down Expand Up @@ -146,8 +146,8 @@ function createChart($iQuestionID, $iSurveyID, $type, $lbl, $gdata, $grawdata, $
$graph->setFontProperties($rootdir.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR.$chartfontfile, $chartfontsize);
$graph->drawLegend(510,30,$DataSet->GetDataDescription(),255,255,255);

$cache->WriteToCache("graph".$statlang->langcode.$iSurveyID,$DataSet->GetData(),$graph);
$cachefilename=basename($cache->GetFileFromCache("graph".$statlang->langcode.$iSurveyID,$DataSet->GetData()));
$cache->WriteToCache("graph".$language.$iSurveyID,$DataSet->GetData(),$graph);
$cachefilename=basename($cache->GetFileFromCache("graph".$language.$iSurveyID,$DataSet->GetData()));
unset($graph);
}
} //end if (bar chart)
Expand Down Expand Up @@ -203,9 +203,9 @@ function createChart($iQuestionID, $iSurveyID, $type, $lbl, $gdata, $grawdata, $
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie("Serie2");

if ($cache->IsInCache("graph".$statlang->langcode.$iSurveyID, $DataSet->GetData()))
if ($cache->IsInCache("graph".$language.$iSurveyID, $DataSet->GetData()))
{
$cachefilename=basename($cache->GetFileFromCache("graph".$statlang->langcode.$iSurveyID,$DataSet->GetData()));
$cachefilename=basename($cache->GetFileFromCache("graph".$language.$iSurveyID,$DataSet->GetData()));
}
else
{
Expand All @@ -221,8 +221,8 @@ function createChart($iQuestionID, $iSurveyID, $type, $lbl, $gdata, $grawdata, $
$graph->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),225,round($gheight/2),170,PIE_PERCENTAGE,TRUE,50,20,5);
$graph->setFontProperties($rootdir."/fonts/".$chartfontfile,$chartfontsize);
$graph->drawPieLegend(430,12,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250);
$cache->WriteToCache("graph".$statlang->langcode.$iSurveyID,$DataSet->GetData(),$graph);
$cachefilename=basename($cache->GetFileFromCache("graph".$statlang->langcode.$iSurveyID,$DataSet->GetData()));
$cache->WriteToCache("graph".$language.$iSurveyID,$DataSet->GetData(),$graph);
$cachefilename=basename($cache->GetFileFromCache("graph".$language.$iSurveyID,$DataSet->GetData()));
unset($graph);
}
} //end else -> pie charts
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/export/statistics_view.php
Expand Up @@ -9,7 +9,7 @@
<script type='text/javascript'>
var graphUrl="<?php echo Yii::app()->getController()->createUrl("admin/statistics/graph"); ?>";
var listColumnUrl="<?php echo Yii::app()->getController()->createUrl("admin/statistics/listcolumn/surveyid/".$surveyid."/column/"); ?>";
var sql="<?php echo urlencode($sql) ?>";
var sql="<?php //echo urlencode($sql) ?>";
</script>
<form method='post' name='formbuilder' action='<?php echo Yii::app()->getController()->createUrl("admin/statistics/index/surveyid/$surveyid"); ?>#start'>
<div class='header ui-widget-header header_statistics'>
Expand Down
1 change: 1 addition & 0 deletions tmp/.gitignore
@@ -1,3 +1,4 @@

*.html
/*.lss
/*.png

0 comments on commit e2aca66

Please sign in to comment.