diff --git a/application/controllers/admin/database.php b/application/controllers/admin/database.php index cc4e648eac6..84fa54007e1 100644 --- a/application/controllers/admin/database.php +++ b/application/controllers/admin/database.php @@ -66,7 +66,7 @@ class database extends Survey_Common_Action 'showqnumcode' => ['type'=> '', 'default' => false, 'dbname'=>false, 'active'=>true, 'required'=>[]], 'shownoanswer' => ['type'=> 'yesno', 'default' => false, 'dbname'=>false, 'active'=>true, 'required'=>[]], 'showwelcome' => ['type'=> 'yesno', 'default' => false, 'dbname'=>false, 'active'=>true, 'required'=>[]], - 'showdatasecuritynotice' => ['type'=> '', 'default' => 0, 'dbname'=>false, 'active'=>true, 'required'=>[]], + 'showsurveypolicynotice' => ['type'=> '', 'default' => 0, 'dbname'=>false, 'active'=>true, 'required'=>[]], 'allowprev' => ['type'=> 'yesno', 'default' => false, 'dbname'=>false, 'active'=>true, 'required'=>[]], 'questionindex' => ['type'=> '', 'default' => false, 'dbname'=>false, 'active'=>true, 'required'=>[]], 'nokeyboard' => ['type'=> 'yesno', 'default' => false, 'dbname'=>false, 'active'=>true, 'required'=>[]], @@ -848,15 +848,15 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID) if ($datasec !== null) { // Fix bug with FCKEditor saving strange BR types $datasec = $this->oFixCKeditor->fixCKeditor($datasec); - $data['surveyls_datasecurity_notice'] = $datasec; + $data['surveyls_policy_notice'] = $datasec; } if ($datasecerror !== null) { // Fix bug with FCKEditor saving strange BR types $datasecerror = $this->oFixCKeditor->fixCKeditor($datasecerror); - $data['surveyls_datasecurity_error'] = $datasecerror; + $data['surveyls_policy_error'] = $datasecerror; } if ($dataseclabel !== null) { - $data['surveyls_datasecurity_notice_label'] = $dataseclabel; + $data['surveyls_policy_notice_label'] = $dataseclabel; } if ($sURL !== null) { $data['surveyls_url'] = html_entity_decode($sURL, ENT_QUOTES, "UTF-8"); @@ -949,7 +949,7 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID) $oSurvey->showqnumcode = $this->_filterEmptyFields($oSurvey, 'showqnumcode'); $oSurvey->shownoanswer = $this->_filterEmptyFields($oSurvey, 'shownoanswer'); $oSurvey->showwelcome = $this->_filterEmptyFields($oSurvey, 'showwelcome'); - $oSurvey->showdatasecuritynotice = $this->_filterEmptyFields($oSurvey, 'showdatasecuritynotice'); + $oSurvey->showsurveypolicynotice = $this->_filterEmptyFields($oSurvey, 'showsurveypolicynotice'); $oSurvey->allowprev = $this->_filterEmptyFields($oSurvey, 'allowprev'); $oSurvey->questionindex = (int) $this->_filterEmptyFields($oSurvey, 'questionindex'); $oSurvey->nokeyboard = $this->_filterEmptyFields($oSurvey, 'nokeyboard'); diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index 9b4863227ee..6f539a6026c 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -946,11 +946,11 @@ private function displayFirstPageIfNeeded() 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("Please accept the data security policy"); + $this->aSurveyInfo['datasecurity_notice_label'] = gT("To continue please first accept our survey policy."); } if (empty($this->aSurveyInfo['datasecurity_error'])) { - $this->aSurveyInfo['datasecurity_error'] = gT("You have to accept the data security policy!"); + $this->aSurveyInfo['datasecurity_error'] = gT("You will have to accept our survey policy!"); } $this->aSurveyInfo['description'] = $this->processString($this->aSurveyInfo['description']); @@ -969,7 +969,7 @@ private function displayFirstPageIfNeeded() } private function checkForDataSecurityAccepted(){ - if($this->param['thisstep'] === '0' && Survey::model()->findByPk($this->aSurveyInfo['sid'])->showdatasecuritynotice>0) { + 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'){ diff --git a/application/helpers/admin/survey_helper.php b/application/helpers/admin/survey_helper.php index e752d8c7046..bd2424f84b3 100644 --- a/application/helpers/admin/survey_helper.php +++ b/application/helpers/admin/survey_helper.php @@ -46,7 +46,7 @@ function getSurveyDefaultSettings() 'expires' => '', 'showqnumcode' => 'X', 'showwelcome' => 'Y', - 'showdatasecuritynotice' => 0, + 'showsurveypolicynotice' => 0, 'emailresponseto' => '', 'assessments' => 'N', 'navigationdelay' => 0); diff --git a/application/helpers/common_helper.php b/application/helpers/common_helper.php index ad5bbe4ca60..2f3682ca272 100644 --- a/application/helpers/common_helper.php +++ b/application/helpers/common_helper.php @@ -871,9 +871,9 @@ function getSurveyInfo($surveyid, $languagecode = '') $thissurvey['name'] = $thissurvey['surveyls_title']; $thissurvey['description'] = $thissurvey['surveyls_description']; $thissurvey['welcome'] = $thissurvey['surveyls_welcometext']; - $thissurvey['datasecurity_notice_label'] = $thissurvey['surveyls_datasecurity_notice_label']; - $thissurvey['datasecurity_error'] = $thissurvey['surveyls_datasecurity_error']; - $thissurvey['datasecurity_notice'] = $thissurvey['surveyls_datasecurity_notice']; + $thissurvey['datasecurity_notice_label'] = $thissurvey['surveyls_policy_notice_label']; + $thissurvey['datasecurity_error'] = $thissurvey['surveyls_policy_error']; + $thissurvey['datasecurity_notice'] = $thissurvey['surveyls_policy_notice']; $thissurvey['templatedir'] = $thissurvey['template']; $thissurvey['adminname'] = $thissurvey['admin']; $thissurvey['tablename'] = $oSurvey->responsesTableName; diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index 3b3a4fe1e63..3b8456400fe 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -9345,26 +9345,26 @@ static public function ShowSurveyLogicFile($sid, $gid=NULL, $qid=NULL,$LEMdebugL $errClass = ($LEM->em->HasErrors() ? 'danger' : ''); $out .= "" . $LEM->gT("End URL:") . "" . $sPrint . ""; } - if ($aSurveyInfo['surveyls_datasecurity_notice'] != '') + if ($aSurveyInfo['surveyls_policy_notice'] != '') { - $LEM->ProcessString($aSurveyInfo['surveyls_datasecurity_notice'],0); + $LEM->ProcessString($aSurveyInfo['surveyls_policy_notice'],0); $sPrint= viewHelper::purified(viewHelper::filterScript($LEM->GetLastPrettyPrintExpression())); $errClass = ($LEM->em->HasErrors() ? 'danger' : ''); - $out .= "" . $LEM->gT("Data security:") . "" . $sPrint . ""; + $out .= "" . $LEM->gT("Survey policy notice:") . "" . $sPrint . ""; } - if ($aSurveyInfo['surveyls_datasecurity_error'] != '') + if ($aSurveyInfo['surveyls_policy_error'] != '') { - $LEM->ProcessString($aSurveyInfo['surveyls_datasecurity_error'],0); + $LEM->ProcessString($aSurveyInfo['surveyls_policy_error'],0); $sPrint= viewHelper::purified(viewHelper::filterScript($LEM->GetLastPrettyPrintExpression())); $errClass = ($LEM->em->HasErrors() ? 'danger' : ''); - $out .= "" . $LEM->gT("Data security:") . "" . $sPrint . ""; + $out .= "" . $LEM->gT("Survey policy error:") . "" . $sPrint . ""; } - if ($aSurveyInfo['surveyls_datasecurity_notice_label'] != '') + if ($aSurveyInfo['surveyls_policy_notice_label'] != '') { - $LEM->ProcessString($aSurveyInfo['surveyls_datasecurity_notice_label'],0); + $LEM->ProcessString($aSurveyInfo['surveyls_policy_notice_label'],0); $sPrint= viewHelper::purified(viewHelper::filterScript($LEM->GetLastPrettyPrintExpression())); $errClass = ($LEM->em->HasErrors() ? 'danger' : ''); - $out .= "" . $LEM->gT("Data security label:") . "" . $sPrint . ""; + $out .= "" . $LEM->gT("Survey policy label:") . "" . $sPrint . ""; } } diff --git a/application/helpers/update/updatedb_helper.php b/application/helpers/update/updatedb_helper.php index 13f9aab2fc1..ad0b6c07ff7 100644 --- a/application/helpers/update/updatedb_helper.php +++ b/application/helpers/update/updatedb_helper.php @@ -2200,10 +2200,10 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false) */ if ($iOldDBVersion < 348) { $oTransaction = $oDB->beginTransaction(); - $oDB->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_datasecurity_notice', 'text'); - $oDB->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_datasecurity_error', 'text'); - $oDB->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_datasecurity_notice_label', 'string(192)'); - $oDB->createCommand()->addColumn('{{surveys}}', 'showdatasecuritynotice', 'int DEFAULT 0'); + $oDB->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_policy_notice', 'text'); + $oDB->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_policy_error', 'text'); + $oDB->createCommand()->addColumn('{{surveys_languagesettings}}', 'surveyls_policy_notice_label', 'string(192)'); + $oDB->createCommand()->addColumn('{{surveys}}', 'showsurveypolicynotice', 'int DEFAULT 0'); $oDB->createCommand()->update('{{settings_global}}', ['stg_value'=>348], "stg_name='DBVersion'"); $oTransaction->commit(); diff --git a/application/models/Survey.php b/application/models/Survey.php index 2be6b3e9c08..8adabc44ca4 100755 --- a/application/models/Survey.php +++ b/application/models/Survey.php @@ -139,7 +139,7 @@ * @property bool $isShowQnumCode Show question number and/or code * @property bool $isShowWelcome Show welcome screen * @property bool $isShowProgress how progress bar - * @property bool $showdatasecuritynotice Show the security notice + * @property bool $showsurveypolicynotice Show the security notice * @property bool $isNoKeyboard Show on-screen keyboard * @property bool $isAllowEditAfterCompletion Allow multiple responses or update responses with one token * @property SurveyLanguageSetting $defaultlanguage @@ -159,6 +159,8 @@ class Survey extends LSActiveRecord public $searched_value; + + public $showsurveypolicynotice = 0; private $sSurveyUrl; @@ -363,7 +365,7 @@ public function rules() array('showxquestions', 'in', 'range'=>array('Y', 'N'), 'allowEmpty'=>true), array('shownoanswer', 'in', 'range'=>array('Y', 'N'), 'allowEmpty'=>true), array('showwelcome', 'in', 'range'=>array('Y', 'N'), 'allowEmpty'=>true), - array('showdatasecuritynotice', 'in', 'range'=>array('0', '1', '2'), 'allowEmpty'=>true), + array('showsurveypolicynotice', 'in', 'range'=>array('0', '1', '2'), 'allowEmpty'=>true), array('showprogress', 'in', 'range'=>array('Y', 'N'), 'allowEmpty'=>true), array('questionindex', 'numerical', 'min' => 0, 'max' => 2, 'allowEmpty'=>false), array('nokeyboard', 'in', 'range'=>array('Y', 'N'), 'allowEmpty'=>true), @@ -1856,7 +1858,7 @@ public static function replacePolicyLink($dataSecurityNoticeLabel, $surveyId) { $STARTPOLICYLINK = ""; $ENDPOLICYLINK = ""; - if(self::model()->findByPk($surveyId)->showdatasecuritynotice == 2){ + if(self::model()->findByPk($surveyId)->showsurveypolicynotice == 2){ $STARTPOLICYLINK = ""; $ENDPOLICYLINK = ""; } diff --git a/application/models/SurveyLanguageSetting.php b/application/models/SurveyLanguageSetting.php index 84f54c698bc..5569fedd57f 100644 --- a/application/models/SurveyLanguageSetting.php +++ b/application/models/SurveyLanguageSetting.php @@ -23,7 +23,7 @@ * @property string $surveyls_description Survey description in this language * @property string $surveyls_welcometext Survey welcome-text in this language * @property string $surveyls_endtext Survey end-text in this language - * @property string $surveyls_datasecurity_notice The survey data-security notice + * @property string $surveyls_policy_notice The survey data-security notice * @property string $surveyls_url Survey end-url for this language * @property string $surveyls_urldescription Survey end-url description for this language * @property string $surveyls_email_invite_subj Survey inivitation e-mail subject for this language @@ -117,9 +117,9 @@ public function rules() array('surveyls_description', 'LSYii_Validators'), array('surveyls_welcometext', 'LSYii_Validators'), array('surveyls_endtext', 'LSYii_Validators'), - array('surveyls_datasecurity_notice', 'LSYii_Validators'), - array('surveyls_datasecurity_error', 'LSYii_Validators'), - array('surveyls_datasecurity_notice_label', 'LSYii_Validators'), + array('surveyls_policy_notice', 'LSYii_Validators'), + array('surveyls_policy_error', 'LSYii_Validators'), + array('surveyls_policy_notice_label', 'LSYii_Validators'), array('surveyls_url', 'LSYii_Validators', 'isUrl'=>true), array('surveyls_urldescription', 'LSYii_Validators'), diff --git a/application/views/admin/survey/editLocalSettings_view.php b/application/views/admin/survey/editLocalSettings_view.php index f29e0845851..69e2fe3a81c 100644 --- a/application/views/admin/survey/editLocalSettings_view.php +++ b/application/views/admin/survey/editLocalSettings_view.php @@ -140,19 +140,19 @@
- 'form-control','size'=>"80",'id'=>"dataseclabel_{$aSurveyLanguageSettings['surveyls_language']}")); ?> + 'form-control','size'=>"80",'id'=>"dataseclabel_{$aSurveyLanguageSettings['surveyls_language']}")); ?>
-
+
s
- 'form-control','cols'=>'80','rows'=>'20','id'=>"datasec_{$aSurveyLanguageSettings['surveyls_language']}")); ?> + 'form-control','cols'=>'80','rows'=>'20','id'=>"datasec_{$aSurveyLanguageSettings['surveyls_language']}")); ?>
@@ -164,7 +164,7 @@
- 'form-control','cols'=>'80','rows'=>'15','id'=>"datasecerror_{$aSurveyLanguageSettings['surveyls_language']}")); ?> + 'form-control','cols'=>'80','rows'=>'15','id'=>"datasecerror_{$aSurveyLanguageSettings['surveyls_language']}")); ?>
diff --git a/application/views/admin/survey/subview/accordion/_presentation_panel.php b/application/views/admin/survey/subview/accordion/_presentation_panel.php index b69c1aacf31..d99d5055873 100644 --- a/application/views/admin/survey/subview/accordion/_presentation_panel.php +++ b/application/views/admin/survey/subview/accordion/_presentation_panel.php @@ -49,17 +49,17 @@
- +
-
diff --git a/application/views/admin/survey/surveySummary_view.php b/application/views/admin/survey/surveySummary_view.php index 0ee4ac3ed6e..5a39f30ecb9 100644 --- a/application/views/admin/survey/surveySummary_view.php +++ b/application/views/admin/survey/surveySummary_view.php @@ -171,7 +171,7 @@
- showdatasecuritynotice > 0) { ?> + showsurveypolicynotice > 0) { ?>
  • @@ -180,7 +180,7 @@
    currentLanguageSettings->surveyls_datasecurity_notice)); + templatereplace(flattenText($oSurvey->currentLanguageSettings->surveyls_policy_notice)); $fullSurveyDataSecurityNotice = LimeExpressionManager::GetLastPrettyPrintExpression(); $this->widget('ext.admin.TextDisplaySwitch.TextDisplaySwitch', array( @@ -199,7 +199,7 @@
    currentLanguageSettings->surveyls_datasecurity_error)); + templatereplace(flattenText($oSurvey->currentLanguageSettings->surveyls_policy_error)); $fullSurveyDataSecurityNoticeError = LimeExpressionManager::GetLastPrettyPrintExpression(); $this->widget('ext.admin.TextDisplaySwitch.TextDisplaySwitch', array( @@ -218,7 +218,7 @@
    currentLanguageSettings->surveyls_datasecurity_notice_label, $oSurvey->sid); + $dataSecNoticeLabel = Survey::replacePolicyLink($oSurvey->currentLanguageSettings->surveyls_policy_notice_label, $oSurvey->sid); templatereplace(flattenText($dataSecNoticeLabel)); echo LimeExpressionManager::GetLastPrettyPrintExpression(); ?> diff --git a/installer/create-database.php b/installer/create-database.php index a5ce7e2f653..42e879cc493 100755 --- a/installer/create-database.php +++ b/installer/create-database.php @@ -531,7 +531,7 @@ function createDatabase($oDB){ 'ipaddr' => "string(1) NOT NULL default 'N'", 'refurl' => "string(1) NOT NULL default 'N'", 'datecreated' => "datetime", - 'showdatasecuritynotice' => 'int DEFAULT 0', + 'showsurveypolicynotice' => 'int DEFAULT 0', 'publicstatistics' => "string(1) NOT NULL default 'N'", 'publicgraphs' => "string(1) NOT NULL default 'N'", 'listpublic' => "string(1) NOT NULL default 'N'", @@ -604,9 +604,9 @@ function createDatabase($oDB){ 'surveyls_description' => "TEXT NULL", 'surveyls_welcometext' => "TEXT NULL", 'surveyls_endtext' => "TEXT NULL", - 'surveyls_datasecurity_notice' => "TEXT NULL", - 'surveyls_datasecurity_error' => "TEXT NULL", - 'surveyls_datasecurity_notice_label' => 'string(192) NULL', + 'surveyls_policy_notice' => "TEXT NULL", + 'surveyls_policy_error' => "TEXT NULL", + 'surveyls_policy_notice_label' => 'string(192) NULL', 'surveyls_url' => "TEXT NULL", 'surveyls_urldescription' => "string(255) NULL", 'surveyls_email_invite_subj' => "string(255) NULL", diff --git a/themes/survey/vanilla/views/subviews/privacy/privacy.twig b/themes/survey/vanilla/views/subviews/privacy/privacy.twig index 94a9fa69bd4..08ce3ec04bd 100644 --- a/themes/survey/vanilla/views/subviews/privacy/privacy.twig +++ b/themes/survey/vanilla/views/subviews/privacy/privacy.twig @@ -41,9 +41,9 @@ {% endif %} {% endblock %} {% block datasecurity %} - {% if (aSurveyInfo.showdatasecuritynotice == 1) %} + {% if (aSurveyInfo.showsurveypolicynotice == 1) %} {{include('./subviews/privacy/privacy_text.twig')}} - {% elseif (aSurveyInfo.showdatasecuritynotice == 2) %} + {% elseif (aSurveyInfo.showsurveypolicynotice == 2) %} {{include( './subviews/privacy/privacy_modal.twig')}} {% endif %} {% endblock %}