Skip to content

Commit

Permalink
Fixed issue #6390 Show text responses inline option no longer availab…
Browse files Browse the repository at this point in the history
…le in general filter of statistics page
  • Loading branch information
jcleeland committed Jul 26, 2012
1 parent ec847bc commit b553506
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
14 changes: 5 additions & 9 deletions application/controllers/admin/statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,16 +520,10 @@ public function run($surveyid, $subaction = null)
//Show Summary results
if (isset($summary) && $summary)
{
if(isset($_POST['usegraph']))
{
$usegraph = 1;
}
else
{
$usegraph = 0;
}

$usegraph=isset($_POST['usegraph']) ? 1 : 0;
$aData['usegraph'] = $usegraph;
$showtextinline=isset($_POST['showtextinline']) ? 1 : 0;
$aData['showtextinline'] = $showtextinline;
$outputType = $_POST['outputtype'];

$selects=buildSelects($summary, $surveyid, $statlang);
Expand Down Expand Up @@ -566,6 +560,7 @@ public function run($surveyid, $subaction = null)
/* Returns a simple list of values in a particular column, that meet the
* requirements of the SQL
*
* TODO: Move the html into a view to fit with standard mvc methodology
* */
function listcolumn($surveyid, $column, $sql)
{
Expand All @@ -580,6 +575,7 @@ function listcolumn($surveyid, $column, $sql)
<div style='clear: both'></div><?php
}
}

function graph()
{
Yii::app()->loadHelper('admin/statistics');
Expand Down
17 changes: 16 additions & 1 deletion application/helpers/admin/statistics_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2357,7 +2357,22 @@ function displayResults($outputs, $results, $rt, $outputType, $surveyid, $sql, $
* */
if(strpos($label[$i], "class='statisticsbrowsebutton'"))
{
$extraline="<tr><td class='statisticsbrowsecolumn' colspan='3' style='display: none'><div class='statisticsbrowsecolumn' id='columnlist_{$ColumnName_RM}'></div></td></tr>\n";
$extraline="<tr><td class='statisticsbrowsecolumn' colspan='3' style='display: ";
if(!isset($_POST['showtextinline'])) $extraline.=" none";
$extraline.="'><div class='statisticsbrowsecolumn' id='columnlist_{$ColumnName_RM}'>";
if(isset($_POST['showtextinline'])) {
$results=Survey_dynamic::model($surveyid)->findAll($ColumnName_RM." != ''");
foreach($results as $row) {
$extraline .= "<div class='statisticscolumnid'>
<a href='".Yii::app()->getController()->createUrl("admin/responses/view/surveyid/".$surveyid."/id/".$row['id']) ."' target='_blank'>
{$row['id']}
</a>
</div>
<div class='statisticscolumndata'>".$row[$ColumnName_RM]."</div>
<div style='clear: both'></div>";
}
}
$extraline.="</div></td></tr>\n";
}

//output absolute number of records
Expand Down
4 changes: 4 additions & 0 deletions application/views/admin/export/statistics_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
<fieldset>
<legend><?php $clang->eT("Output options"); ?></legend>
<ul>
<li>
<label for='showtextinline'><?php $clang->eT("Show text responses inline:") ?></label>
<input type='checkbox' id='showtextinline' name='showtextinline'<?php if(isset($showtextinline) && $showtextinline == 1) {echo "checked='checked'"; } ?> /><br />
</li>
<li>
<label for='usegraph'><?php $clang->eT("Show graphs"); ?></label>
<input type='checkbox' id='usegraph' name='usegraph' <?php if (isset($usegraph) && $usegraph == 1) { echo "checked='checked'"; } ?> /><br />
Expand Down

0 comments on commit b553506

Please sign in to comment.