Browse Source

[backend] Documents : champs utilisateur, personnes morales en premier.

refactoring
Guillaume 4 years ago
parent
commit
8d4d3a9272
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      backend/views/document/_form.php
  2. +2
    -2
      backend/views/point-sale/_form.php

+ 2
- 2
backend/views/document/_form.php View File

@@ -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'];

+ 2
- 2
backend/views/point-sale/_form.php View File

@@ -59,9 +59,9 @@ use common\models\Producer;
'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}',
])
->dropDownList(
ArrayHelper::map(User::findBy()->all(), 'user_id', function ($model) {
ArrayHelper::map(User::findBy()->orderBy('type DESC')->all(), 'user_id', function ($model) {
if(strlen($model['name_legal_person'])) {
return $model['name_legal_person'] ;
return 'Personne morale / '.$model['name_legal_person'] ;
}
else {
return $model['lastname'] . ' ' . $model['name'];

Loading…
Cancel
Save