From 84db20cb9f4b785877365ed1f4e71bd6ae97bfbb Mon Sep 17 00:00:00 2001 From: marina Date: Mon, 26 May 2025 10:40:39 +0300 Subject: [PATCH] ERP-417 --- erp24/views/write_offs_erp/_form.php | 64 ++++++++-------------------- 1 file changed, 18 insertions(+), 46 deletions(-) diff --git a/erp24/views/write_offs_erp/_form.php b/erp24/views/write_offs_erp/_form.php index 049b24bf..0bce8243 100644 --- a/erp24/views/write_offs_erp/_form.php +++ b/erp24/views/write_offs_erp/_form.php @@ -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"' -- 2.39.5