From 9c1ad3591ddbe706a764afb1a56a0b979c4d15e0 Mon Sep 17 00:00:00 2001 From: tofulm Date: Tue, 7 Nov 2023 10:34:00 +0100 Subject: [PATCH] feat: on passe par remplacements slug sur le nom du fichier pdf --- formulaires/gamumail.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/formulaires/gamumail.php b/formulaires/gamumail.php index 3541ed3..26a4834 100644 --- a/formulaires/gamumail.php +++ b/formulaires/gamumail.php @@ -267,6 +267,10 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $redirect, & $Tid_doc = _request('Tid_doc'); $texte = facteur_mail_html2text($html); + $args = $options; + $args['slug'] = $slug; + $args['destinataires'] = $destinataires; + $pieces_jointes = []; if ($f = charger_fonction('traiter_av_pdf', 'gamumail', true)) { $options = $f($options, $destinataires, $Tclient, $Tpdf); @@ -333,6 +337,7 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $redirect, & $recup_pdf = charger_fonction('charger_pdf','inc'); foreach ($Tpdfs_ok as $pdf) { + $nom = "mon_fichier"; foreach ($Tpdf as $cle => $p) { if ($p['fichier'].'_'.$cle === $pdf) { $fichier = $p['fichier']; @@ -340,6 +345,12 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $redirect, & $nom = isset($p['nom']) ? $p['nom'] : $fichier; } } + + $nom = pipeline('remplacements_slug', array( + 'args' => $args, + 'data' => $nom + )); + $c = pipeline('tpdf_charger_contexte', [ 'args' => [ 'destinataires' => $destinataires, @@ -392,9 +403,6 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $redirect, & $html = $html_header . $html . $html_footer; // pipeline pour les traitement du contenu des slugs spécifiques de chaque plugin - $args = $options; - $args['slug'] = $slug; - $args['destinataires'] = $destinataires; $html = pipeline('remplacements_slug', array( 'args' => $args, 'data' => $html