$marketplaceGuid = Yii::$app->request->post('guid');
$marketplaceOrder = MarketplaceOrders::find()->where(['guid' => $marketplaceGuid])->one();
/** @var $marketplaceOrder MarketplaceOrders */
- $statuses = MarketplaceOrder1cStatuses::find()->where(['marketplace_id' => $marketplaceOrder->marketplace_id])->orderBy(['posit' => SORT_ASC])->all();
+ $statuses = MarketplaceOrder1cStatuses::find()
+ ->where(['marketplace_id' => $marketplaceOrder->marketplace_id])
+ ->orderBy(['posit' => SORT_ASC])
+ ->all();
$data = [];
foreach ($statuses as $status) {
/* @var $status MarketplaceOrder1cStatuses */
$relftions = $status->relationsFrom;
$relationsToSend = [];
foreach ($relftions as $relation) {
- $status = MarketplaceOrder1cStatuses ::find()->where(['id' => $relation['status_id_to']])->one();
- if(!$status) {
+ $statusTo = MarketplaceOrder1cStatuses::find()->where(['id' => $relation['status_id_to']])->one();
+ if(!$statusTo) {
continue;
}
$order = $relation['order'];
$description = $relation['description'];
$buttonText = $relation['button_text'];
$relationsToSend[] = [
- 'status' => $status->status,
+ 'status' => $statusTo->status,
+ 'status_id' => $statusTo->status_id,
'description' => $description,
'button_text' => $buttonText,
'order' => $order,
$data []= [
'marketplace' => [1 => "ФлауВау", 2 => "ЯндексМаркет"][$status->marketplace_id],
'status' => $status->status,
+ 'status_id' => $status->status_id,
'status_instruction' => $status->status_instruction,
'status_relations' => $relationsToSend
];
}
}
-
-
$dataProvider = new ActiveDataProvider([
'query' => MarketplaceOrder1cStatuses::find()
->with(['relationsFrom', 'nextStatuses'])
+++ /dev/null
-<?php
-use yii\helpers\Html;
-use yii\helpers\Json;
-use yii\web\View;
-use yii\widgets\ActiveForm;
-
-/** @var yii\web\View $this */
-/** @var yii_app\records\MarketplaceOrder1cStatuses $model */
-/** @var yii_app\records\MarketplaceOrder1cStatusesRelations[] $relationModels */
-/** @var array $statusOptions (ключ = id, значение = статус) */
-
-$jsonStatuses = Json::encode($statusOptions);
-
-
-$this->registerJs(
- "window.statusesByMarketplace = $jsonStatuses;",
- View::POS_HEAD
-);
-
-$this->registerJsFile(
- '@web/js/Sortable.js',
- ['position' => \yii\web\View::POS_END]
-);
-$this->registerJsFile(
- '@web/js/crud/marketplace-order1c-statuses/index.js',
- ['depends' => [\yii\web\JqueryAsset::class], 'position' => \yii\web\View::POS_END]
-);
-
-
-?>
-
-<div class="marketplace-order1c-statuses-form">
- <?php if (Yii::$app->session->hasFlash('error')): ?>
- <div class="alert alert-danger" role="alert">
- <?= Yii::$app->session->getFlash('error') ?>
- </div>
- <?php endif; ?>
-
- <?php $form = ActiveForm::begin(); ?>
-
- <?= $form->field($model, 'marketplace_id')
- ->dropDownList(
- [1 => 'ФлауВау', 2 => 'ЯндексМаркет'],
- [
- 'prompt' => 'Выберите маркетплейс',
- 'id' => 'marketplace-order1cstatuses-marketplace_id',
- ]
- ) ?>
-
- <?= $form->field($model, 'status')->textInput(['maxlength' => true]) ?>
-
- <?= $form->field($model, 'status_instruction')->textarea(['rows' => 4]) ?>
-
- <hr>
-
- <h4>Связанные статусы (relations)</h4>
- <div id="relations-container">
- <?php foreach ($relationModels as $i => $rel):
- $initialOrder = $rel->order ?: ($i + 1);
- ?>
- <div class="relation-item" style="border:1px solid #ddd; padding:10px; margin-bottom:10px; position: relative; background:#f9f9f9;">
- <span class="drag-handle" style="cursor:move; font-size:18px; margin-right:8px;" title="Перетащите, чтобы изменить порядок">☰</span>
- <strong>Порядок: <span class="order-label"><?= $initialOrder ?></span></strong>
-
- <?= Html::hiddenInput("Relations[{$i}][order]", $initialOrder, ['class' => 'rel-order-input']) ?>
-
- <div style="margin-top:8px;">
- <?= Html::label('Статус-назначения', null, ['class' => 'control-label']) ?>
- <?= Html::dropDownList(
- "Relations[{$i}][status_id_to]",
- $rel->status_id_to,
- [],
- [
- 'prompt' => '— выберите статус —',
- 'class' => 'form-control status-to-select',
-
- 'data-current' => $rel->status_id_to,
- ]
- ); ?>
- </div>
-
- <div style="margin-top:8px;">
- <?= Html::label('Описание (description)', null, ['class' => 'control-label']) ?>
- <?= Html::textInput(
- "Relations[{$i}][description]",
- $rel->description,
- ['class' => 'form-control']
- ); ?>
- </div>
-
- <div style="margin-top:8px;">
- <?= Html::label('Текст кнопки (button_text)', null, ['class' => 'control-label']) ?>
- <?= Html::textInput(
- "Relations[{$i}][button_text]",
- $rel->button_text,
- ['class' => 'form-control']
- ); ?>
- </div>
-
- <button type="button" class="btn btn-danger btn-sm remove-relation-btn"
- style="position:absolute; top:10px; right:10px;">
- Удалить
- </button>
- </div>
- <?php endforeach; ?>
- </div>
-
- <button type="button" id="add-relation-btn" class="btn btn-primary btn-sm" style="margin-bottom:15px;">
- + Добавить ещё одну связь
- </button>
-
- <div class="form-group">
- <?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
- </div>
-
- <?php ActiveForm::end(); ?>
-
-
- <div id="relation-template" style="display:none;">
- <div class="relation-item template" style="border:1px solid #ddd; padding:10px; margin-bottom:10px; position: relative; background:#f9f9f9;">
- <span class="drag-handle" style="cursor:move; font-size:18px; margin-right:8px;" title="Перетащите, чтобы изменить порядок">☰</span>
- <strong>Порядок: <span class="order-label">__order__</span></strong>
-
- <?= Html::hiddenInput("Relations[__index__][order]", "__order__", ['class' => 'rel-order-input']) ?>
-
- <div style="margin-top:8px;">
- <?= Html::label('Статус-назначения', null, ['class' => 'control-label']) ?>
- <?= Html::dropDownList(
- "Relations[__index__][status_id_to]",
- null,
- [],
- [
- 'prompt' => '— выберите статус —',
- 'class' => 'form-control status-to-select',
- 'data-current' => '',
- ]
- ); ?>
- </div>
-
- <div style="margin-top:8px;">
- <?= Html::label('Описание (description)', null, ['class' => 'control-label']) ?>
- <?= Html::textInput("Relations[__index__][description]", null, ['class' => 'form-control']) ?>
- </div>
-
- <div style="margin-top:8px;">
- <?= Html::label('Текст кнопки (button_text)', null, ['class' => 'control-label']) ?>
- <?= Html::textInput("Relations[__index__][button_text]", null, ['class' => 'form-control']) ?>
- </div>
-
- <button type="button" class="btn btn-danger btn-sm remove-relation-btn"
- style="position:absolute; top:10px; right:10px;">
- Удалить
- </button>
- </div>
- </div>
-</div>
\ No newline at end of file
+++ /dev/null
-<?php
-
-use yii\helpers\Html;
-
-/** @var yii\web\View $this */
-/** @var yii_app\records\MarketplaceOrder1cStatuses $model */
-
-$this->title = 'Create Marketplace Order1c Statuses';
-$this->params['breadcrumbs'][] = ['label' => 'Marketplace Order1c Statuses', 'url' => ['index']];
-$this->params['breadcrumbs'][] = $this->title;
-?>
-<div class="marketplace-order1c-statuses-create m-5">
-
- <h1><?= Html::encode($this->title) ?></h1>
-
- <?= $this->render('_form', [
- 'model' => $model,
- 'relationModels' => $relationModels,
- 'statusOptions' => $statusOptions,
- ]) ?>
-
-</div>
+++ /dev/null
-<?php
-
-use yii_app\records\MarketplaceOrder1cStatuses;
-use yii\helpers\Html;
-use yii\helpers\Url;
-use yii\grid\ActionColumn;
-use yii\grid\GridView;
-
-/** @var yii\web\View $this */
-/** @var yii\data\ActiveDataProvider $dataProvider */
-
-$this->registerCssFile('/css/customSortable.css');
-$this->registerJsFile('/js/Sortable.js', ['position' => \yii\web\View::POS_END]);
-$this->registerJsFile('/js/crud/marketplace-order1c-statuses/index.js', ['position' => \yii\web\View::POS_END]);
-
-$this->title = 'Маркетплейс статусы заказа';
-$this->params['breadcrumbs'][] = $this->title;
-?>
-<div class="marketplace-order1c-statuses-index m-5">
-
- <h1><?= Html::encode($this->title) ?></h1>
-
- <p>
- <?= Html::a('Создать Маркетплейс Статус Заказа', ['create'], ['class' => 'btn btn-success']) ?>
- </p>
-
-
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'columns' => [
- ['class' => 'yii\grid\SerialColumn'],
-
- 'id',
- [
- 'label' => '',
- 'format' => 'raw',
- 'value' => function ($model) {
- return Html::button('Сортировка', ['class' => 'btn btn-secondary', 'onclick' => 'showSortingDialog(' . $model->marketplace_id . ')']);
- }
- ],
- [
- 'attribute' => 'marketplace_id',
- 'label' => 'Маркетплейс',
- 'value' => function ($model) {
- return [1 => 'ФлауВау', 2 => 'ЯндексМаркет'][$model->marketplace_id];
- }
- ],
- 'status',
- 'status_instruction:ntext',
- [
- 'class' => ActionColumn::class,
- 'urlCreator' => function ($action, MarketplaceOrder1cStatuses $model, $key, $index, $column) {
- return Url::toRoute([$action, 'id' => $model->id]);
- }
- ],
- [
- 'label' => 'Связанные статусы',
- 'format' => 'raw',
- 'value' => function (MarketplaceOrder1cStatuses $model) {
- $links = [];
- foreach ($model->nextStatuses as $nextStatus) {
- $links[] = Html::a(
- Html::encode($nextStatus->status),
- ['/crud/marketplace-order-1c-statuses/view', 'id' => $nextStatus->id]
- );
- }
- return empty($links)
- ? '<span class="text-muted">— нет связи —</span>'
- : implode('<br>', $links);
- },
- ],
- ],
- ]); ?>
-
-
-</div>
+++ /dev/null
-<?php
-
-use yii\helpers\Html;
-
-/** @var yii\web\View $this */
-/** @var yii_app\records\MarketplaceOrder1cStatuses $model */
-
-$this->title = 'Обновить маркетплейс статус заказа: ' . $model->id;
-$this->params['breadcrumbs'][] = ['label' => 'Маркетплейс статус заказа', 'url' => ['index']];
-$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
-$this->params['breadcrumbs'][] = 'Update';
-?>
-<div class="marketplace-order1c-statuses-update m-5">
-
- <h1>
- <?= Html::a('Назад', ['index'], ['class' => 'btn btn-secondary btn-sm'])?>
- <?= Html::encode($this->title) ?>
- </h1>
-
- <?= $this->render('_form', [
- 'model' => $model,
- 'relationModels' => $relationModels,
- 'statusOptions' => $statusOptions,
- ]) ?>
-
-</div>
+++ /dev/null
-<?php
-
-use yii\helpers\Html;
-use yii\widgets\DetailView;
-use yii_app\records\MarketplaceOrder1cStatuses;
-
-/** @var yii\web\View $this */
-/** @var yii_app\records\MarketplaceOrder1cStatuses $model */
-
-$this->title = $model->id;
-$this->params['breadcrumbs'][] = ['label' => 'Маркетплейс статусы заказа', 'url' => ['index']];
-$this->params['breadcrumbs'][] = $this->title;
-\yii\web\YiiAsset::register($this);
-?>
-<div class="marketplace-order1c-statuses-view m-5">
-
- <h1>
- <?= Html::a('Назад', ['index'], ['class' => 'btn btn-secondary btn-sm'])?>
- <?= Html::encode($this->title) ?>
- </h1>
-
- <p>
- <?= Html::a('Обновить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
- <?= Html::a('Удалить', ['delete', 'id' => $model->id], [
- 'class' => 'btn btn-danger',
- 'data' => [
- 'confirm' => 'Вы уверены, что хотите удалить эту запись?',
- 'method' => 'post',
- ],
- ]) ?>
- </p>
-
- <?= DetailView::widget([
- 'model' => $model,
- 'attributes' => [
- 'id',
- [
- 'attribute' => 'marketplace_id',
- 'value' => function ($data) {
- return [1 => 'ФлауВау', 2 => 'ЯндексМаркет'][$data->marketplace_id];
- }
- ],
- 'status',
- 'status_instruction:ntext',
- [
- 'label' => 'Связанные статусы',
- 'format' => 'raw',
- 'value' => function (MarketplaceOrder1cStatuses $model) {
- $links = [];
- foreach ($model->nextStatuses as $nextStatus) {
- $links[] = Html::a(
- Html::encode($nextStatus->status),
- ['/crud/marketplace-order-1c-statuses/view', 'id' => $nextStatus->id]
- );
- }
- return empty($links)
- ? '<span class="text-muted">— нет связи —</span>'
- : implode('<br>', $links);
- },
- ],
- ],
- ]) ?>
-
-</div>
--- /dev/null
+<?php
+use yii\helpers\Html;
+use yii\helpers\Json;
+use yii\web\View;
+use yii\widgets\ActiveForm;
+
+/** @var yii\web\View $this */
+/** @var yii_app\records\MarketplaceOrder1cStatuses $model */
+/** @var yii_app\records\MarketplaceOrder1cStatusesRelations[] $relationModels */
+/** @var array $statusOptions (ключ = id, значение = статус) */
+
+$jsonStatuses = Json::encode($statusOptions);
+
+
+$this->registerJs(
+ "window.statusesByMarketplace = $jsonStatuses;",
+ View::POS_HEAD
+);
+
+$this->registerJsFile(
+ '@web/js/Sortable.js',
+ ['position' => \yii\web\View::POS_END]
+);
+$this->registerJsFile(
+ '@web/js/crud/marketplace-order1c-statuses/index.js',
+ ['depends' => [\yii\web\JqueryAsset::class], 'position' => \yii\web\View::POS_END]
+);
+
+
+?>
+
+<div class="marketplace-order1c-statuses-form">
+ <?php if (Yii::$app->session->hasFlash('error')): ?>
+ <div class="alert alert-danger" role="alert">
+ <?= Yii::$app->session->getFlash('error') ?>
+ </div>
+ <?php endif; ?>
+
+ <?php $form = ActiveForm::begin(); ?>
+
+ <?= $form->field($model, 'marketplace_id')
+ ->dropDownList(
+ [1 => 'ФлауВау', 2 => 'ЯндексМаркет'],
+ [
+ 'prompt' => 'Выберите маркетплейс',
+ 'id' => 'marketplace-order1cstatuses-marketplace_id',
+ ]
+ ) ?>
+
+ <?= $form->field($model, 'status')->textInput(['maxlength' => true]) ?>
+
+ <?= $form->field($model, 'status_instruction')->textarea(['rows' => 4]) ?>
+
+ <hr>
+
+ <h4>Связанные статусы (relations)</h4>
+ <div id="relations-container">
+ <?php foreach ($relationModels as $i => $rel):
+ $initialOrder = $rel->order ?: ($i + 1);
+ ?>
+ <div class="relation-item" style="border:1px solid #ddd; padding:10px; margin-bottom:10px; position: relative; background:#f9f9f9;">
+ <span class="drag-handle" style="cursor:move; font-size:18px; margin-right:8px;" title="Перетащите, чтобы изменить порядок">☰</span>
+ <strong>Порядок: <span class="order-label"><?= $initialOrder ?></span></strong>
+
+ <?= Html::hiddenInput("Relations[{$i}][order]", $initialOrder, ['class' => 'rel-order-input']) ?>
+
+ <div style="margin-top:8px;">
+ <?= Html::label('Статус-назначения', null, ['class' => 'control-label']) ?>
+ <?= Html::dropDownList(
+ "Relations[{$i}][status_id_to]",
+ $rel->status_id_to,
+ [],
+ [
+ 'prompt' => '— выберите статус —',
+ 'class' => 'form-control status-to-select',
+
+ 'data-current' => $rel->status_id_to,
+ ]
+ ); ?>
+ </div>
+
+ <div style="margin-top:8px;">
+ <?= Html::label('Описание (description)', null, ['class' => 'control-label']) ?>
+ <?= Html::textInput(
+ "Relations[{$i}][description]",
+ $rel->description,
+ ['class' => 'form-control']
+ ); ?>
+ </div>
+
+ <div style="margin-top:8px;">
+ <?= Html::label('Текст кнопки (button_text)', null, ['class' => 'control-label']) ?>
+ <?= Html::textInput(
+ "Relations[{$i}][button_text]",
+ $rel->button_text,
+ ['class' => 'form-control']
+ ); ?>
+ </div>
+
+ <button type="button" class="btn btn-danger btn-sm remove-relation-btn"
+ style="position:absolute; top:10px; right:10px;">
+ Удалить
+ </button>
+ </div>
+ <?php endforeach; ?>
+ </div>
+
+ <button type="button" id="add-relation-btn" class="btn btn-primary btn-sm" style="margin-bottom:15px;">
+ + Добавить ещё одну связь
+ </button>
+
+ <div class="form-group">
+ <?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
+ </div>
+
+ <?php ActiveForm::end(); ?>
+
+
+ <div id="relation-template" style="display:none;">
+ <div class="relation-item template" style="border:1px solid #ddd; padding:10px; margin-bottom:10px; position: relative; background:#f9f9f9;">
+ <span class="drag-handle" style="cursor:move; font-size:18px; margin-right:8px;" title="Перетащите, чтобы изменить порядок">☰</span>
+ <strong>Порядок: <span class="order-label">__order__</span></strong>
+
+ <?= Html::hiddenInput("Relations[__index__][order]", "__order__", ['class' => 'rel-order-input']) ?>
+
+ <div style="margin-top:8px;">
+ <?= Html::label('Статус-назначения', null, ['class' => 'control-label']) ?>
+ <?= Html::dropDownList(
+ "Relations[__index__][status_id_to]",
+ null,
+ [],
+ [
+ 'prompt' => '— выберите статус —',
+ 'class' => 'form-control status-to-select',
+ 'data-current' => '',
+ ]
+ ); ?>
+ </div>
+
+ <div style="margin-top:8px;">
+ <?= Html::label('Описание (description)', null, ['class' => 'control-label']) ?>
+ <?= Html::textInput("Relations[__index__][description]", null, ['class' => 'form-control']) ?>
+ </div>
+
+ <div style="margin-top:8px;">
+ <?= Html::label('Текст кнопки (button_text)', null, ['class' => 'control-label']) ?>
+ <?= Html::textInput("Relations[__index__][button_text]", null, ['class' => 'form-control']) ?>
+ </div>
+
+ <button type="button" class="btn btn-danger btn-sm remove-relation-btn"
+ style="position:absolute; top:10px; right:10px;">
+ Удалить
+ </button>
+ </div>
+ </div>
+</div>
\ No newline at end of file
--- /dev/null
+<?php
+
+use yii\helpers\Html;
+
+/** @var yii\web\View $this */
+/** @var yii_app\records\MarketplaceOrder1cStatuses $model */
+
+$this->title = 'Create Marketplace Order1c Statuses';
+$this->params['breadcrumbs'][] = ['label' => 'Marketplace Order1c Statuses', 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+?>
+<div class="marketplace-order1c-statuses-create m-5">
+
+ <h1><?= Html::encode($this->title) ?></h1>
+
+ <?= $this->render('_form', [
+ 'model' => $model,
+ 'relationModels' => $relationModels,
+ 'statusOptions' => $statusOptions,
+ ]) ?>
+
+</div>
--- /dev/null
+<?php
+
+use yii_app\records\MarketplaceOrder1cStatuses;
+use yii\helpers\Html;
+use yii\helpers\Url;
+use yii\grid\ActionColumn;
+use yii\grid\GridView;
+
+/** @var yii\web\View $this */
+/** @var yii\data\ActiveDataProvider $dataProvider */
+
+$this->registerCssFile('/css/customSortable.css');
+$this->registerJsFile('/js/Sortable.js', ['position' => \yii\web\View::POS_END]);
+$this->registerJsFile('/js/crud/marketplace-order1c-statuses/index.js', ['position' => \yii\web\View::POS_END]);
+
+$this->title = 'Маркетплейс статусы заказа';
+$this->params['breadcrumbs'][] = $this->title;
+?>
+<div class="marketplace-order1c-statuses-index m-5">
+
+ <h1><?= Html::encode($this->title) ?></h1>
+
+ <p>
+ <?= Html::a('Создать Маркетплейс Статус Заказа', ['create'], ['class' => 'btn btn-success']) ?>
+ </p>
+
+
+ <?= GridView::widget([
+ 'dataProvider' => $dataProvider,
+ 'columns' => [
+ ['class' => 'yii\grid\SerialColumn'],
+
+ 'id',
+ [
+ 'label' => '',
+ 'format' => 'raw',
+ 'value' => function ($model) {
+ return Html::button('Сортировка', ['class' => 'btn btn-secondary', 'onclick' => 'showSortingDialog(' . $model->marketplace_id . ')']);
+ }
+ ],
+ [
+ 'attribute' => 'marketplace_id',
+ 'label' => 'Маркетплейс',
+ 'value' => function ($model) {
+ return [1 => 'ФлауВау', 2 => 'ЯндексМаркет'][$model->marketplace_id];
+ }
+ ],
+ 'status',
+ 'status_instruction:ntext',
+ [
+ 'class' => ActionColumn::class,
+ 'urlCreator' => function ($action, MarketplaceOrder1cStatuses $model, $key, $index, $column) {
+ return Url::toRoute([$action, 'id' => $model->id]);
+ }
+ ],
+ [
+ 'label' => 'Связанные статусы',
+ 'format' => 'raw',
+ 'value' => function (MarketplaceOrder1cStatuses $model) {
+ $links = [];
+ foreach ($model->nextStatuses as $nextStatus) {
+ $links[] = Html::a(
+ Html::encode($nextStatus->status),
+ ['/crud/marketplace-order-1c-statuses/view', 'id' => $nextStatus->id]
+ );
+ }
+ return empty($links)
+ ? '<span class="text-muted">— нет связи —</span>'
+ : implode('<br>', $links);
+ },
+ ],
+ ],
+ ]); ?>
+
+
+</div>
--- /dev/null
+<?php
+
+use yii\helpers\Html;
+
+/** @var yii\web\View $this */
+/** @var yii_app\records\MarketplaceOrder1cStatuses $model */
+
+$this->title = 'Обновить маркетплейс статус заказа: ' . $model->id;
+$this->params['breadcrumbs'][] = ['label' => 'Маркетплейс статус заказа', 'url' => ['index']];
+$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
+$this->params['breadcrumbs'][] = 'Update';
+?>
+<div class="marketplace-order1c-statuses-update m-5">
+
+ <h1>
+ <?= Html::a('Назад', ['index'], ['class' => 'btn btn-secondary btn-sm'])?>
+ <?= Html::encode($this->title) ?>
+ </h1>
+
+ <?= $this->render('_form', [
+ 'model' => $model,
+ 'relationModels' => $relationModels,
+ 'statusOptions' => $statusOptions,
+ ]) ?>
+
+</div>
--- /dev/null
+<?php
+
+use yii\helpers\Html;
+use yii\widgets\DetailView;
+use yii_app\records\MarketplaceOrder1cStatuses;
+
+/** @var yii\web\View $this */
+/** @var yii_app\records\MarketplaceOrder1cStatuses $model */
+
+$this->title = $model->id;
+$this->params['breadcrumbs'][] = ['label' => 'Маркетплейс статусы заказа', 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+\yii\web\YiiAsset::register($this);
+?>
+<div class="marketplace-order1c-statuses-view m-5">
+
+ <h1>
+ <?= Html::a('Назад', ['index'], ['class' => 'btn btn-secondary btn-sm'])?>
+ <?= Html::encode($this->title) ?>
+ </h1>
+
+ <p>
+ <?= Html::a('Обновить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
+ <?= Html::a('Удалить', ['delete', 'id' => $model->id], [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => 'Вы уверены, что хотите удалить эту запись?',
+ 'method' => 'post',
+ ],
+ ]) ?>
+ </p>
+
+ <?= DetailView::widget([
+ 'model' => $model,
+ 'attributes' => [
+ 'id',
+ [
+ 'attribute' => 'marketplace_id',
+ 'value' => function ($data) {
+ return [1 => 'ФлауВау', 2 => 'ЯндексМаркет'][$data->marketplace_id];
+ }
+ ],
+ 'status',
+ 'status_instruction:ntext',
+ [
+ 'label' => 'Связанные статусы',
+ 'format' => 'raw',
+ 'value' => function (MarketplaceOrder1cStatuses $model) {
+ $links = [];
+ foreach ($model->nextStatuses as $nextStatus) {
+ $links[] = Html::a(
+ Html::encode($nextStatus->status),
+ ['/crud/marketplace-order-1c-statuses/view', 'id' => $nextStatus->id]
+ );
+ }
+ return empty($links)
+ ? '<span class="text-muted">— нет связи —</span>'
+ : implode('<br>', $links);
+ },
+ ],
+ ],
+ ]) ?>
+
+</div>