From 60662b16d96e84fc469f217e6273540d6a7756d2 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Mon, 8 Sep 2025 16:24:23 +0300 Subject: [PATCH] =?utf8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5?= =?utf8?q?=20=D0=B3=D1=80=D1=83=D0=BF=D0=BF=20=D0=B8=D0=B7=20=D0=BC=D0=BE?= =?utf8?q?=D0=B4=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BE=D0=BA?= =?utf8?q?=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/MatrixTypeController.php | 2 +- erp24/views/matrix-type/index.php | 29 +++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/erp24/controllers/MatrixTypeController.php b/erp24/controllers/MatrixTypeController.php index ed4e5d16..c3ae5af9 100644 --- a/erp24/controllers/MatrixTypeController.php +++ b/erp24/controllers/MatrixTypeController.php @@ -113,7 +113,7 @@ class MatrixTypeController extends Controller Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; $child = new MatrixType(); $child->load(Yii::$app->request->post(), ''); - $child->parent_id = (int)$parent_id; + $child->parent_id = (int)$parent_id ?? null; if ($child->save()) { Yii::$app->session->setFlash('success', 'Запись создана', false); diff --git a/erp24/views/matrix-type/index.php b/erp24/views/matrix-type/index.php index 09656b18..181ddb53 100644 --- a/erp24/views/matrix-type/index.php +++ b/erp24/views/matrix-type/index.php @@ -35,9 +35,36 @@ $this->registerJsFile('/js/matrix-type/index.js', ['position' => \yii\web\View::

- 'btn btn-success']) ?> + 'btn btn-success', 'data-bs-toggle'=> "modal", 'data-bs-target' => "#createNewGroup"]) ?>

+ +