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

index 049b24bf5d646eb74a18223e0275b3ee4fdf7005..0bce8243b8ed9baaecbe1a821ebcacfc96c54a29 100644 (file)
@@ -255,34 +255,6 @@ JS
 //                    'style' => 'width: 70px;',
                     ]
                 ],
-                [
-                    'name' => 'videoFiles',
-                    'title' => 'Видео: mp4, mov, avi',
-                    'type' => FileInput::className(),
-                    'options' => [
-                        'pluginOptions' => [
-                            'initialPreview' => function ($data) {
-                                $file = Files::findOne([
-                                    'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
-                                    'entity_id' => $data['id']
-                                ]);
-                                return $file ? [basename($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',
-                                    ]
-                                ] : [];
-                            },
-                        ],
-                    ],
-                ],
                 [
                     'name' => 'videoFiles',
                     'title' => 'Видео: mp4, mov, avi',
@@ -319,24 +291,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"'