add role checking to controllers

This commit is contained in:
2015-11-05 17:24:09 +01:00
parent 43d5598f23
commit cc83ccf761
39 changed files with 362 additions and 78 deletions

View File

@@ -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,