浏览代码

file name generation fix, group name is cleaned and manufacturer name as well in the file download process

master
Dukai Károly 2 年前
父节点
当前提交
25c455aca4
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. +1
    -0
      modules/custom/arlista/src/Controller/AxicoIdController.php
  2. +6
    -1
      modules/custom/arlista/src/Form/Product/ProductUploadedList.php

+ 1
- 0
modules/custom/arlista/src/Controller/AxicoIdController.php 查看文件

@@ -24,6 +24,7 @@ abstract class AxicoIdController extends ArlistaAbstractController {
'revokeAxicoId' => $revokeAxicoId,
'revokedProducts' => [],
'totalActualised' => 0,
'updatedProduct' => 0
];
}


+ 6
- 1
modules/custom/arlista/src/Form/Product/ProductUploadedList.php 查看文件

@@ -317,7 +317,12 @@ class ProductUploadedList extends ArlistaAbstractForm {

public function getDownloadedFileName(int $downloadAll, Manufacturer $manufacturer, SheetSetting $sheetSetting): string {
$scope = $downloadAll ? 'teljes' : $sheetSetting->getName();
$fileName = $manufacturer->getName() . ' - ' . $scope . ' - ' . date('Y-m-d-h-i-sa', time()) . '.xlsx';
$cleanScopeName = preg_replace('/[^a-zA-Z0-9]/','_', $scope);
$manufacturerName = $manufacturer->getName();
$cleanManufacturerName = preg_replace('/[^a-zA-Z0-9]/','_', $manufacturerName);
$fileName = $cleanManufacturerName . '_' . $cleanScopeName . '_' . date('Y-m-d-h-i-sa', time()) . '.xlsx';

return $fileName;
}

正在加载...
取消
保存