Bläddra i källkod

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

dev
Guillaume 4 år sedan
förälder
incheckning
8d4d3a9272
2 ändrade filer med 4 tillägg och 4 borttagningar
  1. +2
    -2
      backend/views/document/_form.php
  2. +2
    -2
      backend/views/point-sale/_form.php

+ 2
- 2
backend/views/document/_form.php Visa fil

@@ -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 Visa fil

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

Laddar…
Avbryt
Spara