Commit 447b2b33 authored by Chenu Denis's avatar Chenu Denis

[feature] Add extra attributes for unicity

parent 16b15f33
......@@ -5,7 +5,7 @@
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2018 Denis Chenu <http://sondages.pro>
* @license AGPL v3
* @version 0.3.0
* @version 0.4.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
......@@ -100,6 +100,11 @@ class surveyRegister extends PluginBase
'current'=>$this->get('tokenAttribute_lastname', 'Survey', $iSurveyId,""),
),
);
$optionAttributes = array(
'email' => $this->gT("Email"),
'firstname' => $this->gT("First Name"),
'lastname' => $this->gT("Last Name"),
);
if($this->get('registerTo', 'Survey', $iSurveyId,null)) {
$oSurvey = Survey::model()->findByPk($this->get('registerTo', 'Survey', $iSurveyId,null));
if($oSurvey) {
......@@ -111,6 +116,7 @@ class surveyRegister extends PluginBase
'label'=>sprintf($this->gT("Attribute %s for token."),$description),
'current'=>$this->get('tokenAttribute_'.$attribute, 'Survey', $iSurveyId,""),
);
$optionAttributes[$attribute] = $description;
}
}
}
......@@ -118,11 +124,7 @@ class surveyRegister extends PluginBase
'tokenUnicity' => array(
'type' => 'select',
'label'=>$this->gT("Control unicity for token with."),
'options'=>array(
'email' => $this->gT("Email"),
'firstname' => $this->gT("First Name"),
'lastname' => $this->gT("Last Name"),
),
'options'=>$optionAttributes,
'htmlOptions'=>array(
'empty'=>$this->gT("None"),
),
......
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