inventory changes

This commit is contained in:
2016-03-11 21:46:59 +01:00
parent 80507fce43
commit 0fc5ab01bc
11 changed files with 160 additions and 21 deletions

View File

@@ -79,7 +79,11 @@ class InventoryController extends Controller
public function actionCreate()
{
$model = new Inventory();
$user = User::findOne(\Yii::$app->user->id);
$model->name = 'Leltár_'.date('Ymd_His') .'_' . $user->username;
$model->id_user = \Yii::$app->user->id;
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_inventory]);