Skip to content

Commit

Permalink
Classes notation changed from pathtoClassName to PHP 5.6 ClassName::c…
Browse files Browse the repository at this point in the history
…lass
  • Loading branch information
SilverFire committed Dec 4, 2015
1 parent eabf9a5 commit 0766630
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions src/controllers/TicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
namespace hipanel\modules\ticket\controllers;

use common\models\File;
use hipanel\actions\IndexAction;
use hipanel\actions\ProxyAction;
use hipanel\actions\SmartCreateAction;
use hipanel\actions\SmartPerformAction;
use hipanel\actions\SmartUpdateAction;
use hipanel\actions\ValidateFormAction;
use hipanel\actions\ViewAction;
use hipanel\modules\client\models\Client;
use hipanel\modules\ticket\models\Thread;
use hipanel\modules\ticket\models\TicketSettings;
Expand All @@ -38,11 +45,11 @@ public function actions()
{
return [
'index' => [
'class' => 'hipanel\actions\IndexAction',
'class' => IndexAction::class,
'data' => $this->prepareRefs(),
],
'view' => [
'class' => 'hipanel\actions\ViewAction',
'class' => ViewAction::class,
'findOptions' => ['with_anonym' => 1, 'with_answers' => 1, 'with_files' => 1, 'show_closed' => 1],
'data' => function ($action) {
$client = Client::find()->where([
Expand All @@ -61,23 +68,23 @@ public function actions()
},
],
'validate-form' => [
'class' => 'hipanel\actions\ValidateFormAction',
'class' => ValidateFormAction::class,
],
'answer' => [
'class' => 'hipanel\actions\SmartUpdateAction',
'class' => SmartUpdateAction::class,
'success' => Yii::t('app', 'Ticket changed'),
],
'create' => [
'class' => 'hipanel\actions\SmartCreateAction',
'class' => SmartCreateAction::class,
'success' => Yii::t('app', 'Ticket posted'),
'data' => function () { return $this->prepareRefs(); },
],
'delete' => [
'class' => 'hipanel\actions\SmartPerformAction',
'class' => SmartPerformAction::class,
'success' => Yii::t('app', 'Ticket deleted'),
],
'subscribe' => [
'class' => 'hipanel\actions\SmartPerformAction',
'class' => SmartPerformAction::class,
'scenario' => 'answer',
'success' => Yii::t('app', 'Subscribed'),
'beforeSave' => function ($action) {
Expand All @@ -88,14 +95,14 @@ public function actions()
'POST pjax' => [
'save' => true,
'success' => [
'class' => 'hipanel\actions\ViewAction',
'class' => ViewAction::class,
'view' => '_subscribe_button',
'findOptions' => ['with_answers' => 1],
],
],
],
'unsubscribe' => [
'class' => 'hipanel\actions\SmartPerformAction',
'class' => SmartPerformAction::class,
'scenario' => 'answer',
'success' => Yii::t('app', 'Unsubscribed'),
'beforeSave' => function ($action) {
Expand All @@ -106,14 +113,14 @@ public function actions()
'POST pjax' => [
'save' => true,
'success' => [
'class' => 'hipanel\actions\ViewAction',
'class' => ViewAction::class,
'view' => '_subscribe_button',
'findOptions' => ['with_answers' => 1],
],
],
],
'close' => [
'class' => 'hipanel\actions\SmartPerformAction',
'class' => SmartPerformAction::class,
'scenario' => 'answer',
'success' => Yii::t('app', 'Ticket closed'),
'beforeSave' => function ($action) {
Expand All @@ -124,13 +131,13 @@ public function actions()
'POST pjax' => [
'save' => true,
'success' => [
'class' => 'hipanel\actions\ProxyAction',
'class' => ProxyAction::class,
'action' => 'view'
]
]
],
'open' => [
'class' => 'hipanel\actions\SmartPerformAction',
'class' => SmartPerformAction::class,
'scenario' => 'answer',
'success' => Yii::t('app', 'Ticket opened'),
'beforeSave' => function ($action) {
Expand All @@ -141,7 +148,7 @@ public function actions()
'POST pjax' => [
'save' => true,
'success' => [
'class' => 'hipanel\actions\ProxyAction',
'class' => ProxyAction::class,
'action' => 'view'
]
]
Expand Down

0 comments on commit 0766630

Please sign in to comment.