Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/anagrafiche/bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
$handle = fopen($file, 'w');

// Scrittura dell'intestazione
fputcsv($handle, ['email', 'ragione_sociale', 'fonte', 'sede_referente'], ';');
fputcsv($handle, ['email', 'ragione_sociale', 'fonte', 'sede_referente'], ';', escape: '\\');

// Scrittura dei dati
foreach ($results as $row) {
Expand All @@ -185,7 +185,7 @@
$row['ragione_sociale'],
$row['fonte'],
$row['sede_referente'],
], ';');
], ';', escape: '\\');
}
fclose($handle);

Expand Down
4 changes: 2 additions & 2 deletions modules/articoli/src/Import/CSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,12 @@ public function saveFailedRecordsWithErrors($filepath)

$header = $this->getHeader();
$header[] = 'Errore';
fputcsv($file, $header, ';');
fputcsv($file, $header, ';', escape: '\\');

foreach ($this->failed_rows as $index => $row) {
$error_message = $this->failed_errors[$index] ?? 'Errore sconosciuto';
$row[] = $error_message;
fputcsv($file, $row, ';');
fputcsv($file, $row, ';', escape: '\\');
}

fclose($file);
Expand Down
4 changes: 2 additions & 2 deletions modules/impianti/src/Import/CSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ public function saveFailedRecordsWithErrors($filepath)

$header = $this->getHeader();
$header[] = 'Errore';
fputcsv($file, $header, ';');
fputcsv($file, $header, ';', escape: '\\');

foreach ($this->failed_rows as $index => $row) {
$error_message = $this->failed_errors[$index] ?? 'Errore sconosciuto';
$row[] = $error_message;
fputcsv($file, $row, ';');
fputcsv($file, $row, ';', escape: '\\');
}

fclose($file);
Expand Down
4 changes: 2 additions & 2 deletions modules/liste_newsletter/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
$handle = fopen($file, 'w');

// Scrittura dell'intestazione
fputcsv($handle, ['Email', 'Ragione sociale'], ';');
fputcsv($handle, ['Email', 'Ragione sociale'], ';', escape: '\\');

// Scrittura dei dati
foreach ($results as $destinatario) {
Expand All @@ -156,7 +156,7 @@
fputcsv($handle, [
$origine->email,
$anagrafica->ragione_sociale,
], ';');
], ';', escape: '\\');
}
fclose($handle);

Expand Down
4 changes: 2 additions & 2 deletions modules/listini_cliente/src/Import/CSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ public function saveFailedRecordsWithErrors($filepath)

$header = $this->getHeader();
$header[] = 'Errore';
fputcsv($file, $header, ';');
fputcsv($file, $header, ';', escape: '\\');

foreach ($this->failed_rows as $index => $row) {
$error_message = $this->failed_errors[$index] ?? 'Errore sconosciuto';
$row[] = $error_message;
fputcsv($file, $row, ';');
fputcsv($file, $row, ';', escape: '\\');
}

fclose($file);
Expand Down
6 changes: 3 additions & 3 deletions src/Importer/CSVImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public static function createExample($filepath)
fprintf($file, chr(0xEF).chr(0xBB).chr(0xBF));

foreach ($content as $row) {
fputcsv($file, $row, ';');
fputcsv($file, $row, ';', escape: '\\');
}

fclose($file);
Expand Down Expand Up @@ -348,14 +348,14 @@ public function saveFailedRecordsWithErrors($filepath)
// Scrivi l'intestazione con colonna errore
$header = $this->getHeader();
$header[] = 'Errore';
fputcsv($file, $header, ';');
fputcsv($file, $header, ';', escape: '\\');
}

// Scrivi le righe fallite con errore
foreach ($this->failed_rows as $index => $row) {
$error_message = $this->failed_errors[$index] ?? 'Errore sconosciuto';
$row[] = $error_message;
fputcsv($file, $row, ';');
fputcsv($file, $row, ';', escape: '\\');
}

fclose($file);
Expand Down
Loading