Skip to content

Commit

Permalink
Fixed issue #09404: No alert are shown when error is made
Browse files Browse the repository at this point in the history
Fixed issue #09403: Save after error submitted show unneeded alert
Dev: loadall must be reworked, maybe in another controller is better ?
Dev: Same for saveall (same controller ?)
  • Loading branch information
Shnoulle committed Dec 14, 2014
1 parent 919fcb8 commit 98c5947
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions application/controllers/survey/index.php
Expand Up @@ -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");
}
Expand Down
15 changes: 11 additions & 4 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -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']))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 98c5947

Please sign in to comment.