diff --git a/application/controllers/SurveyAdministrationController.php b/application/controllers/SurveyAdministrationController.php index c035f214758..177971d765e 100644 --- a/application/controllers/SurveyAdministrationController.php +++ b/application/controllers/SurveyAdministrationController.php @@ -1746,12 +1746,13 @@ public function actionActivate($iSurveyID) $noOnclickAction = "window.location.href='" . (Yii::app()->getController()->createUrl("surveyAdministration/view/surveyid/" . $iSurveyID)) . "'"; $activationData = array( - 'iSurveyID' => $iSurveyID, - 'warning' => $warning, - 'allowregister' => $allowregister, - 'onclickAction' => $onclickAction, + 'iSurveyID' => $iSurveyID, + 'survey' => $survey, + 'warning' => $warning, + 'allowregister' => $allowregister, + 'onclickAction' => $onclickAction, 'closedOnclickAction' => $closedOnclickAction, - 'noOnclickAction' => $noOnclickAction, + 'noOnclickAction' => $noOnclickAction, ); $this->aData = $aData; $this->render('_activation_feedback', $activationData); diff --git a/application/controllers/admin/tokens.php b/application/controllers/admin/tokens.php index 749b67a986d..312d0c82395 100644 --- a/application/controllers/admin/tokens.php +++ b/application/controllers/admin/tokens.php @@ -29,7 +29,7 @@ class tokens extends Survey_Common_Action * @param int $surveyid The survey ID * @return void */ - public function index($surveyid) + public function index(int $surveyid) { App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts') . 'tokens.js', LSYii_ClientScript::POS_BEGIN); $iSurveyId = $surveyid; @@ -2276,7 +2276,7 @@ public function tokenify($iSurveyId) * @param int $iSurveyId * @return void */ - public function kill($iSurveyId) + public function kill(int $iSurveyId) { $iSurveyId = (int) $iSurveyId; $survey = Survey::model()->findByPk($iSurveyId); @@ -2307,15 +2307,8 @@ public function kill($iSurveyId) if (!Yii::app()->request->getQuery('ok')) { $aData['sidemenu']['state'] = false; - $this->_renderWrappedTemplate('token', array('message' => array( - 'title' => gT("Delete survey participants table"), - 'message' => gT("If you delete this table access codes will no longer be required to access this survey.") . "
" . gT("A backup of this table will be made if you proceed. Your system administrator will be able to access this table.") . "
\n" - . sprintf('("%s")

', $newtableDisplay) - . "getController()->createUrl("admin/tokens/sa/kill/surveyid/{$iSurveyId}/ok/Y") . "', '_top')\" />\n" - . "getController()->createUrl("admin/tokens/sa/index/surveyid/{$iSurveyId}") . "', '_top')\" />\n" - )), $aData); + $aData['backupTableName'] = $newtableDisplay; + $this->_renderWrappedTemplate('token', 'deleteParticipantsTable', $aData); } else /* The user has confirmed they want to delete the tokens table */ { Yii::app()->db->createCommand()->renameTable("{{{$oldtable}}}", "{{{$newtable}}}"); @@ -2334,14 +2327,8 @@ public function kill($iSurveyId) SurveyLink::model()->deleteLinksBySurvey($iSurveyId); $aData['sidemenu']['state'] = false; - $this->_renderWrappedTemplate('token', array('message' => array( - 'title' => gT("Delete survey participants table"), - 'message' => '
' . gT("The participant table has now been removed and access codes are no longer required to access this survey.") . "
" . gT("A backup of this table has been made and can be accessed by your system administrator.") . "
\n" - . sprintf('("%s")

', $newtableDisplay) - . "getController()->createUrl("surveyAdministration/view/surveyid/" . $iSurveyId) . "', '_top')\" />" - )), $aData); - + $aData['backupTableName'] = $newtableDisplay; + $this->_renderWrappedTemplate('token', 'afterDeleteParticipantsTable', $aData); LimeExpressionManager::SetDirtyFlag(); // so that knows that survey participants tables have changed } } diff --git a/application/views/admin/token/afterDeleteParticipantsTable.php b/application/views/admin/token/afterDeleteParticipantsTable.php new file mode 100644 index 00000000000..f3c6e618846 --- /dev/null +++ b/application/views/admin/token/afterDeleteParticipantsTable.php @@ -0,0 +1,31 @@ + +
+
+
+
+

+

+

+ +

+ +
+ +

+ Survey participants and click on the ''Switch to closed-access mode'' button."); ?> +

+ ', + '_top'" /> +

+
+
+
diff --git a/application/views/admin/token/deleteParticipantsTable.php b/application/views/admin/token/deleteParticipantsTable.php new file mode 100644 index 00000000000..a945c496374 --- /dev/null +++ b/application/views/admin/token/deleteParticipantsTable.php @@ -0,0 +1,39 @@ + +
+
+
+
+

+

+ +

+ +

+ +
+ +

+ Survey participants and click on the 'Switch to closed-access mode' button."); ?> +

+

+ ', + '_top')" /> + ', + '_top')" /> + +
+
\ No newline at end of file diff --git a/application/views/admin/token/tokenwarning.php b/application/views/admin/token/tokenwarning.php index cfa66388ab0..f6b21ef2ce7 100644 --- a/application/views/admin/token/tokenwarning.php +++ b/application/views/admin/token/tokenwarning.php @@ -16,23 +16,17 @@

hasSurveyPermission($oSurvey->sid, 'surveysettings', 'update') || Permission::model()->hasSurveyPermission($oSurvey->sid, 'tokens','create')){ - eT("If you initialise a survey participants table for this survey then this survey will only be accessible to users who provide an access code either manually or by URL."); - ?>

- - isAnonymized) { - eT("Note: If you turn on the -Anonymized responses- option for this survey then LimeSurvey will mark participants who complete the survey only with a 'Y' instead of date/time to ensure the anonymity of your participants."); - ?>

- + if (Permission::model()->hasSurveyPermission($oSurvey->sid, 'surveysettings', 'update') || Permission::model()->hasSurveyPermission($oSurvey->sid, 'tokens','create')) { + /** eT("If you initialise a survey participants table for this survey then this survey will only be accessible to users who provide an access code either manually or by URL."); **/ + eT("If you switch to closed-access mode then this survey will only be accessible to users who provide an access code either manually or by URL."); ?> +

+ Survey participants and click on the red 'Delete participants table' button from the top bar."); ?> +



sid}"), 'post'); ?> - - sid"); ?>" class="btn btn-default btn-lg"> + + sid"); ?>" class="btn btn-default btn-lg"> diff --git a/application/views/surveyAdministration/_activation_feedback.php b/application/views/surveyAdministration/_activation_feedback.php index a206e3dc564..e1b2f3c98e7 100644 --- a/application/views/surveyAdministration/_activation_feedback.php +++ b/application/views/surveyAdministration/_activation_feedback.php @@ -16,9 +16,11 @@

-

()

+

+ (currentLanguageSettings->surveyls_title; ?>) +

- +

@@ -41,15 +43,19 @@ class="btn btn-default btn-lg limebutton"

- -

- - - + + + Overview --> Share your survey."); ?> +
+
+ + + +

- + Survey participants and click on the red 'Delete participants table' button from the top bar.");?>