Преглед на файлове

[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 Целия файл

])->hiddenInput(); ?> ])->hiddenInput(); ?>
<?php else: ?> <?php else: ?>
<?php <?php
$usersArray = User::findBy()->all();
$usersArray = User::findBy()->orderBy('type DESC')->all();
?> ?>
<?= $form->field($model, 'id_user', [ <?= $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}', '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( ->dropDownList(
ArrayHelper::map($usersArray, 'user_id', function ($model) { ArrayHelper::map($usersArray, 'user_id', function ($model) {
if(isset($model['name_legal_person']) && strlen($model['name_legal_person'])) { if(isset($model['name_legal_person']) && strlen($model['name_legal_person'])) {
return $model['name_legal_person'] ;
return 'Personne morale / '.$model['name_legal_person'] ;
} }
else { else {
return $model['lastname'] . ' ' . $model['name']; return $model['lastname'] . ' ' . $model['name'];

+ 2
- 2
backend/views/point-sale/_form.php Целия файл

'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}', '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( ->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'])) { if(strlen($model['name_legal_person'])) {
return $model['name_legal_person'] ;
return 'Personne morale / '.$model['name_legal_person'] ;
} }
else { else {
return $model['lastname'] . ' ' . $model['name']; return $model['lastname'] . ' ' . $model['name'];

Loading…
Отказ
Запис