add reception global word listener,allow delete transactions, allow delete account_state
This commit is contained in:
@@ -163,13 +163,13 @@ class AccountStateController extends Controller
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
\Yii::$app->session->setFlash( 'success','Kassza művelet törölve' );
|
||||
return $this->redirect(Yii::$app->request->referrer);
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* Displays a single AccountState model.
|
||||
* @param integer $id
|
||||
|
||||
@@ -159,11 +159,26 @@ class TransferController extends Controller
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
$transfer = $this->findModel($id);
|
||||
$connection = \Yii::$app->db;
|
||||
$transaction = $connection->beginTransaction();
|
||||
try {
|
||||
if ( $transfer->delete() ){
|
||||
\Yii::$app->session->setFlash( 'success','Tranzakció törölve' );
|
||||
$transaction->commit();
|
||||
}else{
|
||||
throw new \Exception("Failed to save");
|
||||
}
|
||||
|
||||
} catch(Exception $e) {
|
||||
$transaction->rollback();
|
||||
\Yii::$app->session->setFlash( 'danger','Tranzakció törlése nem sikerült' );
|
||||
}
|
||||
|
||||
return $this->redirect(['index']);
|
||||
|
||||
return $this->redirect(Yii::$app->request->referrer);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user