change procurement product selection, keytoggle redirect change

This commit is contained in:
2016-03-01 21:18:39 +01:00
parent b07bc4eca9
commit 80b8f5a238
12 changed files with 184 additions and 35 deletions

View File

@@ -28,7 +28,7 @@ class ProductController extends \backend\controllers\BackendController
'rules' => [
// allow authenticated users
[
'actions' => ['create','index','view','update','statistics'],
'actions' => ['create','index','view','update','statistics','find'],
'allow' => true,
'roles' => ['admin','employee','reception'],
],
@@ -37,7 +37,19 @@ class ProductController extends \backend\controllers\BackendController
],
];
}
public function actionFind($id = null) {
$result = [ ];
$product = Product::findOne ( $id );
$product = Product::modelToArray ( $product );
$result ['product'] = $product;
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
return $result;
}
/**
* Lists all Product models.