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

index 85f2d68bb59551cf69a9da767a60ceff156ed12f..5c79b1facc1bba3ef42af5ddea4ff853e039672b 100644 (file)
@@ -245,28 +245,39 @@ JS
                 [
                     'name' => 'videoFiles',
                     'title' => 'Видео: mp4, mov, avi',
-                    'type' => FileInput::class,
+                    'type' => \kartik\file\FileInput::class,
                     'options' => [
+                        'multiple' => false,
+                        'accept' => 'video/*',
+                        'name' => 'video_name',
                         'style' => 'max-width: 150px; overflow: hidden;',
-                        'options' => [
-                            'multiple' => false,
-                            'accept' => 'video/*',
-                            'name' => 'video_name',
-                        ],
-                        'pluginOptions' => [
-                            'showPreview' => true,
-                            'showCaption' => true,
-                            'showRemove' => true,
-                            'showUpload' => false,
-                            'browseLabel' => '',
-                            'removeLabel' => '',
-                            'cancelLabel' => '',
-                            'browseIcon' => '+',
-                            'removeIcon' => '-',
-                            'cancelIcon' => 'x',
-                            'previewFileType' => 'video',
-                            'allowedFileExtensions' => ['mp4', 'mov', 'avi'],
-                            'initialPreview' => isset($model->id) ? [
+                    ],
+                    'pluginOptions' => [
+                        'showPreview' => true,
+                        'showCaption' => true,
+                        'showRemove' => true,
+                        'showUpload' => false,
+                        'browseLabel' => '',
+                        'removeLabel' => '',
+                        'cancelLabel' => '',
+                        'browseIcon' => '+',
+                        'removeIcon' => '-',
+                        'cancelIcon' => 'x',
+                        '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([
@@ -274,23 +285,13 @@ JS
                                         '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]),
-                            ]] : [],
-                        ]
-                    ]
+                            ),
+                            'url' => Url::to(['delete-video', 'id' => $model->id]),
+                        ]] : [],
+                    ],
+                    'columnOptions' => [
+                        'style' => 'max-width: 150px;'
+                    ],
                 ],
                 [
                     'name' => 'comment',