From: marina Date: Wed, 21 May 2025 07:13:15 +0000 (+0300) Subject: ERP-417 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=0d9ae745aad3e07001df4e5db8fde73e0bda9fa1;p=erp24_rep%2Fyii-erp24%2F.git ERP-417 --- diff --git a/erp24/views/write_offs_erp/_form.php b/erp24/views/write_offs_erp/_form.php index 5b02d84f..41afe87d 100644 --- a/erp24/views/write_offs_erp/_form.php +++ b/erp24/views/write_offs_erp/_form.php @@ -100,7 +100,7 @@ $this->registerJsFile('/js/heic_to_jpg_replace.js', ['position' => \yii\web\View ?>
field($model, 'modelsProducts')->widget(MultipleInput::className(), [ - 'min' => 1, + 'min' => 0, 'max' => 100, 'columns' => [ [ @@ -158,6 +158,45 @@ $this->registerJsFile('/js/heic_to_jpg_replace.js', ['position' => \yii\web\View ]); + $query->joinWith(['imagesWriteOffsErp']); + + $action = $query->createCommand()->getRawSql(); + + $modelWriteOffsProductsErp = $query->All(); + $productImagesList = []; + $forWidget = false; + foreach ($modelWriteOffsProductsErp as $item) { + $productImagesList = WriteOffsErp::getImagesList($item->imagesWriteOffsErp, $forWidget); + } + if (!empty($productImagesList)) { +// $dataTable = dosamigos\gallery\Gallery::widget(['items' => $productImagesList]); + if ($forWidget) { + $dataTable = dosamigos\gallery\Gallery::widget(['items' => $productImagesList]); + } else { + $dataTable = implode('', $productImagesList); + } + } + } + $test = 33; + return $dataTable ?? ''; + }, + 'headerOptions' => [ +// 'style' => 'width: 70px;', + ] + ], + [ + 'name' => 'images_row', + 'type' => BaseColumn::TYPE_STATIC, + 'value' => function($data) { +// $images = WriteOffsErp::getImagesList($product->imagesWriteOffsErp); + if (!empty($data['id'])) { + $query = WriteOffsProductsErp::find() + ->andWhere([ + 'write_offs_products_erp.id' => $data['id'], + 'write_offs_products_erp.active_product' => 1, + ]); + + $query->joinWith(['imagesWriteOffsErp']); $action = $query->createCommand()->getRawSql(); @@ -235,6 +274,40 @@ $this->registerJsFile('/js/heic_to_jpg_replace.js', ['position' => \yii\web\View 'class' => 'custom_css_class_file_input' ] ], + [ + 'name' => 'videoFiles', + 'title' => 'Видео: mp4, webm, ogg, mov', + 'type' => FileInput::className(), + 'options' => [ + 'options' => [ + 'multiple' => true, + 'accept' => 'video/*', + 'name' => 'video_name', + 'capture' => '', + 'class' => 'file' + ], + 'pluginOptions' => [ + 'showPreview' => false, // отключено, т.к. видео превью не поддерживаются по умолчанию + 'showCaption' => true, + 'showRemove' => true, + 'showUpload' => false, + 'overwriteInitial' => true, + 'browseIcon' => '+', + 'cancelIcon' => 'x', + 'removeIcon' => '-', + 'buttonLabelClass' => 'hidden', + 'fileActionSettings' => ['showUpload' => false], + 'maxFileCount' => 10, + 'allowedFileExtensions' => ['mp4', 'webm', 'ogg', 'mov'], + 'multiple' => true + ], + 'model' => $multipleUploadForm, + ], + 'columnOptions' => [ + 'class' => 'custom_css_class_file_input' + ] + ], + [ 'name' => 'comment', 'type' => 'textInput',