Skip to content

Commit

Permalink
Fixed issue #5952: Error in statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Mar 30, 2012
1 parent 03ae1a0 commit 1371faf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions admin/statistics_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
$rooturl, $rootdir, $homedir, $homeurl, $tempdir, $tempurl, $scriptname, $imagedir,
$chartfontfile, $chartfontsize, $admintheme, $pdfdefaultfont, $pdffontsize, $showaggregateddata;

$fieldmap=createFieldMap($surveyid, "full");

if (is_null($statlangcode))
{
$statlang=$clang;
$statlang=GetBaseLanguageFromSurveyID($surveyid);
}
else
{
$statlang = new limesurvey_lang($statlangcode);
}
$fieldmap=createFieldMap($surveyid, "full", false, false, $statlang->langcode);

/*
* this variable is used in the function shortencode() which cuts off a question/answer title
Expand Down Expand Up @@ -1905,7 +1905,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
break;
}
echo '';

//loop thorugh the array which contains all answer data
foreach ($alist as $al)
{
Expand Down Expand Up @@ -2036,7 +2036,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
{
//store temporarily value of answer count of question type '5' and 'A'.
$tempcount = -1; //count can't be less han zero

//increase counter
$TotalCompleted += $row[0];

Expand Down Expand Up @@ -2357,7 +2357,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
$justcode[]=$al[0];

//edit labels and put them into antoher array

//first check if $tempcount is > 0. If yes, $row[0] has been modified and $tempcount has the original count.
if ($tempcount > 0)
{
Expand All @@ -2369,7 +2369,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
$lbl[] = iconv_wordwrap(FlattenText("$al[1] ($row[0])"), 30, "\n"); // NMO 2009-03-24
$lblrtl[] = utf8_strrev(iconv_wordwrap(FlattenText("$al[1] )$row[0]("), 30, "\n")); // NMO 2009-03-24
}


} //end while -> loop through results

Expand Down Expand Up @@ -3286,7 +3286,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
}

} //end else -> pie charts

//introduce new counter
if (!isset($ci)) {$ci=0;}

Expand Down

2 comments on commit 1371faf

@TMSWhite
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be ported to Yii?

@c-schmitz
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Please sign in to comment.