From 69f7abd9e592c83788ccda9b310ecc1cbcd608df Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 20 Oct 2021 15:24:34 +0000 Subject: [PATCH] wait #4810 @0.5 --- inc/ws/Controlleur/class.ws.stats.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.stats.php b/inc/ws/Controlleur/class.ws.stats.php index 616b0dde7..5b60b58f3 100644 --- a/inc/ws/Controlleur/class.ws.stats.php +++ b/inc/ws/Controlleur/class.ws.stats.php @@ -12,15 +12,21 @@ class wsStats public static function exportXLS($bid, $annee = null, $mois = null) { + global $core; + $dao = new wsDAOBook($core->con); $xname = self::_getXLSFile($bid, $annee, $mois); - $fname = 'stats_' . $bid; + $e = explode('_', $bid); + $book = $dao->selectById($e[0]); + + $fname = 'stats-' . $e[0]; if (!is_null($annee)) { - $fname .= '_' . $annee; + $fname .= '-' . $annee; if (!is_null($mois)) { - $fname .= '_' . $mois; + $fname .= '-' . $mois; } } - $fname .= '.xlsx'; + + $fname .= '-' . CubeIT_Text::str2URL($book->parametres->title) . '.xlsx'; files::$mimeType['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; -- 2.39.5