diff --git a/application/controllers/survey/index.php b/application/controllers/survey/index.php index 4168fda36e8..7327b2143fc 100644 --- a/application/controllers/survey/index.php +++ b/application/controllers/survey/index.php @@ -316,8 +316,8 @@ function action() LimeExpressionManager::SetDirtyFlag(); buildsurveysession($surveyid); if (loadanswers()){ - Yii::app()->setConfig('move','movenext'); - $move = "movenext";// 140113 : deprecated ? + Yii::app()->setConfig('move','reload'); + $move = "reload";// veyRunTimeHelper use $move in $arg } else { $errormsg .= gT("There is no matching saved survey"); } diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index e9ad65b0588..a26e764ccdb 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -314,13 +314,20 @@ function run($surveyid,$args) { $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, true, false, true); //$backpopup=gT("Clear all need confirmation."); } - if (!(isset($_POST['saveall']) || isset($_POST['saveprompt']) || isset($_GET['sid']) || $LEMskipReprocessing || (isset($move) && (preg_match('/^changelang_/',$move))))) + if (isset($move)) { - $_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step']; + if(!in_array($move,array("clearall","changelang","saveall","reload"))) + $_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step']; + else // Accepted $move without error + $_SESSION[$LEMsessid]['prevstep']= $move; + } + else + { + //$_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step']-1; // Is this needed ? } if (!isset($_SESSION[$LEMsessid]['prevstep'])) { - $_SESSION[$LEMsessid]['prevstep']=-1; // this only happens on re-load + $_SESSION[$LEMsessid]['prevstep']=$_SESSION[$LEMsessid]['step']-1; // this only happens on re-load } if (isset($_SESSION[$LEMsessid]['LEMtokenResume'])) @@ -451,7 +458,7 @@ function run($surveyid,$args) { $cSave = new Save(); } if ($thissurvey['active'] == "Y" && Yii::app()->request->getPost('saveall')) // Don't test if save is allowed - { + { $bTokenAnswerPersitance = $thissurvey['tokenanswerspersistence'] == 'Y' && isset($surveyid) && tableExists('tokens_'.$surveyid); // must do this here to process the POSTed values $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false); // by jumping to current step, saves data so far