diff --git a/application/controllers/RegisterController.php b/application/controllers/RegisterController.php index 5b32da72098..ae6fe533829 100644 --- a/application/controllers/RegisterController.php +++ b/application/controllers/RegisterController.php @@ -243,9 +243,9 @@ public function sendRegistrationEmail($iSurveyId,$iTokenId){ $useHtmlEmail = (getEmailFormat($iSurveyId) == 'html'); $aMail['subject']=preg_replace("/{TOKEN:([A-Z0-9_]+)}/","{"."$1"."}",$aMail['subject']); $aMail['message']=preg_replace("/{TOKEN:([A-Z0-9_]+)}/","{"."$1"."}",$aMail['message']); - $aReplacementFields["{SURVEYURL}"] = App()->createAbsoluteUrl("/survey/index/sid/{$iSurveyId}",array('lang'=>$sLanguage,'token'=>$sToken)); - $aReplacementFields["{OPTOUTURL}"] = App()->createAbsoluteUrl("/optout/tokens/surveyid/{$iSurveyId}",array('langcode'=>$sLanguage,'token'=>$sToken)); - $aReplacementFields["{OPTINURL}"] = App()->createAbsoluteUrl("/optin/tokens/surveyid/{$iSurveyId}",array('langcode'=>$sLanguage,'token'=>$sToken)); + $aReplacementFields["{SURVEYURL}"] = Yii::app()->getController()->createAbsoluteUrl("/survey/index/sid/{$iSurveyId}",array('lang'=>$sLanguage,'token'=>$sToken)); + $aReplacementFields["{OPTOUTURL}"] = Yii::app()->getController()->createAbsoluteUrl("/optout/tokens/surveyid/{$iSurveyId}",array('langcode'=>$sLanguage,'token'=>$sToken)); + $aReplacementFields["{OPTINURL}"] = Yii::app()->getController()->createAbsoluteUrl("/optin/tokens/surveyid/{$iSurveyId}",array('langcode'=>$sLanguage,'token'=>$sToken)); foreach(array('OPTOUT', 'OPTIN', 'SURVEY') as $key) { $url = $aReplacementFields["{{$key}URL}"]; diff --git a/application/helpers/frontend_helper.php b/application/helpers/frontend_helper.php index 51d8f1cebbf..b7a234d4673 100644 --- a/application/helpers/frontend_helper.php +++ b/application/helpers/frontend_helper.php @@ -535,7 +535,7 @@ function submittokens($quotaexit=false) $aReplacementVars["TOKEN"]=$token->token; $aReplacementVars["EMAIL"]=$token->email; // added survey url in replacement vars - $surveylink = Yii::app()->createAbsoluteUrl("/survey/index/sid/{$surveyid}",array('lang'=>$_SESSION['survey_'.$surveyid]['s_lang'],'token'=>$token->token)); + $surveylink = Yii::app()->getController()->createAbsoluteUrl("/survey/index/sid/{$surveyid}",array('lang'=>$_SESSION['survey_'.$surveyid]['s_lang'],'token'=>$token->token)); $aReplacementVars['SURVEYURL'] = $surveylink; $attrfieldnames=getAttributeFieldNames($surveyid); @@ -634,7 +634,7 @@ function sendSubmitNotifications($surveyid) return; } - $homeurl=Yii::app()->createAbsoluteUrl('/admin'); + $homeurl=Yii::app()->getController()->createAbsoluteUrl('/admin'); $sitename = Yii::app()->getConfig("sitename"); @@ -663,9 +663,10 @@ function sendSubmitNotifications($surveyid) $srid = $_SESSION['survey_'.$surveyid]['srid']; $aReplacementVars['ADMINNAME'] = $thissurvey['adminname']; $aReplacementVars['ADMINEMAIL'] = $thissurvey['adminemail']; - $aReplacementVars['VIEWRESPONSEURL']=Yii::app()->createAbsoluteUrl("/admin/responses/sa/view/surveyid/{$surveyid}/id/{$srid}"); - $aReplacementVars['EDITRESPONSEURL']=Yii::app()->createAbsoluteUrl("/admin/dataentry/sa/editdata/subaction/edit/surveyid/{$surveyid}/id/{$srid}"); - $aReplacementVars['STATISTICSURL']=Yii::app()->createAbsoluteUrl("/admin/statistics/sa/index/surveyid/{$surveyid}"); + debugbreak(); + $aReplacementVars['VIEWRESPONSEURL']=Yii::app()->getController()->createAbsoluteUrl("/admin/responses/sa/view/surveyid/{$surveyid}/id/{$srid}"); + $aReplacementVars['EDITRESPONSEURL']=Yii::app()->getController()->createAbsoluteUrl("/admin/dataentry/sa/editdata/subaction/edit/surveyid/{$surveyid}/id/{$srid}"); + $aReplacementVars['STATISTICSURL']=Yii::app()->getController()->createAbsoluteUrl("/admin/statistics/sa/index/surveyid/{$surveyid}"); if ($bIsHTML) { $aReplacementVars['VIEWRESPONSEURL']="{$aReplacementVars['VIEWRESPONSEURL']}";