Skip to content

Commit

Permalink
Fixed issue #06261 : unable to preview non-active survey, group, or q…
Browse files Browse the repository at this point in the history
…uestion

Description
Dev : put test in replacements, maybe best is to rework Survey_dynamic::model
  • Loading branch information
Shnoulle committed Jun 23, 2012
1 parent 3220c98 commit 2bc5429
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions application/helpers/replacements_helper.php
Expand Up @@ -399,11 +399,15 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
$_linkreplace='';
}

if(isset($surveyid) && !isset($saved_id) && isset($_SESSION['survey_'.$surveyid]['srid']))
if(isset($thissurvey['sid']) && isset($_SESSION['survey_'.$thissurvey['sid']]['srid']) && $thissurvey['active']=='Y')
{
$saved_id=$_SESSION['survey_'.$surveyid]['srid'];
$iscompleted=Survey_dynamic::model($surveyid)->isCompleted($_SESSION['survey_'.$thissurvey['sid']]['srid']);
}
if (isset($surveyid) && !Survey_dynamic::model($surveyid)->isCompleted(isset($saved_id) ? $saved_id : 0))
else
{
$iscompleted=false;
}
if (isset($surveyid) && !$iscompleted)
{
$_clearall = "<input type='button' name='clearallbtn' value='" . $clang->gT("Exit and Clear Survey") . "' class='clearall' "
. "onclick=\"if (confirm('" . $clang->gT("Are you sure you want to clear all your responses?", 'js') . "')) {\nwindow.open('".Yii::app()->getController()->createUrl("survey/index/sid/$surveyid?move=clearall&amp;lang=" . $s_lang);
Expand Down

0 comments on commit 2bc5429

Please sign in to comment.