diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index a877d0b4c7b..7ce461156bc 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -935,6 +935,7 @@ private function displayFirstPageIfNeeded() $bDisplayFirstPage = ($this->sSurveyMode != 'survey' && $_SESSION[$this->LEMsessid]['step'] == 0); if ($this->sSurveyMode == 'survey' || $bDisplayFirstPage) { + //Failsave to have a general standard value if (empty($this->aSurveyInfo['datasecurity_notice_label'])) { $this->aSurveyInfo['datasecurity_notice_label'] = gT("To continue please first accept our survey data policy."); @@ -943,6 +944,8 @@ private function displayFirstPageIfNeeded() if (empty($this->aSurveyInfo['datasecurity_error'])) { $this->aSurveyInfo['datasecurity_error'] = gT("We are sorry but you can't proceed without first agreeing to our survey data policy."); } + + $this->aSurveyInfo['datasecurity_notice_label'] = Survey::replacePolicyLink($this->aSurveyInfo['datasecurity_notice_label'],$this->aSurveyInfo['sid']); } @@ -954,16 +957,18 @@ private function displayFirstPageIfNeeded() } private function checkForDataSecurityAccepted(){ - if($this->param['thisstep'] === '0' && Survey::model()->findByPk($this->aSurveyInfo['sid'])->showsurveypolicynotice>0) { - $data_security_accepted = App()->request->getPost('datasecurity_accepted', false); - // if($data_security_accepted !== 'on' && ($this->aSurveyInfo['active'] == 'Y')){ - if($data_security_accepted !== 'on'){ + $this->aSurveyInfo['datasecuritynotaccepted'] = false; + if($this->param['thisstep'] === '0' && Survey::model()->findByPk($this->aSurveyInfo['sid'])->showsurveypolicynotice>0) { + $data_security_accepted = App()->request->getPost('datasecurity_accepted', false); + $move_step = App()->request->getPost('move', false); + + if($data_security_accepted !== 'on' && ($move_step !== 'default')){ $_SESSION[$this->LEMsessid]['step'] = 0; $this->aSurveyInfo['datasecuritynotaccepted'] = true; $this->displayFirstPageIfNeeded(true); Yii::app()->end(); // So we can still see debug messages } - } + } } /** diff --git a/themes/survey/vanilla/scripts/theme.js b/themes/survey/vanilla/scripts/theme.js index bbcd971ae17..d4cabf83588 100644 --- a/themes/survey/vanilla/scripts/theme.js +++ b/themes/survey/vanilla/scripts/theme.js @@ -279,6 +279,7 @@ var ThemeScripts = function(){ var initWelcomePage = function(){ logObject.log('Starting up for first page'); if($('#datasecurity_accepted').length >0) { + $('#ls-button-submit').prop('disabled', true); /* * #### Animation function doesn't work on IE -> Deactivate until now. * $('#ls-button-submit').prop('disabled', true).parent().on('mouseenter', function(e){ diff --git a/themes/survey/vanilla/views/subviews/privacy/privacy_modal.twig b/themes/survey/vanilla/views/subviews/privacy/privacy_modal.twig index 44cb1c32303..2b9855fa87d 100644 --- a/themes/survey/vanilla/views/subviews/privacy/privacy_modal.twig +++ b/themes/survey/vanilla/views/subviews/privacy/privacy_modal.twig @@ -20,7 +20,7 @@
-   +