diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index 17ab597943f..263510b64d3 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -113,6 +113,8 @@ public function run($surveyid,$args) $this->setPreview(); } + + $this->moveSubmitIfNeeded(); $this->setGroup(); @@ -907,7 +909,8 @@ private function displayFirstPageIfNeeded() // submit page. if ($this->sSurveyMode != 'survey' && $_SESSION[$this->LEMsessid]['step'] == 0){ $_SESSION[$this->LEMsessid]['test']=time(); - display_first_page($this->thissurvey); + + display_first_page($this->thissurvey, $this->aSurveyInfo); Yii::app()->end(); // So we can still see debug messages } } @@ -1653,6 +1656,7 @@ private function setSurveySettings( $surveyid, $args ) $this->setSurveyMode(); $this->setSurveyOptions(); + $this->setClassAndIds(); $this->previewgrp = ($this->sSurveyMode == 'group' && isset($param['action']) && ($param['action'] == 'previewgroup')) ? true : false; $this->previewquestion = ($this->sSurveyMode == 'question' && isset($param['action']) && ($param['action'] == 'previewquestion')) ? true : false; @@ -1728,6 +1732,12 @@ private function setGroup() } } + private function setClassAndIds() + { + $this->aSurveyInfo['class']['activealert'] = ' alert alert-warning alert-dismissible fade in alert-dismissible '; + $this->aSurveyInfo['class']['errorHtml'] = ' fade in alert-dismissible ls-questions-have-errors alert alert-danger '; + } + private function fixMaxStep() { // NOTE: must stay after setPreview because of ()$this->sSurveyMode == 'group' && $this->previewgrp) condition touching step diff --git a/application/helpers/frontend_helper.php b/application/helpers/frontend_helper.php index 54c6a4d81b9..b34e3c9ffcc 100644 --- a/application/helpers/frontend_helper.php +++ b/application/helpers/frontend_helper.php @@ -2059,9 +2059,11 @@ function getReferringUrl() /** * Shows the welcome page, used in group by group and question by question mode */ -function display_first_page($thissurvey) { +function display_first_page($thissurvey, $aSurveyInfo) +{ global $token, $surveyid; + $thissurvey = $aSurveyInfo; $thissurvey['aNavigator'] = getNavigatorDatas(); LimeExpressionManager::StartProcessingPage(); diff --git a/templates/default/views/subviews/warnings.twig b/templates/default/views/subviews/warnings.twig index cec4aa4592b..9272d3a5728 100644 --- a/templates/default/views/subviews/warnings.twig +++ b/templates/default/views/subviews/warnings.twig @@ -28,7 +28,7 @@ {# Preview mode warning #} {% if aSurveyInfo.active != 'Y' %} -