Skip to content

Commit

Permalink
Fix issue 05026: Statistics HTML report UI defect
Browse files Browse the repository at this point in the history
Dev Fixed several HTML errors when viewing stats on text questions

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9889 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Tony Partner committed Mar 16, 2011
1 parent 1820d68 commit 5d1ccdf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
20 changes: 12 additions & 8 deletions admin/statistics.php
Expand Up @@ -291,7 +291,7 @@
}

$statisticsoutput .="<li><label for='statlang'>".$clang->gT("Statistics report language")."</label>"
. " <select name=\"statlang\" id=\"statlang\">".$language_options."</select>\n";
. " <select name=\"statlang\" id=\"statlang\">".$language_options."</select></li>\n";

$statisticsoutput.="\n</ul></fieldset>\n";

Expand Down Expand Up @@ -345,12 +345,13 @@
$statisticsoutput .= "<li>"
."<label>"
.$clang->gT("Select output format").":</label>"
."<input type='radio' name='outputtype' value='html' checked='checked' /><label for='outputtype'>HTML</label> <input type='radio' name='outputtype' value='pdf' /><label for='outputtype'>PDF</label> <input type='radio' onclick='nographs();' name='outputtype' value='xls' /><label for='outputtype'>Excel</label>";

."<input type='radio' name='outputtype' value='html' checked='checked' /><label for='outputtype'>HTML</label> <input type='radio' name='outputtype' value='pdf' /><label for='outputtype'>PDF</label> <input type='radio' onclick='nographs();' name='outputtype' value='xls' /><label for='outputtype'>Excel</label>"
."</li>";

$statisticsoutput .= "</ul></fieldset></div><p>"
."<input type='submit' value='".$clang->gT("View stats")."' />\n"
."<input type='button' value='".$clang->gT("Clear")."' onclick=\"window.open('$scriptname?action=statistics&amp;sid=$surveyid', '_top')\" />\n";
."<input type='button' value='".$clang->gT("Clear")."' onclick=\"window.open('$scriptname?action=statistics&amp;sid=$surveyid', '_top')\" />\n"
."</p>";

//second row below options -> filter settings headline
$statisticsoutput.="<div class='header header_statistics'>"
Expand Down Expand Up @@ -611,7 +612,8 @@
if (isset($_POST[$myfield2]))
{$statisticsoutput .= $_POST[$myfield2];}

$statisticsoutput .= "' />";
$statisticsoutput .= "' />"
."\t\t\t\t</td>\n";
$counter2++;
}
$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
Expand All @@ -627,8 +629,8 @@
case "U": // Huge free text

$myfield2="T$myfield";
$statisticsoutput .= "\t\t\t\t<td align='center' valign='top'>";
$statisticsoutput .= "<input type='checkbox' name='summary[]' value='$myfield2'";
$statisticsoutput .= "\t\t\t\t<td align='center' valign='top'>\n";
$statisticsoutput .= "\t\t\t\t\t<input type='checkbox' name='summary[]' value='$myfield2'";
if (isset($summary) && (array_search("T{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE))
{$statisticsoutput .= " checked='checked'";}

Expand All @@ -640,7 +642,8 @@

if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}

$statisticsoutput .= "</textarea>";
$statisticsoutput .= "</textarea>\n"
."\t\t\t\t</td>\n";
break;


Expand Down Expand Up @@ -1592,6 +1595,7 @@
."\t\t\t<input type='button' value='".$clang->gT("Clear")."' onclick=\"window.open('$scriptname?action=statistics&amp;sid=$surveyid', '_top')\" />\n"
."\t\t<input type='hidden' name='sid' value='$surveyid' />\n"
."\t\t<input type='hidden' name='display' value='stats' />\n"
."\t\t</p>\n"
."\t</form><br /><a name='start'></a>\n";

// ----------------------------------- END FILTER FORM ---------------------------------------
Expand Down
17 changes: 15 additions & 2 deletions admin/statistics_function.php
Expand Up @@ -609,11 +609,13 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
{
//add a buttons to browse results
$statisticsoutput .= "<form action='$scriptname?action=browse' method='post' target='_blank'>\n"
."\t\t<p><input type='submit' value='".$statlang->gT("Browse")."' />\n"
."\t\t<p>"
."\t\t\t<input type='submit' value='".$statlang->gT("Browse")."' />\n"
."\t\t\t<input type='hidden' name='sid' value='$surveyid' />\n"
."\t\t\t<input type='hidden' name='sql' value=\"$sql\" />\n"
."\t\t\t<input type='hidden' name='subaction' value='all' />\n"
."\t\t</form>";
."\t\t</p>"
."\t\t</form>\n";
}
} //end if (results > 0)

Expand Down Expand Up @@ -2059,6 +2061,13 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
{
$fname= "$al[1]";
}

$statisticsoutput .= "</th>\n"
."\t\t<th width='25%' align='center' >"
."<strong>".$statlang->gT("Count")."</strong></th>\n"
."\t\t<th width='25%' align='center' >"
."<strong>".$statlang->gT("Percentage")."</strong></th>\n"
."\t</tr></thead>\n";
}


Expand Down Expand Up @@ -2444,6 +2453,10 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
if(isset($showaggregateddata) && $showaggregateddata == 1 && ($qtype == "5" || $qtype == "A"))
{
$statisticsoutput .= "\t\t</td>";
}
elseif ($qtype == "S" || $qtype == "U" || $qtype == "T" || $qtype == "Q")
{
$statisticsoutput .= "</td>\n\t</tr>\n";
}
break;
default:
Expand Down

0 comments on commit 5d1ccdf

Please sign in to comment.