]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-417
authormarina <m.zozirova@gmail.com>
Tue, 27 May 2025 06:24:13 +0000 (09:24 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 27 May 2025 06:24:13 +0000 (09:24 +0300)
erp24/views/write_offs_erp/_form.php

index 6d425eea87461b674bffe9c4c65c9672e00d529f..f30fc7da5bba34f549899dc2b17628d32bcae2c7 100644 (file)
@@ -253,48 +253,55 @@ JS
                     ]
                 ],
                 [
-    'name' => 'videoFiles',
-    'title' => 'Видео: mp4, mov, avi',
-    'type' => FileInput::class,
-    'options' => [
-        'options' => [
-            'multiple' => false,
-            'accept' => 'video/*',
-            'name' => 'video_name',
-        ],
-        'pluginOptions' => [
-            'showPreview' => true,
-            'showCaption' => true,
-            'showRemove' => true,
-            'showUpload' => false,
-            'previewFileType' => 'video',
-            'allowedFileExtensions' => ['mp4', 'mov', 'avi'],
-            'initialPreview' => isset($model->id) ? [ // или $row['id'], если это в цикле
-                Files::find()
-                    ->select('url')
-                    ->where([
-                        'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
-                        'entity_id' => $model->id // или $row['id']
-                    ])
-                    ->scalar()
-            ] : [],
-            'initialPreviewAsData' => true,
-            'initialPreviewConfig' => isset($model->id) ? [[
-                'type' => 'video',
-                'caption' => basename(
-                    Files::find()
-                        ->select('url')
-                        ->where([
-                            'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
-                            'entity_id' => $model->id
-                        ])
-                        ->scalar()
-                ),
-                'url' => Url::to(['delete-video', 'id' => $model->id]),
-            ]] : [],
-        ]
-    ]
-],
+                    'name' => 'videoFiles',
+                    'title' => 'Видео: mp4, mov, avi',
+                    'type' => FileInput::class,
+                    'options' => [
+                        'options' => [
+                            'multiple' => false,
+                            'accept' => 'video/*',
+                            'name' => 'video_name',
+                        ],
+                        'pluginOptions' => [
+                            'showPreview' => true,
+                            'showCaption' => false,
+                            'showRemove' => true,
+                            'showUpload' => false,
+                            'browseIcon' => '+',
+                            'cancelIcon' => 'x',
+                            'removeIcon' => '-',
+                            'buttonLabelClass' => 'hidden',
+                            'fileActionSettings' => [
+                                'showUpload' => false
+                            ],
+                            'previewFileType' => 'video',
+                            'allowedFileExtensions' => ['mp4', 'mov', 'avi'],
+                            'initialPreview' => isset($model->id) ? [
+                                Files::find()
+                                    ->select('url')
+                                    ->where([
+                                        'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
+                                        'entity_id' => $model->id
+                                    ])
+                                    ->scalar()
+                            ] : [],
+                            'initialPreviewAsData' => true,
+                            'initialPreviewConfig' => isset($model->id) ? [[
+                                'type' => 'video',
+                                'caption' => basename(
+                                    Files::find()
+                                        ->select('url')
+                                        ->where([
+                                            'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
+                                            'entity_id' => $model->id
+                                        ])
+                                        ->scalar()
+                                ),
+                                'url' => Url::to(['delete-video', 'id' => $model->id]),
+                            ]] : [],
+                        ]
+                    ]
+                ],
                 [
                     'name' => 'comment',
                     'type' => 'textInput',