diff --git a/formulaires/gamumail.html b/formulaires/gamumail.html index 245f24a..1e0845a 100644 --- a/formulaires/gamumail.html +++ b/formulaires/gamumail.html @@ -116,49 +116,29 @@ [(#CHEMIN{gamumail/#GET{fichier}.html}|oui) ] - #SET{name,Tpdfs_ok} - -

<:gamumail:pdf_envoyes:>

-
- #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} - #SET{obli,"obligatoire"} -
- -
- - [(#SET{url_pdf, #URL_PAGE{spipdf} - |parametre_url{spipdf, #VALEUR|table_valeur{fichier}} - |parametre_url{lang, #GET{lang_dest}} - })] - - [(#SET{url_pdf,[(#GET{url_pdf}|parametre_url{#CLE,#VALEUR})]})] - - -
- -
-
-
+ #SET{name,docs_spip} -

<:gamumail:documents_attaches:>

-
- #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} -
+
+

<:gamumail:documents_attaches:>

+
+ #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} +
- [(#GET{erreurs})] - - -
- -
- + [(#GET{erreurs})] + +
-
+ +
+ +
+
+
#SET{fichier,all_fichiers} diff --git a/formulaires/gamumail.php b/formulaires/gamumail.php index 7ca8aff..353a77d 100644 --- a/formulaires/gamumail.php +++ b/formulaires/gamumail.php @@ -351,7 +351,9 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $Tfiles, $re 'chemin' => $destination, 'nom' => $nom_fichier, 'encodage' => 'base64', - 'mime' => $type_mime + 'mime' => $type_mime, + 'quoi' => 'docs_spip', + 'qui' => $id_document ]; } } @@ -372,7 +374,9 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $Tfiles, $re 'chemin' => $destination, 'nom' => $nom_fichier, 'encodage' => 'base64', - 'mime' => $type_mime + 'mime' => $type_mime, + 'quoi' => 'docs_spip', + 'qui' => $id_doc ]; } } @@ -384,7 +388,9 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $Tfiles, $re 'chemin' => $fichier['tmp_name'], 'nom' => $fichier['name'], 'encodage' => 'base64', - 'mime' => $fichier['type'] + 'mime' => $fichier['type'], + 'quoi' => 'televerser', + 'qui' => $fichier['name'] ]; } } @@ -420,17 +426,21 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $Tfiles, $re ], 'data' => $c ]); - $pdf = $recup_pdf($fichier, $c); - $nom_fichier = $nom.'.pdf'; - $destination = _DIR_TMP.basename($nom_fichier); - $Tpdf_del[] = $destination; - file_put_contents($destination,$pdf); - $pieces_jointes[] = [ - 'chemin' => $destination, - 'nom' => $nom_fichier, - 'encodage' => 'base64', - 'mime' => 'application/pdf' - ]; + $pdf = $recup_pdf($fichier, $c, $args); + if (!empty($pdf)) { + $nom_fichier = $nom.'.pdf'; + $destination = _DIR_TMP.basename($nom_fichier); + $Tpdf_del[] = $destination; + file_put_contents($destination,$pdf); + $pieces_jointes[] = [ + 'chemin' => $destination, + 'nom' => $nom_fichier, + 'encodage' => 'base64', + 'mime' => 'application/pdf', + 'quoi' => 'pdf_genere', + 'qui' => $fichier + ]; + } } } diff --git a/gamumail/inc-pdf_envoyes.html b/gamumail/inc-pdf_envoyes.html new file mode 100644 index 0000000..cc278ca --- /dev/null +++ b/gamumail/inc-pdf_envoyes.html @@ -0,0 +1,26 @@ +#SET{name,Tpdfs_ok} +
+ +

<:gamumail:pdf_envoyes:>

+
+ #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} + #SET{obli,"obligatoire"} +
+ +
+ + [(#SET{url_pdf, #URL_PAGE{spipdf} + |parametre_url{spipdf, #VALEUR|table_valeur{fichier}} + |parametre_url{lang, #GET{lang_dest}} + })] + + [(#SET{url_pdf,[(#GET{url_pdf}|parametre_url{#CLE,#VALEUR})]})] + + +
+ +
+
+
+
+ diff --git a/inc/charger_pdf.php b/inc/charger_pdf.php index ec1d35c..aeec439 100644 --- a/inc/charger_pdf.php +++ b/inc/charger_pdf.php @@ -3,7 +3,7 @@ if (!defined('_ECRIRE_INC_VERSION')){ return; } -function inc_charger_pdf_dist($fichier_pdf, $contexte = []){ +function inc_charger_pdf_dist($fichier_pdf, $contexte = [], $args = []){ $login = lire_config('curl_login'); $password = lire_config('curl_mdp');