add role checking to controllers
This commit is contained in:
@@ -11,6 +11,7 @@ use yii\filters\VerbFilter;
|
||||
use common\models\Warehouse;
|
||||
use common\models\Product;
|
||||
use common\models\User;
|
||||
use common\components\Helper;
|
||||
|
||||
/**
|
||||
* ProcurementController implements the CRUD actions for Procurement model.
|
||||
@@ -118,14 +119,21 @@ class ProcurementController extends \backend\controllers\BackendController
|
||||
$transaction->commit();
|
||||
} else {
|
||||
$transaction->rollback();
|
||||
Helper::flash('error', "Hiba történt!");
|
||||
throw new NotFoundHttpException( Yii::t('common/procurement' ,'Failed to fullfill procurement.' ));
|
||||
}
|
||||
Helper::flash('success', Yii::t('backend/procurement', 'Beszerzés mentve'));
|
||||
} catch (\Exception $e) {
|
||||
$transaction->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
|
||||
return $this->redirect(['index' ]);
|
||||
if ( isset($_POST['_next'])){
|
||||
return $this->redirect(['create' ]);
|
||||
}else{
|
||||
return $this->redirect(['index' ]);
|
||||
}
|
||||
} else {
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
|
||||
Reference in New Issue
Block a user