|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
if ($model->load(\Yii::$app->request->post()) && $model->validate() && YII_ENV != 'demo') { |
|
|
if ($model->load(\Yii::$app->request->post()) && $model->validate() && YII_ENV != 'demo') { |
|
|
|
|
|
|
|
|
$model = $userModule->getBuilder()->createUser( |
|
|
|
|
|
User::TYPE_INDIVIDUAL, |
|
|
|
|
|
|
|
|
$userCreate = $userModule->getBuilder()->createUser( |
|
|
|
|
|
$model->type, |
|
|
$model->email, |
|
|
$model->email, |
|
|
$model->name, |
|
|
$model->name, |
|
|
$model->lastname, |
|
|
$model->lastname, |
|
|
|
|
|
|
|
|
Password::generate(), |
|
|
Password::generate(), |
|
|
$model->send_mail_welcome |
|
|
$model->send_mail_welcome |
|
|
); |
|
|
); |
|
|
|
|
|
$userCreate->points_sale = $model->points_sale; |
|
|
|
|
|
$userCreate->user_groups = $model->user_groups; |
|
|
|
|
|
|
|
|
$this->processLinkPointSale($model); |
|
|
|
|
|
$this->processLinkUserGroup($model); |
|
|
|
|
|
$this->processProductPricePercent($model); |
|
|
|
|
|
|
|
|
$this->processLinkPointSale($userCreate); |
|
|
|
|
|
$this->processLinkUserGroup($userCreate); |
|
|
|
|
|
//$this->processProductPricePercent($model); |
|
|
|
|
|
|
|
|
$this->setFlash('success', 'Utilisateur créé.'); |
|
|
$this->setFlash('success', 'Utilisateur créé.'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
$this->processLinkPointSale($model); |
|
|
$this->processLinkPointSale($model); |
|
|
$this->processLinkUserGroup($model); |
|
|
$this->processLinkUserGroup($model); |
|
|
$this->processProductPricePercent($model); |
|
|
|
|
|
|
|
|
//$this->processProductPricePercent($model); |
|
|
|
|
|
|
|
|
if($model->newsletter) { |
|
|
if($model->newsletter) { |
|
|
$userModule->getNewsletterManager()->subscribeUserNewsletter($model); |
|
|
$userModule->getNewsletterManager()->subscribeUserNewsletter($model); |