]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
short tag fix
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Thu, 22 Feb 2024 11:34:55 +0000 (14:34 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Thu, 22 Feb 2024 11:34:55 +0000 (14:34 +0300)
erp24/assets/timetable/StartAsset.php [new file with mode: 0755]
erp24/assets/timetable/TimetableAsset.php [new file with mode: 0755]
erp24/controllers/ChangeUrlController.php [new file with mode: 0644]

diff --git a/erp24/assets/timetable/StartAsset.php b/erp24/assets/timetable/StartAsset.php
new file mode 100755 (executable)
index 0000000..a60d79c
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace yii_app\assets\timetable;
+
+use yii\web\AssetBundle;
+
+class StartAsset extends AssetBundle
+{
+    public $basePath = '@dist';
+    public $baseUrl = '/dist';
+
+    public $js = [
+        'js/timetable/start.js',
+    ];
+    public $css = [
+        'css/timetable/start.css',
+    ];
+    public $jsOptions = ['defer' => true];
+}
diff --git a/erp24/assets/timetable/TimetableAsset.php b/erp24/assets/timetable/TimetableAsset.php
new file mode 100755 (executable)
index 0000000..d6a99a9
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+namespace yii_app\assets\timetable;
+
+use yii\web\AssetBundle;
+
+class TimetableAsset extends AssetBundle
+{
+    public $basePath = '@dist';
+    public $baseUrl = '/dist';
+
+    public $js = [
+        'js/timetable.js',
+    ];
+    public $css = [
+        'css/timetable.css',
+        '/css/print.css',
+    ];
+    public $jsOptions = ['defer' => true];
+}
diff --git a/erp24/controllers/ChangeUrlController.php b/erp24/controllers/ChangeUrlController.php
new file mode 100644 (file)
index 0000000..08fc4dc
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+namespace app\controllers;
+
+use yii\web\Controller;
+use yii_app\records\CrmMenu;
+
+class ChangeUrlController extends Controller
+{
+    public function actionIndex() {
+        $menuList = CrmMenu::find()->all();
+        foreach ($menuList as $menu) {
+            if (strpos($menu->url, '_') != false) {
+                echo '<br> old ' . $menu->url . ' ';
+                $arr = explode('?', $menu->url);
+                $arr[0] = preg_replace('/_/', '-', $arr[0]);
+                $newUrl = implode('?', $arr);
+                echo ' : new ' . $newUrl . ' ';
+                $menu->url = $newUrl;
+                $menu->save();
+            }
+        }
+        return 'ok';
+    }
+}