Explorar el Código

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

master
Dukai Károly hace 2 años
padre
commit
25c455aca4
Se han modificado 2 ficheros con 7 adiciones y 1 borrados
  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 Ver fichero

'revokeAxicoId' => $revokeAxicoId, 'revokeAxicoId' => $revokeAxicoId,
'revokedProducts' => [], 'revokedProducts' => [],
'totalActualised' => 0, 'totalActualised' => 0,
'updatedProduct' => 0
]; ];
} }



+ 6
- 1
modules/custom/arlista/src/Form/Product/ProductUploadedList.php Ver fichero



public function getDownloadedFileName(int $downloadAll, Manufacturer $manufacturer, SheetSetting $sheetSetting): string { public function getDownloadedFileName(int $downloadAll, Manufacturer $manufacturer, SheetSetting $sheetSetting): string {
$scope = $downloadAll ? 'teljes' : $sheetSetting->getName(); $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; return $fileName;
} }

Cargando…
Cancelar
Guardar