From 21826bd2634c6e35ea8dd9070468f6d6515d1ab9 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 15 Nov 2024 00:57:56 +0100 Subject: [PATCH] #1918 [Sheet] fix: export zip wrong name --- view/sheet/sheet_export.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/view/sheet/sheet_export.php b/view/sheet/sheet_export.php index 2c395a8c..5836636e 100644 --- a/view/sheet/sheet_export.php +++ b/view/sheet/sheet_export.php @@ -151,23 +151,22 @@ $digiqualiExportJSON = json_encode($digiqualiExportArray, JSON_PRETTY_PRINT); $fileDir = $upload_dir . '/temp/'; - $exportBase = $fileDir . dol_print_date($now, 'dayhourlog', 'tzuser') . '_dolibarr_' . $exportName . '_export'; - $fileName = $exportBase . '.json'; + $exportBase = dol_print_date($now, 'dayhourlog', 'tzuser') . '_dolibarr_' . $exportName . '_export'; + $fileName = $fileDir . $exportBase . '.json'; file_put_contents($fileName, $digiqualiExportJSON); $zip = new ZipArchive(); - if ($zip->open($exportBase . '.zip', ZipArchive::CREATE ) === TRUE) { + if ($zip->open($fileDir . $exportBase . '.zip', ZipArchive::CREATE ) === TRUE) { setEventMessage($langs->transnoentities("ExportWellDone")); $zip->addFile($fileName, basename($fileName)); $zip->close(); - $fileNameZip = dol_print_date($now, 'dayhourlog', 'tzuser') . '_dolibarr_' . $exportName . '_export.zip'; - $filepath = DOL_URL_ROOT . '/document.php?modulepart=digiquali&file=' . urlencode('temp/'.$fileNameZip); + $filepath = DOL_URL_ROOT . '/document.php?modulepart=digiquali&file=' . urlencode('temp/' . $exportBase . '.zip'); ?>