Исправления

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2021-12-27 14:38:07 +10:00
parent b08f7f7d0a
commit 913a67d400
3 changed files with 2 additions and 37 deletions

View File

@ -140,7 +140,6 @@ class ProfileController extends Controller
} }
// Инициализация // Инициализация
$delivery_from_terminal_list = $model->genListTerminalsFrom();
$delivery_to_terminal_list = $model->genListTerminalsTo(); $delivery_to_terminal_list = $model->genListTerminalsTo();
$import_oem_list = $model->genListOem(Supply::searchByAccount(select: 'supply.onec["ЗначенияСвойств"]')); $import_oem_list = $model->genListOem(Supply::searchByAccount(select: 'supply.onec["ЗначенияСвойств"]'));
$array_unshift_in_start = function (array &$array, string|int $key, mixed $value) { $array_unshift_in_start = function (array &$array, string|int $key, mixed $value) {
@ -161,12 +160,10 @@ class ProfileController extends Controller
}; };
// Сортировка по алфавиту // Сортировка по алфавиту
asort($delivery_from_terminal_list);
asort($delivery_to_terminal_list); asort($delivery_to_terminal_list);
asort($import_oem_list); asort($import_oem_list);
// Перемещение в начало массива значения "Выберите" // Перемещение в начало массива значения "Выберите"
$array_write_default_value($delivery_from_terminal_list);
$array_write_default_value($delivery_to_terminal_list); $array_write_default_value($delivery_to_terminal_list);
$array_write_default_value($import_oem_list); $array_write_default_value($import_oem_list);
@ -179,7 +176,6 @@ class ProfileController extends Controller
'main' => $this->renderPartial('index', compact( 'main' => $this->renderPartial('index', compact(
'model', 'model',
'sidebar', 'sidebar',
'delivery_from_terminal_list',
'delivery_to_terminal_list', 'delivery_to_terminal_list',
'import_oem_list', 'import_oem_list',
'panel' 'panel'
@ -192,7 +188,6 @@ class ProfileController extends Controller
return $this->render('index', compact( return $this->render('index', compact(
'model', 'model',
'sidebar', 'sidebar',
'delivery_from_terminal_list',
'delivery_to_terminal_list', 'delivery_to_terminal_list',
'import_oem_list', 'import_oem_list',
'panel' 'panel'

View File

@ -30,7 +30,6 @@ if (
<?php if (!yii::$app->user->isGuest) : ?> <?php if (!yii::$app->user->isGuest) : ?>
<label class="btn button_white mb-0 mr-2" for="profile_panel_settings_account">Аккаунт</label> <label class="btn button_white mb-0 mr-2" for="profile_panel_settings_account">Аккаунт</label>
<?php if (yii::$app->user->identity->agnt) : ?> <?php if (yii::$app->user->identity->agnt) : ?>
<label class="btn button_white mb-0 mr-2" for="profile_panel_settings_company">Компания</label>
<label class="btn button_white mb-0" for="profile_panel_settings_import">Импорт</label> <label class="btn button_white mb-0" for="profile_panel_settings_import">Импорт</label>
<?php endif ?> <?php endif ?>
<?php endif ?> <?php endif ?>
@ -69,37 +68,6 @@ if (
</div> </div>
<?php if (yii::$app->user->identity->agnt) : ?> <?php if (yii::$app->user->identity->agnt) : ?>
<input type="radio" id="profile_panel_settings_company" name="main_panel" <?= $panel === 'profile_panel_settings_company' ? 'checked' : null ?> />
<div class="col">
<h5>Доставка</h5>
<div class="dropdown-divider mb-3"></div>
<?php $form = ActiveForm::begin([
'id' => 'form_profile_settings',
'action' => false,
'fieldConfig' => [
'template' => '{label}{input}',
],
'options' => [
'onsubmit' => 'return false;'
]
]);
// Инициализация
$model ?? $model = yii::$app->user->identity;
$delivery_from_terminal_list ?? $delivery_from_terminal_list = ['Нет данных'];
?>
<?= $form->field($model, 'opts[delivery_from_terminal]', ['options' => ['class' => "mb-1"]])
->dropDownList($delivery_from_terminal_list, [
'onChange' => 'page_profile_settings(this.parentElement.parentElement, \'profile_panel_settings_company\')',
'disabled' => count($delivery_from_terminal_list) <= 1
])->label('Терминал'); ?>
<small class="d-block mb-1">Выберите терминал <b><u>отправителя</u></b> для <b>рассчёта доставки</b></small>
<?php ActiveForm::end(); ?>
</div>
<input type="radio" id="profile_panel_settings_import" name="main_panel" <?= $panel === 'profile_panel_settings_import' ? 'checked' : null ?> /> <input type="radio" id="profile_panel_settings_import" name="main_panel" <?= $panel === 'profile_panel_settings_import' ? 'checked' : null ?> />
<div class="col"> <div class="col">
<h5>Параметры 1C</h5> <h5>Параметры 1C</h5>

View File

@ -0,0 +1,2 @@
*
!.gitignore