From d78b9a2abb8a31d36f930bc27f02a38944c26eed Mon Sep 17 00:00:00 2001 From: fomichev Date: Fri, 28 Feb 2025 14:22:19 +0300 Subject: [PATCH] =?utf8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D0=B8=D0=BB=D0=B8=D0=B7=D0=B0?= =?utf8?q?=D1=86=D0=B8=D0=B8=20=D0=BC=D0=B5=D1=82=D0=BE=D0=BA=20=D0=B8=20?= =?utf8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../index.php | 4 ++++ erp24/views/marketplace-orders/index.php | 24 +++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/erp24/views/marketplace-order-status-history/index.php b/erp24/views/marketplace-order-status-history/index.php index 6eef9d2e..31d6a092 100644 --- a/erp24/views/marketplace-order-status-history/index.php +++ b/erp24/views/marketplace-order-status-history/index.php @@ -52,6 +52,10 @@ $this->params['breadcrumbs'][] = $this->title; $class = 'bg-success text-white'; } elseif ($status === 'CANCELLED') { $class = 'bg-danger text-white'; + } elseif ($status === 'PROCESSING') { + $class = 'bg-primary text-white'; + } else { + $class = 'bg-secondary text-white'; } return Html::tag('span', $status, ['class' => "badge $class"]); }, diff --git a/erp24/views/marketplace-orders/index.php b/erp24/views/marketplace-orders/index.php index 9f3520c4..5f1ca3b9 100644 --- a/erp24/views/marketplace-orders/index.php +++ b/erp24/views/marketplace-orders/index.php @@ -51,6 +51,7 @@ YiiAsset::register($this); 'format' => 'raw', 'value' => function ($model) { $status = $model->status->code ?? ''; + $substatus = $model->substatus->code ?? ''; $class = ''; if ($status === 'DELIVERED') { $class = 'bg-success text-white'; @@ -63,22 +64,25 @@ YiiAsset::register($this); } $output = Html::tag('span', $status, ['class' => "badge $class"]); - - if ($status === 'PROCESSING' ) { + $output .= '
'; + if ($status === 'PROCESSING') { $readyUrl = Url::to(['update-to-ready-status', 'id' => $model->id]); $cancelUrl = Url::to(['update-to-cancelled-status', 'id' => $model->id]); - $output .= '
' . - Html::a('Готов', $readyUrl, [ - 'class' => 'btn btn-sm btn-success', - 'data-method' => 'post', - 'data-confirm' => 'Вы уверены, что хотите перевести заказ в статус "Готов к отправке"?', - ]) . ' ' . - Html::a('Отменить', $cancelUrl, [ + if ($substatus === 'STARTED') { + $output .= '
' . + Html::a('Готов', $readyUrl, [ + 'class' => 'btn btn-sm btn-success', + 'data-method' => 'post', + 'data-confirm' => 'Вы уверены, что хотите перевести заказ в статус "Готов к отправке"?', + ]) . ' '; + } + $output .= Html::a('Отменить', $cancelUrl, [ 'class' => 'btn btn-sm btn-danger', 'data-method' => 'post', 'data-confirm' => 'Вы уверены, что хотите отменить заказ?', - ]) . '
'; + ]) . ' '; } + $output .= '
'; return $output; }, 'filter' => Html::input('text', 'MarketplaceOrdersSearch[status_code]', $searchModel->status_code, ['class' => 'form-control']), -- 2.39.5