From 726fa4b0a664a3710c9db6cb417ccf2135863cee Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 27 May 2025 09:52:01 +0300 Subject: [PATCH] ERP-417 --- erp24/views/write_offs_erp/_form.php | 65 ++++++++++++++-------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/erp24/views/write_offs_erp/_form.php b/erp24/views/write_offs_erp/_form.php index 5c79b1fa..258345ae 100644 --- a/erp24/views/write_offs_erp/_form.php +++ b/erp24/views/write_offs_erp/_form.php @@ -249,35 +249,20 @@ JS 'options' => [ 'multiple' => false, 'accept' => 'video/*', - 'name' => 'video_name', - 'style' => 'max-width: 150px; overflow: hidden;', - ], - '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( + '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([ @@ -285,12 +270,26 @@ JS 'entity_id' => $model->id ]) ->scalar() - ), - 'url' => Url::to(['delete-video', 'id' => $model->id]), - ]] : [], + ] : [], + '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]), + ]] : [], + ], + 'style' => 'max-width: 150px; overflow: hidden;', ], 'columnOptions' => [ - 'style' => 'max-width: 150px;' + 'style' => 'max-width: 150px;', ], ], [ -- 2.39.5