On supprime les pdfs temporaires
This commit is contained in:
parent
a0555a08ba
commit
4b9efc9c46
1 changed files with 9 additions and 0 deletions
|
@ -131,6 +131,7 @@ function formulaires_gamumail_traiter_dist($slug, $auteur = 0, $Tclient = [], $T
|
||||||
}
|
}
|
||||||
|
|
||||||
// les pdfs
|
// les pdfs
|
||||||
|
$Tpdf_dell = [];
|
||||||
if (!empty($Tpdfs_ok) and is_array($Tpdfs_ok)) {
|
if (!empty($Tpdfs_ok) and is_array($Tpdfs_ok)) {
|
||||||
if (array_key_exists('fichier', $Tpdf)) {
|
if (array_key_exists('fichier', $Tpdf)) {
|
||||||
$Tpdf = [$Tpdf];
|
$Tpdf = [$Tpdf];
|
||||||
|
@ -148,6 +149,7 @@ function formulaires_gamumail_traiter_dist($slug, $auteur = 0, $Tclient = [], $T
|
||||||
$pdf = $recup_pdf($pdf, $c);
|
$pdf = $recup_pdf($pdf, $c);
|
||||||
$nom_fichier = $nom.'.pdf';
|
$nom_fichier = $nom.'.pdf';
|
||||||
$destination = _DIR_TMP.basename($nom_fichier);
|
$destination = _DIR_TMP.basename($nom_fichier);
|
||||||
|
$Tpdf_dell[] = $destination;
|
||||||
file_put_contents($destination,$pdf);
|
file_put_contents($destination,$pdf);
|
||||||
$pieces_jointes[] = [
|
$pieces_jointes[] = [
|
||||||
'chemin' => $destination,
|
'chemin' => $destination,
|
||||||
|
@ -180,6 +182,13 @@ function formulaires_gamumail_traiter_dist($slug, $auteur = 0, $Tclient = [], $T
|
||||||
$retour['message_ok'] = _T('gamumail:mail_envoye');
|
$retour['message_ok'] = _T('gamumail:mail_envoye');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// on supprime les pdfs temporaires
|
||||||
|
if (count($Tpdf_dell)) {
|
||||||
|
foreach ($Tpdf_dell as $pdf) {
|
||||||
|
unlink($pdf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($redirect) {
|
if ($redirect) {
|
||||||
$retour['redirect'] = $redirect;
|
$retour['redirect'] = $redirect;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue