Skip to content

Commit

Permalink
Dev: Move redirect outside of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Nov 24, 2017
1 parent fd221b4 commit 2436779
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions application/controllers/admin/database.php
Expand Up @@ -315,20 +315,21 @@ private function actionUpdateAnswerOptions($iSurveyID)
if (isset($sOldCode) && $sCode !== $sOldCode) {
Condition::model()->updateAll(array('value'=>$sCode), 'cqid=:cqid AND value=:value', array(':cqid'=>$this->iQuestionID, ':value'=>$sOldCode));
}

} // for ($sortorderid=0;$sortorderid<$maxcount;$sortorderid++)
}

LimeExpressionManager::UpgradeConditionsToRelevance($iSurveyID);
if (!Yii::app()->request->getPost('bFullPOST')) {
Yii::app()->setFlashMessage(gT("Not all answer options were saved. This usually happens due to server limitations ( PHP setting max_input_vars) - please contact your system administrator."), 'error');
} else {
Yii::app()->setFlashMessage(gT("Answer options were successfully saved."));
}
LimeExpressionManager::SetDirtyFlag();
if (Yii::app()->request->getPost('close-after-save') === 'true') {
$this->getController()->redirect(array('admin/questions/sa/view/surveyid/'.$iSurveyID.'/gid/'.$this->iQuestionGroupID.'/qid/'.$this->iQuestionID));
}
$this->getController()->redirect(array('/admin/questions/sa/answeroptions/surveyid/'.$iSurveyID.'/gid/'.$this->iQuestionGroupID.'/qid/'.$this->iQuestionID));
LimeExpressionManager::UpgradeConditionsToRelevance($iSurveyID);
if (!Yii::app()->request->getPost('bFullPOST')) {
Yii::app()->setFlashMessage(gT("Not all answer options were saved. This usually happens due to server limitations ( PHP setting max_input_vars) - please contact your system administrator."), 'error');
} else {
Yii::app()->setFlashMessage(gT("Answer options were successfully saved."));
}
LimeExpressionManager::SetDirtyFlag();
if (Yii::app()->request->getPost('close-after-save') === 'true') {
$this->getController()->redirect(array('admin/questions/sa/view/surveyid/'.$iSurveyID.'/gid/'.$this->iQuestionGroupID.'/qid/'.$this->iQuestionID));
}
$this->getController()->redirect(array('/admin/questions/sa/answeroptions/surveyid/'.$iSurveyID.'/gid/'.$this->iQuestionGroupID.'/qid/'.$this->iQuestionID));
}

/**
Expand Down

0 comments on commit 2436779

Please sign in to comment.