]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-417
authormarina <m.zozirova@gmail.com>
Mon, 26 May 2025 07:52:42 +0000 (10:52 +0300)
committermarina <m.zozirova@gmail.com>
Mon, 26 May 2025 07:52:42 +0000 (10:52 +0300)
erp24/views/write_offs_erp/_form.php

index f98862348d7438ca8fa91665f9943f2a7f04c8c1..aff4ad65eb96891cb6a40a5f3354e61694c63f93 100644 (file)
@@ -278,26 +278,19 @@ JS
                             'showPreview' => true,
                             'showCaption' => true, // ✅ Должно быть true
                             'initialCaption' => '55656',
-                            'initialPreview' => function($data) {
-                                if (!$data || !isset($data['id'])) return [];
-                                $file = Files::findOne([
-                                    'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
-                                    'entity_id' => $data['id']
-                                ]);
-                                return $file ? [Yii::getAlias('@web') . $file->url] : [];
-                            },
-                            'initialPreviewConfig' => function($data) {
-                                if (!$data || !isset($data['id'])) return [];
-                                $file = Files::findOne([
-                                    'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
-                                    'entity_id' => $data['id']
-                                ]);
-                                return $file ? [[
-                                    'caption' => basename($file->url), // ✅ Обязательно!
-                                    'type' => 'video',
-                                    'size' => @filesize(Yii::getAlias('@webroot') . $file->url),
-                                ]] : [];
-                            },
+                            'initialPreview' => '809',
+//                            'initialPreviewConfig' => function($data) {
+//                                if (!$data || !isset($data['id'])) return [];
+//                                $file = Files::findOne([
+//                                    'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
+//                                    'entity_id' => $data['id']
+//                                ]);
+//                                return $file ? [[
+//                                    'caption' => basename($file->url), // ✅ Обязательно!
+//                                    'type' => 'video',
+//                                    'size' => @filesize(Yii::getAlias('@webroot') . $file->url),
+//                                ]] : [];
+//                            },
                         ],
                     ],
                     'columnOptions' => [