|
|
@@ -70,7 +70,7 @@ use common\models\Producer; |
|
|
|
])->hiddenInput(); ?> |
|
|
|
<?php else: ?> |
|
|
|
<?php |
|
|
|
$usersArray = User::findBy()->all(); |
|
|
|
$usersArray = User::findBy()->orderBy('type DESC')->all(); |
|
|
|
?> |
|
|
|
<?= $form->field($model, 'id_user', [ |
|
|
|
'template' => '{label} <a href="' . Yii::$app->urlManager->createUrl(['user/create']) . '" class="btn btn-xs btn-default">Nouvel utilisateur <span class="glyphicon glyphicon-plus"></span></a><div>{input}</div>{hint}', |
|
|
@@ -78,7 +78,7 @@ use common\models\Producer; |
|
|
|
->dropDownList( |
|
|
|
ArrayHelper::map($usersArray, 'user_id', function ($model) { |
|
|
|
if(isset($model['name_legal_person']) && strlen($model['name_legal_person'])) { |
|
|
|
return $model['name_legal_person'] ; |
|
|
|
return 'Personne morale / '.$model['name_legal_person'] ; |
|
|
|
} |
|
|
|
else { |
|
|
|
return $model['lastname'] . ' ' . $model['name']; |