Commit cc04f5876c3a5aa18e3b2daccae98dc5486f536d
1 parent
98648e80
-Testing deadline and view fix
Showing
1 changed file
with
22 additions
and
22 deletions
Show diff stats
views/order/view.php
| @@ -64,17 +64,17 @@ | @@ -64,17 +64,17 @@ | ||
| 64 | } else { | 64 | } else { |
| 65 | $payment = $model->orderPayment->lang->title; | 65 | $payment = $model->orderPayment->lang->title; |
| 66 | } | 66 | } |
| 67 | - | ||
| 68 | - $js = <<< JS | 67 | + |
| 68 | + $js = <<< JS | ||
| 69 | $('[data-toggle="popover"]').popover(); | 69 | $('[data-toggle="popover"]').popover(); |
| 70 | JS; | 70 | JS; |
| 71 | - $this->registerJs($js, View::POS_READY); | 71 | + $this->registerJs($js, View::POS_READY); |
| 72 | 72 | ||
| 73 | ?> | 73 | ?> |
| 74 | <div class="order-view"> | 74 | <div class="order-view"> |
| 75 | - | 75 | + |
| 76 | <h1><?= Html::encode($this->title) ?></h1> | 76 | <h1><?= Html::encode($this->title) ?></h1> |
| 77 | - | 77 | + |
| 78 | <p> | 78 | <p> |
| 79 | <?= Html::a( | 79 | <?= Html::a( |
| 80 | 'Обновить', | 80 | 'Обновить', |
| @@ -94,7 +94,7 @@ JS; | @@ -94,7 +94,7 @@ JS; | ||
| 94 | [ 'class' => 'btn bg-orange' ] | 94 | [ 'class' => 'btn bg-orange' ] |
| 95 | ) ?> | 95 | ) ?> |
| 96 | </p> | 96 | </p> |
| 97 | - | 97 | + |
| 98 | <div class="box box-default"> | 98 | <div class="box box-default"> |
| 99 | <div class="box-header with-border"> | 99 | <div class="box-header with-border"> |
| 100 | <h3 class="box-title">Данные заказа</h3> | 100 | <h3 class="box-title">Данные заказа</h3> |
| @@ -108,7 +108,7 @@ JS; | @@ -108,7 +108,7 @@ JS; | ||
| 108 | 'model' => $model, | 108 | 'model' => $model, |
| 109 | 'attributes' => [ | 109 | 'attributes' => [ |
| 110 | 'id', | 110 | 'id', |
| 111 | - 'deadline', | 111 | + 'deadline:date', |
| 112 | 'pay', | 112 | 'pay', |
| 113 | [ | 113 | [ |
| 114 | 'label' => 'Причина', | 114 | 'label' => 'Причина', |
| @@ -144,8 +144,8 @@ JS; | @@ -144,8 +144,8 @@ JS; | ||
| 144 | ) ?> | 144 | ) ?> |
| 145 | </div><!-- /.box-body --> | 145 | </div><!-- /.box-body --> |
| 146 | </div><!-- /.box --> | 146 | </div><!-- /.box --> |
| 147 | - | ||
| 148 | - | 147 | + |
| 148 | + | ||
| 149 | <div class="box box-default"> | 149 | <div class="box box-default"> |
| 150 | <div class="box-header with-border"> | 150 | <div class="box-header with-border"> |
| 151 | <h3 class="box-title">Товары</h3> | 151 | <h3 class="box-title">Товары</h3> |
| @@ -166,12 +166,12 @@ JS; | @@ -166,12 +166,12 @@ JS; | ||
| 166 | [ | 166 | [ |
| 167 | 'attribute' => 'product_name', | 167 | 'attribute' => 'product_name', |
| 168 | 'content' => function (OrderProduct $model) { | 168 | 'content' => function (OrderProduct $model) { |
| 169 | - if (!empty( $model->product_name )) { | ||
| 170 | - | ||
| 171 | - if (empty( $model->productVariant )) { | 169 | + if (!empty($model->product_name)) { |
| 170 | + | ||
| 171 | + if (empty($model->productVariant)) { | ||
| 172 | return ''; | 172 | return ''; |
| 173 | } | 173 | } |
| 174 | - | 174 | + |
| 175 | return Html::a( | 175 | return Html::a( |
| 176 | StringHelper::truncate($model->product_name, 10, '...'), | 176 | StringHelper::truncate($model->product_name, 10, '...'), |
| 177 | '#', | 177 | '#', |
| @@ -201,11 +201,11 @@ JS; | @@ -201,11 +201,11 @@ JS; | ||
| 201 | 'attribute' => 'productVariant.lang.title', | 201 | 'attribute' => 'productVariant.lang.title', |
| 202 | 'label' => \Yii::t('app', 'Цвет'), | 202 | 'label' => \Yii::t('app', 'Цвет'), |
| 203 | 'content' => function (OrderProduct $model) { | 203 | 'content' => function (OrderProduct $model) { |
| 204 | - | ||
| 205 | - if (empty( $model->productVariant )) { | 204 | + |
| 205 | + if (empty($model->productVariant)) { | ||
| 206 | return ''; | 206 | return ''; |
| 207 | } | 207 | } |
| 208 | - | 208 | + |
| 209 | if (preg_match('@.*\.(png|jpg|gif)@i', $model->productVariant->lang->title)) { | 209 | if (preg_match('@.*\.(png|jpg|gif)@i', $model->productVariant->lang->title)) { |
| 210 | return ''; | 210 | return ''; |
| 211 | } else { | 211 | } else { |
| @@ -225,11 +225,11 @@ JS; | @@ -225,11 +225,11 @@ JS; | ||
| 225 | 'return', | 225 | 'return', |
| 226 | [ | 226 | [ |
| 227 | 'content' => function (OrderProduct $model) { | 227 | 'content' => function (OrderProduct $model) { |
| 228 | - | ||
| 229 | - if (empty( $model->productVariant )) { | 228 | + |
| 229 | + if (empty($model->productVariant)) { | ||
| 230 | return '<i class="glyphicon glyphicon-remove"></i>'; | 230 | return '<i class="glyphicon glyphicon-remove"></i>'; |
| 231 | } | 231 | } |
| 232 | - | 232 | + |
| 233 | $content = '<table class="table"><tbody><tr><th>Склад</th><th>кол.</th></tr>'; | 233 | $content = '<table class="table"><tbody><tr><th>Склад</th><th>кол.</th></tr>'; |
| 234 | foreach ($model->productVariant->variantStocks as $stock) { | 234 | foreach ($model->productVariant->variantStocks as $stock) { |
| 235 | $content .= '<tr><td>' . $stock->stock->title . '</td><td>' . $stock->quantity . '</td></tr>'; | 235 | $content .= '<tr><td>' . $stock->stock->title . '</td><td>' . $stock->quantity . '</td></tr>'; |
| @@ -253,7 +253,7 @@ JS; | @@ -253,7 +253,7 @@ JS; | ||
| 253 | ?> | 253 | ?> |
| 254 | </div><!-- /.box-body --> | 254 | </div><!-- /.box-body --> |
| 255 | </div><!-- /.box --> | 255 | </div><!-- /.box --> |
| 256 | - | 256 | + |
| 257 | <div class="box box-default"> | 257 | <div class="box box-default"> |
| 258 | <div class="box-header with-border"> | 258 | <div class="box-header with-border"> |
| 259 | <h3 class="box-title">История</h3> | 259 | <h3 class="box-title">История</h3> |
| @@ -284,8 +284,8 @@ JS; | @@ -284,8 +284,8 @@ JS; | ||
| 284 | ] | 284 | ] |
| 285 | ); | 285 | ); |
| 286 | ?> | 286 | ?> |
| 287 | - | ||
| 288 | - | 287 | + |
| 288 | + | ||
| 289 | </div><!-- /.box-body --> | 289 | </div><!-- /.box-body --> |
| 290 | </div><!-- /.box --> | 290 | </div><!-- /.box --> |
| 291 | 291 |