|
|
@@ -68,6 +68,7 @@ class SignupForm extends Model |
|
|
|
public $code; |
|
|
|
public $type; |
|
|
|
public $free_price ; |
|
|
|
public $id_tax_rate_default ; |
|
|
|
|
|
|
|
/** |
|
|
|
* @inheritdoc |
|
|
@@ -79,7 +80,7 @@ class SignupForm extends Model |
|
|
|
['email', 'required', 'message' => 'Champs obligatoire'], |
|
|
|
['email', 'email'], |
|
|
|
['email', 'unique', 'targetClass' => '\common\models\User', 'message' => 'Cet email est déjà utilisé'], |
|
|
|
[['name', 'lastname', 'phone'], 'required', 'message' => 'Champs obligatoire'], |
|
|
|
[['name', 'lastname', 'phone','id_tax_rate_default'], 'required', 'message' => 'Champs obligatoire'], |
|
|
|
[['name', 'lastname', 'phone', 'option_user_producer'], 'string', 'min' => 2, 'max' => 255], |
|
|
|
['password', 'required', 'message' => 'Champs obligatoire'], |
|
|
|
['password', 'string', 'min' => 6, 'tooShort' => 'Votre mot de passe doit contenir au moins 6 caractères'], |
|
|
@@ -178,6 +179,9 @@ class SignupForm extends Model |
|
|
|
} |
|
|
|
}], |
|
|
|
['free_price', 'number'], |
|
|
|
['id_tax_rate_default', 'exist', |
|
|
|
'targetClass' => TaxRate::className(), |
|
|
|
'targetAttribute' => ['id_tax_rate_default' => 'id']] |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
@@ -198,7 +202,8 @@ class SignupForm extends Model |
|
|
|
'city' => 'Commune', |
|
|
|
'id_producer' => 'Producteur', |
|
|
|
'type' => 'Type de producteur', |
|
|
|
'free_price' => 'Prix libre' |
|
|
|
'free_price' => 'Prix libre', |
|
|
|
'id_tax_rate_default' => 'TVA par défaut', |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
@@ -228,6 +233,7 @@ class SignupForm extends Model |
|
|
|
$producer->order_deadline = 20; |
|
|
|
$producer->order_delay = 1; |
|
|
|
$producer->free_price = (float) abs($this->free_price); |
|
|
|
$producer->id_tax_rate_default = $this->id_tax_rate_default ; |
|
|
|
|
|
|
|
$cptSlug = 0 ; |
|
|
|
do { |