瀏覽代碼

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

dev
Guillaume 4 年之前
父節點
當前提交
8d4d3a9272
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. +2
    -2
      backend/views/document/_form.php
  2. +2
    -2
      backend/views/point-sale/_form.php

+ 2
- 2
backend/views/document/_form.php 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存