folder creation in statistique

This commit is contained in:
Tiavina 2025-02-10 21:15:05 +03:00
parent c3d09507b9
commit 9a16432f91

View File

@ -78,9 +78,15 @@ class ExportThanatoStatisticService {
$thanatoFolder = $racineFolder.'STATISTIQUES/THANATOS/';
$fileHeader = $this->getExportThanatoFileHeader();
$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);
$fileNamePath = $thanatoFolder."STAT-THANATO-" . $filename . '.csv';
$storage = $this->rootFolder->getUserFolder($idNextcloud);
$storage->newFile($fileNamePath);
$file = $storage->get($fileNamePath);
$file->putContent($fileContent);