Commit deaedeb05cfabfd2f4df39b677b3e9c567b6088f

Authored by Alexey Boroda
1 parent 1a954235

-Order module task #2

models/OrderSearch.php
@@ -77,6 +77,9 @@ @@ -77,6 +77,9 @@
77 [ 77 [
78 'query' => $query, 78 'query' => $query,
79 'sort' => [ 'defaultOrder' => [ 'id' => SORT_DESC ] ], 79 'sort' => [ 'defaultOrder' => [ 'id' => SORT_DESC ] ],
  80 + 'pagination' => [
  81 + 'pageSize' => 50,
  82 + ],
80 ] 83 ]
81 ); 84 );
82 85
views/order/index.php
@@ -262,7 +262,6 @@ JS; @@ -262,7 +262,6 @@ JS;
262 } 262 }
263 }, 263 },
264 ], 264 ],
265 -  
266 [ 265 [
267 'attribute' => 'body', 266 'attribute' => 'body',
268 'content' => function($model) { 267 'content' => function($model) {
@@ -273,7 +272,20 @@ JS; @@ -273,7 +272,20 @@ JS;
273 } 272 }
274 }, 273 },
275 ], 274 ],
276 - 'sms', 275 + [
  276 + 'attribute' => 'sms',
  277 + 'content' => function($model) {
  278 + if (!empty( $model->sms )) {
  279 + return Html::a(StringHelper::truncate($model->sms, 12, '...'), '#', [
  280 + 'data-toggle' => 'tooltip',
  281 + 'title' => $model->sms,
  282 + 'onclick' => 'event.preventDefault();',
  283 + ]);
  284 + } else {
  285 + return '';
  286 + }
  287 + },
  288 + ],
277 [ 289 [
278 'class' => 'yii\grid\ActionColumn', 290 'class' => 'yii\grid\ActionColumn',
279 'template' => \Yii::$app->user->identity->isAdmin( 291 'template' => \Yii::$app->user->identity->isAdmin(
views/order/update.php
@@ -36,7 +36,7 @@ $.ajax({ @@ -36,7 +36,7 @@ $.ajax({
36 }); 36 });
37 } 37 }
38 });'; 38 });';
39 - 39 +
40 $this->registerJs($js, View::POS_READY); 40 $this->registerJs($js, View::POS_READY);
41 41
42 $js = ' 42 $js = '
@@ -55,10 +55,15 @@ $.ajax({ @@ -55,10 +55,15 @@ $.ajax({
55 '; 55 ';
56 56
57 $this->registerJs($js, View::POS_READY); 57 $this->registerJs($js, View::POS_READY);
58 - 58 +
59 ?> 59 ?>
60 <div class="order-update"> 60 <div class="order-update">
61 - <div class="container"><h1><?php echo Html::encode($this->title) ?></h1></div> 61 + <div class="container">
  62 + <h1><?php echo Html::encode($this->title) ?> | <?php echo date(
  63 + 'd-m-Y G:i',
  64 + $model->created_at
  65 + ); ?> | <?php echo $model->manager->username; ?></h1>
  66 + </div>
62 67
63 <?= $this->render( 68 <?= $this->render(
64 '_form', 69 '_form',