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

index a0568c8ef0c5693e626af1367fd1ed70a6a93f2c..59138405e04b0c2ac1e08515ed7c67434519317d 100644 (file)
@@ -289,11 +289,11 @@ JS
                     'type' => FileInput::className(),
                     'value' => function ($data) {
             var_dump($data);die();
-                        $file = Files::findOne([
-                                'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
-                                'entity_id' => $data['id']
-        ]);
-                        return $file ? basename($file->url) : null;
+//                        $file = Files::findOne([
+//                                'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
+//                                'entity_id' => $data['id']
+//        ]);
+//                        return $file ? basename($file->url) : null;
                     },
                     'options' => [
                         'options' => [
@@ -316,24 +316,24 @@ JS
                                 'showZoom' => false,
                                 'showDrag' => false
                             ],
-                            'initialPreview' => function($data) {
-                                $file = Files::findOne([
-                                    'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
-                                    'entity_id' => $data['id']
-                                ]);
-                                return $file ? [$file->url] : [];
-                            },
-                            'initialPreviewConfig' => function($data) {
-                                $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' => function($data) {
+//                                $file = Files::findOne([
+//                                    'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
+//                                    'entity_id' => $data['id']
+//                                ]);
+//                                return $file ? [$file->url] : [];
+//                            },
+//                            'initialPreviewConfig' => function($data) {
+//                                $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)
+//                                ]] : [];
+//                            },
                             'initialPreviewAsData' => true,
                             'previewSettings' => [
                                 'video' => '{width}: "100%", height: "auto"'