From: Alexander Smirnov Date: Fri, 26 Jul 2024 11:51:06 +0000 (+0300) Subject: Ограничение на большие файлы X-Git-Tag: 1.4~45^2~17 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=56d524ab5733ed07ce634eb9e72f077f1fd9330e;p=erp24_rep%2Fyii-erp24%2F.git Ограничение на большие файлы --- diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index a6aa1e25..4ae4d284 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -28,8 +28,18 @@ class MotivationService foreach ($spreadSheetRow->getCellIterator() as $spreadSheetRowCell) { $value = $spreadSheetRowCell->getValue(); $row []= $value; + if ($row[0] == '###') { + break; + } + } + if ($row[0] == '###') { + break; } if ($storeStr) { + if (!is_int($row[0] ?? -1)) { + $error = "Индекс магазина не корректен [0,0] '" . $row[0] . "'"; + break; + } $store = CityStore::find()->where(['id' => $row[0] ?? -1])->one(); if (!$store) { $error = "Не найден магазин с таким индексом [0,0]"; diff --git a/erp24/web/js/motivation/index.js b/erp24/web/js/motivation/index.js index 4522c800..bc37ef85 100644 --- a/erp24/web/js/motivation/index.js +++ b/erp24/web/js/motivation/index.js @@ -18,6 +18,10 @@ function openUploadDictionary(showDownloadLink) { const info = $modalBody.find('#infoModal').get(0); const form = $modalBody.find('form').get(0); async function UploadDict() { + if (browse.files[0].size > 200000) { + info.innerHTML = 'Некорректный файл. Загрузите файл, заполненный по шаблону.'; + return; + } const formData = new FormData(form); formData.append(param10, token10); try {