1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* HiPanel tickets module |
4
|
|
|
* |
5
|
|
|
* @link https://github.com/hiqdev/hipanel-module-ticket |
6
|
|
|
* @package hipanel-module-ticket |
7
|
|
|
* @license BSD-3-Clause |
8
|
|
|
* @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace hipanel\modules\ticket\grid; |
12
|
|
|
|
13
|
|
|
use hipanel\grid\MainColumn; |
14
|
|
|
use hipanel\grid\SwitchColumn; |
15
|
|
|
use hipanel\modules\client\grid\ClientColumn; |
16
|
|
|
use hipanel\modules\ticket\menus\TemplateActionsMenu; |
17
|
|
|
use hiqdev\yii2\menus\grid\MenuColumn; |
18
|
|
|
use Yii; |
19
|
|
|
|
20
|
|
|
class TemplateGridView extends \hipanel\grid\BoxedGridView |
21
|
|
|
{ |
22
|
|
|
public function columns() |
23
|
|
|
{ |
24
|
|
|
return array_merge(parent::columns(), [ |
25
|
|
|
'author_id' => [ |
26
|
|
|
'class' => ClientColumn::class, |
27
|
|
|
'idAttribute' => 'author_id', |
28
|
|
|
'attribute' => 'author_id', |
29
|
|
|
'nameAttribute' => 'author', |
30
|
|
|
], |
31
|
|
|
'post_date' => [ |
32
|
|
|
'value' => function ($model) { |
33
|
|
|
return Yii::$app->formatter->asDatetime($model->post_date); |
34
|
|
|
}, |
35
|
|
|
], |
36
|
|
|
'actions' => [ |
37
|
|
|
'class' => MenuColumn::class, |
38
|
|
|
'menuClass' => TemplateActionsMenu::class, |
39
|
|
|
], |
40
|
|
|
'is_published' => [ |
41
|
|
|
'class' => SwitchColumn::class, |
42
|
|
|
'switchInputOptions' => [ |
43
|
|
|
'disabled' => true, |
44
|
|
|
], |
45
|
|
|
], |
46
|
|
|
'name' => [ |
47
|
|
|
'class' => MainColumn::class, |
48
|
|
|
'filterAttribute' => 'name_like', |
49
|
|
|
], |
50
|
|
|
]); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|