Skip to content

Commit

Permalink
Dev: fix browse url in statitics
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Jul 27, 2015
1 parent 75e4de4 commit 2d5c02a
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions application/helpers/admin/statistics_helper.php
Expand Up @@ -3081,6 +3081,14 @@ public function generate_statistics($surveyid, $allfields, $q2show='all', $usegr
$sOutputHTML .= "\t<tr><th align='right'>".gT("Percentage of total:").'</th>'
."<td>$percent%</td></tr>\n";
}
if($outputType=='html' && $browse === true && Permission::model()->hasSurveyPermission($surveyid,'responses','read'))
{
//add a buttons to browse results
$sOutputHTML .= "<tr><td clospan='2' style='text-align:center'>";
$sOutputHTML .= CHtml::link(gT("Browse"),array("admin/responses","sa"=>'browse','surveyid'=>$surveyid,'statfilter'=>1),array('class'=>'button btn-link'));
$sOutputHTML .= "</td></tr>";

}
$sOutputHTML .="</table>\n";

break;
Expand All @@ -3102,23 +3110,6 @@ public function generate_statistics($surveyid, $allfields, $q2show='all', $usegr
$sql= null;
}

//only continue if we have something to output
if ($results > 0)
{
if($outputType=='html' && $browse === true && Permission::model()->hasSurveyPermission($surveyid,'responses','read'))
{
//add a buttons to browse results
$sOutputHTML .= CHtml::form(array("admin/responses/sa/browse/surveyid/{$surveyid}"), 'post',array('target'=>'_blank'))."\n"
."\t\t<p>"
."\t\t\t<input type='submit' value='".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</p>"
."\t\t</form>\n";
}
} //end if (results > 0)

/* Show Summary results
* The $summary array contains each fieldname that we want to display statistics for
*
Expand Down

0 comments on commit 2d5c02a

Please sign in to comment.