@@ -111,7 +111,7 @@ class UserAdminController extends BackendController | |||
return $this->redirect('index'); | |||
} | |||
public function actionRedirectView(int $idUserProducer) | |||
public function actionRedirectUpdate(int $idUserProducer) | |||
{ | |||
$userCurrent = $this->getUserCurrent(); | |||
$userProducer = $this->getUserProducerModule()->getRepository()->findOneUserProducerById($idUserProducer); | |||
@@ -119,7 +119,7 @@ class UserAdminController extends BackendController | |||
$user = $userProducer->user; | |||
$producer = $userProducer->producer; | |||
$this->getUserModule()->getBuilder()->switchProducer($userCurrent, $producer); | |||
return $this->redirect(['user/view', 'id' => $user->id]); | |||
return $this->redirect(['user/update', 'id' => $user->id]); | |||
} | |||
else { | |||
$this->addFlash('error', "L'utilisateur n'a pas été trouvé."); |
@@ -106,7 +106,7 @@ $this->addBreadcrumb($this->getTitle()); | |||
], | |||
[ | |||
'attribute' => 'producers', | |||
'label' => 'Producteurs', | |||
'label' => 'Profils', | |||
'format' => 'raw', | |||
'contentOptions' => ['class' => 'column-hide-on-mobile align-center'], | |||
'value' => function ($user) use ($userProducerModule) { | |||
@@ -114,7 +114,7 @@ $this->addBreadcrumb($this->getTitle()); | |||
$userProducersArray = $userProducerModule->getRepository()->findUserProducersByUser($user); | |||
foreach($userProducersArray as $userProducer) { | |||
$html .= '<a href="'.Yii::$app->urlManager->createUrl(['user-admin/redirect-view', 'idUserProducer' => $userProducer->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-eye-open"></span> '.$userProducer->producer->name.'</a> '; | |||
$html .= '<a href="'.Yii::$app->urlManager->createUrl(['user-admin/redirect-update', 'idUserProducer' => $userProducer->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-user"></span> '.$userProducer->producer->name.'</a> '; | |||
} | |||
return $html; |
@@ -106,7 +106,7 @@ $this->addBreadcrumb($this->getTitle()); | |||
], | |||
[ | |||
'attribute' => 'producers', | |||
'label' => 'Producteurs', | |||
'label' => 'Profils', | |||
'format' => 'raw', | |||
'contentOptions' => ['class' => 'column-hide-on-mobile align-center'], | |||
'value' => function ($user) use ($userProducerModule) { | |||
@@ -114,7 +114,7 @@ $this->addBreadcrumb($this->getTitle()); | |||
$userProducersArray = $userProducerModule->getRepository()->findUserProducersByUser($user); | |||
foreach($userProducersArray as $userProducer) { | |||
$html .= '<a href="'.Yii::$app->urlManager->createUrl(['user-admin/redirect-view', 'idUserProducer' => $userProducer->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-eye-open"></span> '.$userProducer->producer->name.'</a> '; | |||
$html .= '<a href="'.Yii::$app->urlManager->createUrl(['user-admin/redirect-update', 'idUserProducer' => $userProducer->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-user"></span> '.$userProducer->producer->name.'</a> '; | |||
} | |||
return $html; |