|
|
@@ -51,10 +51,12 @@ use common\logic\User\User\Model\User; |
|
|
|
use common\logic\User\User\Model\UserSearch; |
|
|
|
use common\logic\User\UserProducer\Model\UserProducer; |
|
|
|
use common\logic\User\UserUserGroup\Model\UserUserGroup; |
|
|
|
use Faker\Provider\HtmlLorem; |
|
|
|
use yii\base\UserException; |
|
|
|
use yii\filters\AccessControl; |
|
|
|
use yii\filters\VerbFilter; |
|
|
|
use \Yii; |
|
|
|
use yii\helpers\Html; |
|
|
|
use yii\web\NotFoundHttpException; |
|
|
|
|
|
|
|
/** |
|
|
@@ -130,8 +132,6 @@ class UserController extends BackendController |
|
|
|
$userProducerManager = $this->getUserProducerManager(); |
|
|
|
$userGroupManager = $this->getUserGroupManager(); |
|
|
|
|
|
|
|
$producerCurrent = $this->getProducerCurrent(); |
|
|
|
|
|
|
|
if ($model->id) { |
|
|
|
$userPointSaleArray = $userPointSaleManager->findUserPointSalesByUser($model); |
|
|
|
if ($userPointSaleArray && count($userPointSaleArray) > 0) { |
|
|
@@ -178,7 +178,6 @@ class UserController extends BackendController |
|
|
|
{ |
|
|
|
$userManager = $this->getUserManager(); |
|
|
|
$producerManager = $this->getProducerManager(); |
|
|
|
$pointSaleManager = $this->getPointSaleManager(); |
|
|
|
|
|
|
|
$producerCurrent = $this->getProducerCurrent(); |
|
|
|
$model = $userManager->instanciateUser(); |
|
|
@@ -232,10 +231,6 @@ class UserController extends BackendController |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Updates an existing User model. |
|
|
|
* If update is successful, the browser will be redirected to the 'view' page. |
|
|
|
*/ |
|
|
|
public function actionUpdate($id) |
|
|
|
{ |
|
|
|
$userManager = $this->getUserManager(); |
|
|
@@ -262,7 +257,9 @@ class UserController extends BackendController |
|
|
|
$this->processLinkUserGroup($model); |
|
|
|
$this->processProductPricePercent($model); |
|
|
|
|
|
|
|
$this->setFlash('success', 'Utilisateur modifié.'); |
|
|
|
$this->setFlash('success', 'Utilisateur <strong>'.Html::encode($userManager->getUsername($model)).'</strong> modifié.'); |
|
|
|
|
|
|
|
return $this->redirect(['index']); |
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new UserException("Vous ne pouvez pas modifier cet utilisateur."); |
|
|
@@ -292,7 +289,9 @@ class UserController extends BackendController |
|
|
|
] |
|
|
|
]); |
|
|
|
|
|
|
|
$this->setFlash('success', 'Nouveau mot de passe envoyé.'); |
|
|
|
$this->setFlash('success', 'Nouveau mot de passe envoyé à <strong>'.Html::encode($userManager->getUsername($model)).'</strong>.'); |
|
|
|
|
|
|
|
return $this->redirect(['index']); |
|
|
|
} |
|
|
|
|
|
|
|
return $this->render('update', array_merge($this->initForm($model), [ |
|
|
@@ -376,7 +375,6 @@ class UserController extends BackendController |
|
|
|
$userProducerManager = $this->getUserProducerManager(); |
|
|
|
|
|
|
|
$user = $userManager->findOneUserById($id); |
|
|
|
$producer = $this->getProducerCurrent(); |
|
|
|
$userProducer = $userProducerManager->findOneUserProducer($user); |
|
|
|
|
|
|
|
if ($userProducer) { |
|
|
@@ -554,7 +552,6 @@ class UserController extends BackendController |
|
|
|
$userProducerManager = $this->getUserProducerManager(); |
|
|
|
|
|
|
|
$user = $userManager->findOneUserById($idUser); |
|
|
|
$producerCurrent = $this->getproducerCurrent(); |
|
|
|
$userProducer = $userProducerManager->findOneUserProducer($user); |
|
|
|
|
|
|
|
if ($userProducer) { |