From 5a6e578d813833a8f52021663c094f4bc8e73ad2 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Tue, 16 Jul 2024 15:19:35 +0300 Subject: [PATCH] =?utf8?q?[ERP-89]=20=D0=9C=D0=BE=D1=82=D0=B8=D0=B2=D0=B0?= =?utf8?q?=D1=86=D0=B8=D1=8F=20rbac=20=D0=B8=20=D1=84=D0=B8=D0=BB=D1=8C?= =?utf8?q?=D1=82=D1=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/motivation/IndexAction.php | 29 ++++++++++ erp24/controllers/MotivationController.php | 30 +++++++++++ erp24/views/motivation/index.php | 62 ++++++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 erp24/actions/motivation/IndexAction.php create mode 100644 erp24/controllers/MotivationController.php create mode 100644 erp24/views/motivation/index.php diff --git a/erp24/actions/motivation/IndexAction.php b/erp24/actions/motivation/IndexAction.php new file mode 100644 index 00000000..94a06feb --- /dev/null +++ b/erp24/actions/motivation/IndexAction.php @@ -0,0 +1,29 @@ + null, 'year' => null, 'month' => null + ], [ + [['store_id', 'year', 'month'], 'safe'] + ]); + $model->load(Yii::$app->request->get()); + + $stores = ArrayHelper::map(CityStore::find()->all(), 'id', 'name'); + + $years = [2023, 2024, 2025, 2026]; + $months = ['Январь',' Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь']; + + return $this->controller->render('index', + compact('model', 'stores', 'years', 'months')); + } +} \ No newline at end of file diff --git a/erp24/controllers/MotivationController.php b/erp24/controllers/MotivationController.php new file mode 100644 index 00000000..8175a6e3 --- /dev/null +++ b/erp24/controllers/MotivationController.php @@ -0,0 +1,30 @@ + \yii_app\actions\motivation\IndexAction::class, + ]; + } + + public function behaviors() + { + return [ + 'access' => [ + 'class' => AccessControl::class, + 'rules' => [ + [ + 'allow' => true, + 'permissions' => ['menu/motivation'], + ] + ] + ] + ]; + } +} \ No newline at end of file diff --git a/erp24/views/motivation/index.php b/erp24/views/motivation/index.php new file mode 100644 index 00000000..04a1860d --- /dev/null +++ b/erp24/views/motivation/index.php @@ -0,0 +1,62 @@ + + +
+ + 'GET']) ?> + +
+
+
+
Магазин:
+
field($model, 'store_id')->widget(Select2::class, [ + 'data' => $stores, + 'language' => 'ru', + 'options' => ['placeholder' => 'Магазин...'], + 'pluginOptions' => [ + 'allowClear' => true + ], + ])->label(false) ?>
+
+
+
Год:
+
field($model, 'year')->widget(Select2::class, [ + 'data' => $years, + 'language' => 'ru', + 'options' => ['placeholder' => 'Год...'], + 'pluginOptions' => [ + 'allowClear' => true + ], + ])->label(false) ?>
+
+
+
Месяц:
+
field($model, 'month')->widget(Select2::class, [ + 'data' => $months, + 'language' => 'ru', + 'options' => ['placeholder' => 'Месяц...'], + 'pluginOptions' => [ + 'allowClear' => true + ], + ])->label(false) ?>
+
+
+
'btn btn-secondary btn-sm'])?>
+
+
+
+ + + +
-- 2.39.5