Skip to content

Commit

Permalink
Add Disable, Enable, Delete functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Nov 13, 2015
1 parent 5eb1906 commit 885dc6f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 14 additions & 2 deletions src/controllers/BackupingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@ public function actions()
},
],
'update' => [
'class' => 'hipanel\actions\SmartUpdateAction',
'class' => 'hipanel\actions\SmartUpdateAction',
],
'disable' => [
'class' => 'hipanel\actions\SmartPerformAction',
],
'enable' => [
'class' => 'hipanel\actions\SmartPerformAction',
],
'delete' => [
'class' => 'hipanel\actions\SmartDeleteAction',
'success' => Yii::t('app', 'Deleted'),
'error' => Yii::t('app', 'Something went wrong.'),
],
'view' => [
'class' => 'hipanel\actions\ViewAction',
Expand All @@ -43,11 +54,12 @@ public function getTypeOptions()
{
return Ref::getList('type,backuping');
}

public function getStateOptions()
{
return [
'ok' => Yii::t('app', 'Ok'),
'disabled'=> Yii::t('app', 'Disabled'),
'disabled' => Yii::t('app', 'Disabled'),
'deleted' => Yii::t('app', 'Deleted'),
];
}
Expand Down
4 changes: 3 additions & 1 deletion src/models/Backuping.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function rules()
[['type', 'type_label', 'state', 'state_label'], 'safe'],

[['id', 'type'], 'safe', 'on' => ['update']],
[['id'], 'integer', 'on' => ['delete', 'disable', 'enable']],
];
}

Expand All @@ -44,7 +45,8 @@ public function attributeLabels()
'account_id' => Yii::t('app', 'Account'),
'server_id' => Yii::t('app', 'Server'),
'state_label' => Yii::t('app', 'State'),

'state' => Yii::t('app', 'State'),
'type' => Yii::t('app', 'Periodicity'),
]);
}
}

0 comments on commit 885dc6f

Please sign in to comment.