Skip to content

Commit

Permalink
+ smart actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jul 31, 2015
1 parent 7a8d0c4 commit 6695253
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 12 deletions.
27 changes: 27 additions & 0 deletions src/controllers/BillController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,31 @@

class BillController extends \hipanel\base\CrudController
{
public function actions()
{
return [
'index' => [
'class' => 'hipanel\actions\IndexAction',
],
'view' => [
'class' => 'hipanel\actions\ViewAction',
],
'validate-form' => [
'class' => 'hipanel\actions\ValidateFormAction',
],
'create' => [
'class' => 'hipanel\actions\SmartCreateAction',
'success' => Yii::t('app', 'Bill created'),
],
'update' => [
'class' => 'hipanel\actions\SmartUpdateAction',
'success' => Yii::t('app', 'Bill updated'),
],
'delete' => [
'class' => 'hipanel\actions\SmartDeleteAction',
'success' => Yii::t('app', 'Bill deleted'),
],
];
}

}
31 changes: 31 additions & 0 deletions src/controllers/TariffController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,35 @@

class TariffController extends \hipanel\base\CrudController
{
public function actions()
{
return [
'index' => [
'class' => 'hipanel\actions\IndexAction',
],
'view' => [
'class' => 'hipanel\actions\ViewAction',
],
'validate-form' => [
'class' => 'hipanel\actions\ValidateFormAction',
],
'create' => [
'class' => 'hipanel\actions\SmartCreateAction',
'success' => Yii::t('app', 'Tariff created'),
],
'set-note' => [
'class' => 'hipanel\actions\SmartUpdateAction',
'success' => Yii::t('app', 'Note updated'),
],
'update' => [
'class' => 'hipanel\actions\SmartUpdateAction',
'success' => Yii::t('app', 'Tariff updated'),
],
'delete' => [
'class' => 'hipanel\actions\SmartDeleteAction',
'success' => Yii::t('app', 'Tariff deleted'),
],
];
}

}
10 changes: 7 additions & 3 deletions src/grid/TariffGridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@

namespace hipanel\modules\finance\grid;

use hipanel\grid\MainColumn;

class TariffGridView extends \hipanel\grid\BoxedGridView
{
public static function defaultColumns()
{
return [
'tariff' => [
'class' => MainColumn::className(),
'class' => 'hipanel\grid\MainColumn',
'filterAttribute' => 'tariff_like',
],
'used' => [
'filter' => false,
],
'note' => [
'class' => 'hiqdev\xeditable\grid\XEditableColumn',
],
];
}
}
15 changes: 8 additions & 7 deletions src/models/Tariff.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ class Tariff extends \hipanel\base\Model
public function rules()
{
return [
[['client_id', 'seller_id', 'id'], 'integer'],
[['client', 'seller', 'bill'], 'safe'],
[['domain', 'server'], 'safe'],
[['tariff'], 'safe'],
[['type_id', 'state_id'], 'integer'],
[['type', 'state'], 'safe'],
[['used'], 'integer'],
[['client_id', 'seller_id', 'id'], 'integer'],
[['client', 'seller', 'bill'], 'safe'],
[['domain', 'server'], 'safe'],
[['tariff'], 'safe'],
[['type_id', 'state_id'], 'integer'],
[['type', 'state'], 'safe'],
[['used'], 'integer'],
[['note'], 'safe'],
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/views/tariff/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'filterModel' => $searchModel,
'columns' => [
'checkbox',
'seller_id', 'client_id',
'tariff',
'tariff', 'note', 'used',
'client_id', 'seller_id',
],
]) ?>

0 comments on commit 6695253

Please sign in to comment.