add inventory admin fix, add procurement update

This commit is contained in:
2016-03-30 20:04:49 +02:00
parent 19761cb0cc
commit a12b87d3be
22 changed files with 853 additions and 245 deletions

View File

@@ -14,6 +14,7 @@ use common\models\User;
use common\components\Helper;
use common\models\Account;
use yii\helpers\Url;
use backend\models\ProcurementUpdate;
/**
* ProcurementController implements the CRUD actions for Procurement model.
@@ -30,7 +31,7 @@ class ProcurementController extends \backend\controllers\BackendController
'rules' => [
// allow authenticated users
[
'actions' => ['create','index','view', 'create-product'],
'actions' => ['create','index','view', 'create-product','update'],
'allow' => true,
'roles' => ['@'],
],
@@ -79,11 +80,34 @@ class ProcurementController extends \backend\controllers\BackendController
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Update procurement
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = ProcurementUpdate::findOne($id);
if ( !isset($model)){
throw new NotFoundHttpException("Az oldal nem található");
}
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
$model->save();
}
return $this->render('update', [
'model' => $model
]);
}
/**
* Creates a new Procurement model.
* If creation is successful, the browser will be redirected to the 'view' page.