Merge branch 'hotfixes/hotfix-export-thanato-stat' into staging

This commit is contained in:
Tiavina 2025-02-10 21:16:17 +03:00
commit be1f39b58c

View File

@ -78,9 +78,15 @@ class ExportThanatoStatisticService {
$thanatoFolder = $racineFolder.'STATISTIQUES/THANATOS/'; $thanatoFolder = $racineFolder.'STATISTIQUES/THANATOS/';
$fileHeader = $this->getExportThanatoFileHeader(); $fileHeader = $this->getExportThanatoFileHeader();
$fileContent = $this->populateExportDataIntoFileContent($exportData,$fileHeader); $fileContent = $this->populateExportDataIntoFileContent($exportData,$fileHeader);
$storage = $this->rootFolder->getUserFolder($idNextcloud);
try{
$storage->newFolder($thanatoFolder);
}
catch(\OCP\Files\NotPermittedException $e) {
}
$filename = $this->getFilename($thanato["nom"],$thanato["prenom"],$month,$year); $filename = $this->getFilename($thanato["nom"],$thanato["prenom"],$month,$year);
$fileNamePath = $thanatoFolder."STAT-THANATO-" . $filename . '.csv'; $fileNamePath = $thanatoFolder."STAT-THANATO-" . $filename . '.csv';
$storage = $this->rootFolder->getUserFolder($idNextcloud);
$storage->newFile($fileNamePath); $storage->newFile($fileNamePath);
$file = $storage->get($fileNamePath); $file = $storage->get($fileNamePath);
$file->putContent($fileContent); $file->putContent($fileContent);