Completed
Push — master ( d22863...82de77 )
by Dmitry
05:23
created

TicketController::actionFileView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
3
/*
4
 * HiPanel tickets module
5
 *
6
 * @link      https://github.com/hiqdev/hipanel-module-ticket
7
 * @package   hipanel-module-ticket
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\modules\ticket\controllers;
13
14
use hipanel\actions\Action;
15
use hipanel\actions\IndexAction;
16
use hipanel\actions\OrientationAction;
17
use hipanel\actions\PrepareAjaxViewAction;
18
use hipanel\actions\PrepareBulkAction;
19
use hipanel\actions\ProxyAction;
20
use hipanel\actions\SmartCreateAction;
21
use hipanel\actions\SmartPerformAction;
22
use hipanel\actions\SmartUpdateAction;
23
use hipanel\actions\ValidateFormAction;
24
use hipanel\actions\ViewAction;
25
use hipanel\models\File;
26
use hipanel\modules\client\models\Client;
27
use hipanel\modules\ticket\models\Thread;
28
use hipanel\modules\ticket\models\ThreadSearch;
29
use hipanel\modules\ticket\models\TicketSettings;
30
use hiqdev\hiart\ErrorResponseException;
31
use Yii;
32
use yii\base\Event;
33
use yii\filters\PageCache;
34
use yii\helpers\ArrayHelper;
35
use yii\web\NotFoundHttpException;
36
use yii\web\Response;
37
38
/**
39
 * Class TicketController.
40
 */
41
class TicketController extends \hipanel\base\CrudController
42
{
43
    /**
44
     * Used to create newModel.
45
     *
46
     * @return string
47
     */
48
    public static function modelClassName()
49
    {
50
        return Thread::class;
51
    }
52
53
    public function behaviors()
54
    {
55
        return array_merge(parent::behaviors(), [
0 ignored issues
show
Bug Best Practice introduced by
The return type of return array_merge(paren...app->user->getId())))); (array<*,array>) is incompatible with the return type of the parent method hipanel\base\Controller::behaviors of type array<string,array<strin...g,string[]|boolean>[]>>.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
56
            [
57
                'class' => PageCache::class,
58
                'only' => ['templates'],
59
                'duration' => 7200, // 2h
60
                'variations' => [
61
                    Yii::$app->user->getId(),
62
                ],
63
            ],
64
        ]);
65
    }
66
67
    public function actions()
68
    {
69
        return [
70
            'set-orientation' => [
71
                'class' => OrientationAction::class,
72
                'allowedRoutes' => [
73
                    '@ticket/index',
74
                ],
75
            ],
76
            'index' => [
77
                'class' => IndexAction::class,
78
                'data' => $this->prepareRefs(),
79
            ],
80
            'view' => [
81
                'class' => ViewAction::class,
82
                'findOptions' => $this->getSearchOptions(),
83
                'on beforeSave' => function (Event $event) {
84
                    /** @var PrepareBulkAction $action */
85
                    $action = $event->sender;
86
                    $dataProvider = $action->getDataProvider();
87
                    $dataProvider->query->joinWith('answers');
88
                },
89
                'data' => function ($action) {
90
                    $client = Client::find()
91
                        ->where([
92
                            'id' => $action->model->recipient_id,
93
                            'with_contact' => 1,
94
                        ])
95
                        ->withDomains()
96
                        ->withServers()
97
                        ->one();
98
99
                    if ($client->login === 'anonym') {
100
                        $client->name = $action->model->anonym_name;
101
                        $client->email = $action->model->anonym_email;
102
                        $client->seller = $action->model->anonym_seller;
103
                    }
104
105
                    return array_merge(compact('client'), $this->prepareRefs());
106
                },
107
            ],
108
            'validate-form' => [
109
                'class' => ValidateFormAction::class,
110
            ],
111
            'answer' => [
112
                'class' => SmartUpdateAction::class,
113
                'success' => Yii::t('hipanel/ticket', 'Ticket changed'),
114
            ],
115
            'create' => [
116
                'class' => SmartCreateAction::class,
117
                'success' => Yii::t('hipanel/ticket', 'Ticket posted'),
118
                'data' => function () {
119
                    return $this->prepareRefs();
120
                },
121
            ],
122
            'delete' => [
123
                'class' => SmartPerformAction::class,
124
                'success' => Yii::t('hipanel/ticket', 'Ticket deleted'),
125
            ],
126
            'subscribe' => [
127
                'class' => SmartPerformAction::class,
128
                'scenario' => 'answer',
129
                'success' => Yii::t('hipanel/ticket', 'Subscribed'),
130 View Code Duplication
                'on beforeSave' => function (Event $event) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
131
                    /** @var Action $action */
132
                    $action = $event->sender;
133
                    foreach ($action->collection->models as $model) {
134
                        $model->{$this->_subscribeAction[$action->id]} = Yii::$app->user->identity->username;
135
                    }
136
                },
137
                'POST pjax' => [
138
                    'save' => true,
139
                    'success' => [
140
                        'class' => ViewAction::class,
141
                        'view' => '_subscribeButton',
142
                        'findOptions' => ['with_answers' => 1, 'show_closed' => 1],
143
                    ],
144
                ],
145
            ],
146
            'unsubscribe' => [
147
                'class' => SmartPerformAction::class,
148
                'scenario' => 'answer',
149
                'success' => Yii::t('hipanel/ticket', 'Unsubscribed'),
150 View Code Duplication
                'on beforeSave' => function (Event $event) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
151
                    /** @var Action $action */
152
                    $action = $event->sender;
153
                    foreach ($action->collection->models as $model) {
154
                        $model->{$this->_subscribeAction[$action->id]} = Yii::$app->user->identity->username;
155
                    }
156
                },
157
                'POST pjax' => [
158
                    'save' => true,
159
                    'success' => [
160
                        'class' => ViewAction::class,
161
                        'view' => '_subscribeButton',
162
                        'findOptions' => ['with_answers' => 1, 'show_closed' => 1],
163
                    ],
164
                ],
165
            ],
166
            'close' => [
167
                'class' => SmartPerformAction::class,
168
                'scenario' => 'close',
169
                'success' => Yii::t('hipanel/ticket', 'Ticket closed'),
170 View Code Duplication
                'on beforeSave' => function (Event $event) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
171
                    /** @var Action $action */
172
                    $action = $event->sender;
173
                    foreach ($action->collection->models as $model) {
174
                        $model->{'state'} = Thread::STATE_CLOSE;
175
                    }
176
                },
177
                'POST pjax' => [
178
                    'save' => true,
179
                    'success' => [
180
                        'class' => ProxyAction::class,
181
                        'action' => 'view',
182
                        'params' => function ($action, $model) {
183
                            return ['id' => $model->id];
184
                        },
185
                    ],
186
                ],
187
            ],
188
            'open' => [
189
                'class' => SmartPerformAction::class,
190
                'scenario' => 'open',
191
                'success' => Yii::t('hipanel/ticket', 'Ticket opened'),
192 View Code Duplication
                'on beforeSave' => function (Event $event) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
193
                    /** @var Action $action */
194
                    $action = $event->sender;
195
                    foreach ($action->collection->models as $model) {
196
                        $model->{'state'} = Thread::STATE_OPEN;
197
                    }
198
                },
199
                'POST pjax' => [
200
                    'save' => true,
201
                    'success' => [
202
                        'class' => ProxyAction::class,
203
                        'action' => 'view',
204
                        'params' => function ($action, $model) {
205
                            return ['id' => $model->id];
206
                        },
207
                    ],
208
                ],
209
            ],
210
            'update-answer-modal' => [
211
                'class' => PrepareAjaxViewAction::class,
212
                'on beforeSave' => function (Event $event) {
213
                    /** @var PrepareBulkAction $action */
214
                    $action = $event->sender;
215
                    $dataProvider = $action->getDataProvider();
216
                    $dataProvider->query->joinWith('answers');
0 ignored issues
show
Bug introduced by
It seems like you code against a concrete implementation and not the interface yii\db\QueryInterface as the method joinWith() does only exist in the following implementations of said interface: hipanel\modules\client\models\query\ArticleQuery, hipanel\modules\client\models\query\ClientQuery, hiqdev\hiart\ActiveQuery, yii\db\ActiveQuery.

Let’s take a look at an example:

interface User
{
    /** @return string */
    public function getPassword();
}

class MyUser implements User
{
    public function getPassword()
    {
        // return something
    }

    public function getDisplayName()
    {
        // return some name.
    }
}

class AuthSystem
{
    public function authenticate(User $user)
    {
        $this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
        // do something.
    }
}

In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break.

Available Fixes

  1. Change the type-hint for the parameter:

    class AuthSystem
    {
        public function authenticate(MyUser $user) { /* ... */ }
    }
    
  2. Add an additional type-check:

    class AuthSystem
    {
        public function authenticate(User $user)
        {
            if ($user instanceof MyUser) {
                $this->logger->info(/** ... */);
            }
    
            // or alternatively
            if ( ! $user instanceof MyUser) {
                throw new \LogicException(
                    '$user must be an instance of MyUser, '
                   .'other instances are not supported.'
                );
            }
    
        }
    }
    
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types inside the if block in such a case.
  1. Add the method to the interface:

    interface User
    {
        /** @return string */
        public function getPassword();
    
        /** @return string */
        public function getDisplayName();
    }
    
Loading history...
217
                },
218
                'data' => function ($action, $data) {
219
                    $answer_id = Yii::$app->request->get('answer_id');
220
                    if (!is_numeric($answer_id)) {
221
                        throw new NotFoundHttpException('Invalid answer_id');
222
                    }
223
224
                    return ArrayHelper::merge($data, [
225
                        'answer_id' => $answer_id,
226
                    ]);
227
                },
228
                'findOptions' => $this->getSearchOptions(),
229
                'scenario' => 'answer-update',
230
                'view' => '_updateAnswerModal',
231
            ],
232
        ];
233
    }
234
235
    /**
236
     * @var array
237
     */
238
    private $_subscribeAction = ['subscribe' => 'add_watchers', 'unsubscribe' => 'del_watchers'];
239
240
    /**
241
     * @return array
242
     */
243
    protected function prepareRefs()
244
    {
245
        return [
246
            'topic_data' => $this->getRefs('topic,ticket', 'hipanel/ticket'),
247
            'state_data' => $this->getClassRefs('state', 'hipanel/ticket'),
248
            'priority_data' => $this->getPriorities(),
249
        ];
250
    }
251
252
    /**
253
     * @return string
254
     */
255
    public function actionSettings()
256
    {
257
        $model = new TicketSettings();
258
        $request = Yii::$app->request;
259
        if ($request->isAjax && $model->load($request->post()) && $model->validate()) {
260
            $model->setFormData();
261
            \Yii::$app->getSession()->setFlash('success', \Yii::t('hipanel/ticket', 'Ticket settings saved'));
0 ignored issues
show
Bug introduced by
The method getSession does only exist in yii\web\Application, but not in yii\console\Application.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
262
        } else {
263
            $model->getFormData();
264
        }
265
266
        return $this->render('settings', [
267
            'model' => $model,
268
        ]);
269
    }
270
271
    /**
272
     * @param $id
273
     *
274
     * @return \yii\web\Response
275
     */
276 View Code Duplication
    public function actionPriorityUp($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
277
    {
278
        $options[$id] = ['id' => $id, 'priority' => 'high'];
0 ignored issues
show
Coding Style Comprehensibility introduced by
$options was never initialized. Although not strictly required by PHP, it is generally a good practice to add $options = array(); before regardless.

Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code.

Let’s take a look at an example:

foreach ($collection as $item) {
    $myArray['foo'] = $item->getFoo();

    if ($item->hasBar()) {
        $myArray['bar'] = $item->getBar();
    }

    // do something with $myArray
}

As you can see in this example, the array $myArray is initialized the first time when the foreach loop is entered. You can also see that the value of the bar key is only written conditionally; thus, its value might result from a previous iteration.

This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.

Loading history...
279
        if ($this->_ticketChange($options)) {
280
            \Yii::$app->getSession()->setFlash('success',
0 ignored issues
show
Bug introduced by
The method getSession does only exist in yii\web\Application, but not in yii\console\Application.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
281
                \Yii::t('hipanel/ticket', 'Priority has been changed to high'));
282
        } else {
283
            \Yii::$app->getSession()->setFlash('error',
284
                \Yii::t('hipanel/ticket', 'Some error occurred! Priority has not been changed to high'));
285
        }
286
287
        return $this->redirect(Yii::$app->request->referrer);
288
    }
289
290
    /**
291
     * @param $id
292
     *
293
     * @return \yii\web\Response
294
     */
295 View Code Duplication
    public function actionPriorityDown($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
296
    {
297
        $options[$id] = ['id' => $id, 'priority' => 'medium'];
0 ignored issues
show
Coding Style Comprehensibility introduced by
$options was never initialized. Although not strictly required by PHP, it is generally a good practice to add $options = array(); before regardless.

Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code.

Let’s take a look at an example:

foreach ($collection as $item) {
    $myArray['foo'] = $item->getFoo();

    if ($item->hasBar()) {
        $myArray['bar'] = $item->getBar();
    }

    // do something with $myArray
}

As you can see in this example, the array $myArray is initialized the first time when the foreach loop is entered. You can also see that the value of the bar key is only written conditionally; thus, its value might result from a previous iteration.

This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.

Loading history...
298
        if ($this->_ticketChange($options)) {
299
            \Yii::$app->getSession()->setFlash('success',
0 ignored issues
show
Bug introduced by
The method getSession does only exist in yii\web\Application, but not in yii\console\Application.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
300
                \Yii::t('hipanel/ticket', 'Priority has been changed to medium'));
301
        } else {
302
            \Yii::$app->getSession()->setFlash('error', \Yii::t('hipanel/ticket', 'Something goes wrong!'));
303
        }
304
305
        return $this->redirect(Yii::$app->request->referrer);
306
    }
307
308
    /**
309
     * Numerous ticket changes in one method, like BladeRoot did :).
310
     *
311
     * @param array $options
312
     * @param string $apiCall
313
     * @param bool $bulk
314
     *
315
     * @return bool
316
     */
317
    private function _ticketChange($options = [], $apiCall = 'Answer', $bulk = true)
318
    {
319
        try {
320
            Thread::perform($apiCall, $options, $bulk);
321
        } catch (ErrorResponseException $e) {
322
            return false;
323
        }
324
325
        return true;
326
    }
327
328
    /**
329
     * @return string
330
     */
331
    public function actionGetQuotedAnswer()
332
    {
333
        $request = Yii::$app->request;
334
        if ($request->isAjax) {
335
            $id = $request->post('id');
336
            if ($id !== null) {
337
                try {
338
                    $answer = Thread::perform('GetAnswer', ['id' => $id]);
339
                } catch (ErrorResponseException $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
340
                }
341
                if (isset($answer['message'])) {
342
                    return '> ' . str_replace("\n", "\n> ", $answer['message']);
343
                }
344
            }
345
        }
346
        Yii::$app->end();
347
    }
348
349
    /**
350
     * @return mixed|string
351
     */
352
    public function actionPreview()
353
    {
354
        $request = Yii::$app->request;
355
        if ($request->isAjax) {
356
            $text = $request->post('text');
357
            if ($text) {
358
                return Thread::parseMessage($text);
359
            }
360
        }
361
        Yii::$app->end();
362
    }
363
364
    public function actionGetNewAnswers($id, $answer_id)
365
    {
366
        Yii::$app->response->format = Response::FORMAT_JSON;
367
368
        $result = ['id' => $id, 'answer_id' => $answer_id];
369
370
        try {
371
            $data = Thread::perform('GetLastAnswerId', ['id' => $id, 'answer_id' => $answer_id]);
372
            $result['answer_id'] = $data['answer_id'];
373
            if ($data['answer_id'] > $answer_id) {
374
                $dataProvider = (new ThreadSearch())->search([]);
375
                $dataProvider->query->joinWith('answers');
0 ignored issues
show
Bug introduced by
It seems like you code against a concrete implementation and not the interface yii\db\QueryInterface as the method joinWith() does only exist in the following implementations of said interface: hipanel\modules\client\models\query\ArticleQuery, hipanel\modules\client\models\query\ClientQuery, hiqdev\hiart\ActiveQuery, yii\db\ActiveQuery.

Let’s take a look at an example:

interface User
{
    /** @return string */
    public function getPassword();
}

class MyUser implements User
{
    public function getPassword()
    {
        // return something
    }

    public function getDisplayName()
    {
        // return some name.
    }
}

class AuthSystem
{
    public function authenticate(User $user)
    {
        $this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
        // do something.
    }
}

In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break.

Available Fixes

  1. Change the type-hint for the parameter:

    class AuthSystem
    {
        public function authenticate(MyUser $user) { /* ... */ }
    }
    
  2. Add an additional type-check:

    class AuthSystem
    {
        public function authenticate(User $user)
        {
            if ($user instanceof MyUser) {
                $this->logger->info(/** ... */);
            }
    
            // or alternatively
            if ( ! $user instanceof MyUser) {
                throw new \LogicException(
                    '$user must be an instance of MyUser, '
                   .'other instances are not supported.'
                );
            }
    
        }
    }
    
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types inside the if block in such a case.
  1. Add the method to the interface:

    interface User
    {
        /** @return string */
        public function getPassword();
    
        /** @return string */
        public function getDisplayName();
    }
    
Loading history...
376
                $dataProvider->query->andWhere(['id' => $id]);
377
                $dataProvider->query->andWhere($this->getSearchOptions());
378
                $models = $dataProvider->getModels();
379
380
                $result['html'] = $this->renderPartial('_comments', ['model' => reset($models)]);
381
            }
382
        } catch (ErrorResponseException $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
383
        }
384
385
        return $result;
386
    }
387
388
    private function getSearchOptions()
389
    {
390
        return ['with_anonym' => 1, 'with_answers' => 1, 'with_files' => 1, 'show_closed' => 1];
391
    }
392
393
    public function getPriorities()
394
    {
395
        return $this->getRefs('type,priority', 'hipanel/ticket');
396
    }
397
}
398