Commit 16b15f33 authored by Chenu Denis's avatar Chenu Denis

[feature] REGISTERED_(TOKEN|URL…) is really more easy

parent c2149f64
......@@ -5,7 +5,7 @@
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2018 Denis Chenu <http://sondages.pro>
* @license AGPL v3
* @version 0.2.0
* @version 0.3.0
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
......@@ -62,7 +62,7 @@ class surveyRegister extends PluginBase
),
'options'=>$aQuotas,
'current'=>$this->get('quotaTextToUseForUnicity', 'Survey', $iSurveyId,''),
'help' => sprintf($this->gT("You can use the new token attribute using %s,%s,%s … and %s"),"REGISTEREDTOKEN","REGISTEREDEMAIL","REGISTEREDFIRSTNAME","REGISTEREDURL"),
'help' => sprintf($this->gT("You can use the new token attribute using %s,%s,%s … and %s"),"REGISTERED_TOKEN","REGISTERED_EMAIL","REGISTERED_ATTRIBUTE_1","REGISTERED_URL"),
);
}
/* Create extra attributes part */
......@@ -274,15 +274,15 @@ class surveyRegister extends PluginBase
$newSurveyAbsolueUrl = App()->getController()->createAbsoluteUrl("/survey/index",array('sid'=>$registerTo,'token'=>$token,'lang'=>$language,'newtest'=>'Y'));
/* Prepare replacements */
$aReplacement = array(
'REGISTEREDURL' => $newSurveyUrl,
'REGISTEREDABSOLUTEURL' => $newSurveyAbsolueUrl,
'REGISTEREDTOKEN' => $oToken->token,
'REGISTERED_URL' => $newSurveyUrl,
'REGISTERED_ABSOLUTEURL' => $newSurveyAbsolueUrl,
'REGISTERED_TOKEN' => $oToken->token,
);
if($token) {
$oToken = Token::model($registerTo)->findByToken($token); /* Reset the token */
}
foreach($oToken->attributes as $key=>$value) {
$aReplacement['REGISTERED'.strtoupper($key)]=$value;
$aReplacement['REGISTERED_'.strtoupper($key)]=$value;
}
if(!$newToken && $this->get('quotaTextToUseForUnicity','Survey',$iSurveyId,0)) {
$quotaId = $this->get('quotaTextToUseForUnicity','Survey',$iSurveyId,0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment