feat:
- la fonction charger_pdf() accepte maintenant un 3e args, les opts - on ajoute dans l'array des pieces jointes des infos (qui (d'où vient se pièce jointe) et quoi (son id)) - on deplace l'affichage des tPDFS dans un inclure : gamumail/inc-pdf_envoyes.html qui permet d'etre facilement surchargé
This commit is contained in:
parent
4e61ca9ec1
commit
a7fe6a811f
4 changed files with 70 additions and 54 deletions
|
@ -116,49 +116,29 @@
|
||||||
[(#CHEMIN{gamumail/#GET{fichier}.html}|oui)
|
[(#CHEMIN{gamumail/#GET{fichier}.html}|oui)
|
||||||
<INCLURE{fond=gamumail/#GET{fichier},env,lang=#GET{lang_dest}}>
|
<INCLURE{fond=gamumail/#GET{fichier},env,lang=#GET{lang_dest}}>
|
||||||
]
|
]
|
||||||
#SET{name,Tpdfs_ok}
|
<INCLURE{fond=gamumail/inc-pdf_envoyes,env}>
|
||||||
<B_pdf>
|
|
||||||
<h2><:gamumail:pdf_envoyes:></h2>
|
|
||||||
<div class="editer_groupe">
|
|
||||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
|
||||||
#SET{obli,"obligatoire"}
|
|
||||||
<div class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
|
||||||
<BOUCLE_pdf(DATA){source tableau, #ENV{TFichierpdfs}}>
|
|
||||||
<div class="choix">
|
|
||||||
<input type="checkbox" class="checkbox" name="#GET{name}[]" value="[(#VALEUR|table_valeur{fichier})]_#CLE" id="#GET{name}_#COMPTEUR_BOUCLE" checked="checked" >
|
|
||||||
[(#SET{url_pdf, #URL_PAGE{spipdf}
|
|
||||||
|parametre_url{spipdf, #VALEUR|table_valeur{fichier}}
|
|
||||||
|parametre_url{lang, #GET{lang_dest}}
|
|
||||||
})]
|
|
||||||
<BOUCLE_options(DATA){source tableau, #VALEUR|table_valeur{contexte}}>
|
|
||||||
[(#SET{url_pdf,[(#GET{url_pdf}|parametre_url{#CLE,#VALEUR})]})]
|
|
||||||
</BOUCLE_options>
|
|
||||||
<label for="#GET{name}_#COMPTEUR_BOUCLE">[(#VALEUR|table_valeur{nom}|html_entity_decode)] : <a href="#GET{url_pdf}">voir le PDF</a></label>
|
|
||||||
</div>
|
|
||||||
</BOUCLE_pdf>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</B_pdf>
|
|
||||||
|
|
||||||
#SET{name,docs_spip}
|
#SET{name,docs_spip}
|
||||||
<h2><:gamumail:documents_attaches:></h2>
|
<div class="documents_attaches">
|
||||||
<div class="w500p">
|
<h2><:gamumail:documents_attaches:></h2>
|
||||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
<div class="w500p">
|
||||||
<div class="editer editer_[(#GET{name})][ (#GET{erreurs}|oui)erreur]">
|
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||||
|
<div class="editer editer_[(#GET{name})][ (#GET{erreurs}|oui)erreur]">
|
||||||
<div class="choix">
|
<div class="choix">
|
||||||
[<span class="erreur_message">(#GET{erreurs})</span>]
|
[<span class="erreur_message">(#GET{erreurs})</span>]
|
||||||
<label for="#GET{name}"><:gamumail:id_docs_attaches:></label>
|
<label for="#GET{name}"><:gamumail:id_docs_attaches:></label>
|
||||||
<input type="text" class="text" name="#GET{name}" value="[(#ENV{#GET{name}})]" id="#GET{name}" >
|
<input type="text" class="text" name="#GET{name}" value="[(#ENV{#GET{name}})]" id="#GET{name}" >
|
||||||
</div>
|
|
||||||
<B_docs_spip>
|
|
||||||
<div class="details_docs_spip">
|
|
||||||
<ul>
|
|
||||||
<BOUCLE_docs_spip(DOCUMENTS){id_document IN #ENV{#GET{name}}|explode{','}}>
|
|
||||||
<li><strong>#ID_DOCUMENT :</strong> #TITRE ([<a class="mediabox" href="#URL_DOCUMENT">(#FICHIER|basename)</a>])</li>
|
|
||||||
</BOUCLE_docs_spip>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</B_docs_spip>
|
<B_docs_spip>
|
||||||
|
<div class="details_docs_spip">
|
||||||
|
<ul>
|
||||||
|
<BOUCLE_docs_spip(DOCUMENTS){id_document IN #ENV{#GET{name}}|explode{','}}>
|
||||||
|
<li><strong>#ID_DOCUMENT :</strong> #TITRE ([<a class="mediabox" href="#URL_DOCUMENT">(#FICHIER|basename)</a>])</li>
|
||||||
|
</BOUCLE_docs_spip>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</B_docs_spip>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
#SET{fichier,all_fichiers}
|
#SET{fichier,all_fichiers}
|
||||||
|
|
|
@ -351,7 +351,9 @@ function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $Tfiles, $re
|
||||||
'chemin' => $destination,
|
'chemin' => $destination,
|
||||||
'nom' => $nom_fichier,
|
'nom' => $nom_fichier,
|
||||||
'encodage' => 'base64',
|
'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,
|
'chemin' => $destination,
|
||||||
'nom' => $nom_fichier,
|
'nom' => $nom_fichier,
|
||||||
'encodage' => 'base64',
|
'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'],
|
'chemin' => $fichier['tmp_name'],
|
||||||
'nom' => $fichier['name'],
|
'nom' => $fichier['name'],
|
||||||
'encodage' => 'base64',
|
'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
|
], 'data' => $c
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$pdf = $recup_pdf($fichier, $c);
|
$pdf = $recup_pdf($fichier, $c, $args);
|
||||||
$nom_fichier = $nom.'.pdf';
|
if (!empty($pdf)) {
|
||||||
$destination = _DIR_TMP.basename($nom_fichier);
|
$nom_fichier = $nom.'.pdf';
|
||||||
$Tpdf_del[] = $destination;
|
$destination = _DIR_TMP.basename($nom_fichier);
|
||||||
file_put_contents($destination,$pdf);
|
$Tpdf_del[] = $destination;
|
||||||
$pieces_jointes[] = [
|
file_put_contents($destination,$pdf);
|
||||||
'chemin' => $destination,
|
$pieces_jointes[] = [
|
||||||
'nom' => $nom_fichier,
|
'chemin' => $destination,
|
||||||
'encodage' => 'base64',
|
'nom' => $nom_fichier,
|
||||||
'mime' => 'application/pdf'
|
'encodage' => 'base64',
|
||||||
];
|
'mime' => 'application/pdf',
|
||||||
|
'quoi' => 'pdf_genere',
|
||||||
|
'qui' => $fichier
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
26
gamumail/inc-pdf_envoyes.html
Normal file
26
gamumail/inc-pdf_envoyes.html
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#SET{name,Tpdfs_ok}
|
||||||
|
<div class="pdf_envoyes">
|
||||||
|
<B_pdf>
|
||||||
|
<h2><:gamumail:pdf_envoyes:></h2>
|
||||||
|
<div class="editer_groupe">
|
||||||
|
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||||
|
#SET{obli,"obligatoire"}
|
||||||
|
<div class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||||
|
<BOUCLE_pdf(DATA){source tableau, #ENV{TFichierpdfs}}>
|
||||||
|
<div class="choix">
|
||||||
|
<input type="checkbox" class="checkbox" name="#GET{name}[]" value="[(#VALEUR|table_valeur{fichier})]_#CLE" id="#GET{name}_#COMPTEUR_BOUCLE" checked="checked" >
|
||||||
|
[(#SET{url_pdf, #URL_PAGE{spipdf}
|
||||||
|
|parametre_url{spipdf, #VALEUR|table_valeur{fichier}}
|
||||||
|
|parametre_url{lang, #GET{lang_dest}}
|
||||||
|
})]
|
||||||
|
<BOUCLE_options(DATA){source tableau, #VALEUR|table_valeur{contexte}}>
|
||||||
|
[(#SET{url_pdf,[(#GET{url_pdf}|parametre_url{#CLE,#VALEUR})]})]
|
||||||
|
</BOUCLE_options>
|
||||||
|
<label for="#GET{name}_#COMPTEUR_BOUCLE">[(#VALEUR|table_valeur{nom}|html_entity_decode)] : <a href="#GET{url_pdf}">voir le PDF</a></label>
|
||||||
|
</div>
|
||||||
|
</BOUCLE_pdf>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</B_pdf>
|
||||||
|
</div>
|
||||||
|
|
|
@ -3,7 +3,7 @@ if (!defined('_ECRIRE_INC_VERSION')){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function inc_charger_pdf_dist($fichier_pdf, $contexte = []){
|
function inc_charger_pdf_dist($fichier_pdf, $contexte = [], $args = []){
|
||||||
|
|
||||||
$login = lire_config('curl_login');
|
$login = lire_config('curl_login');
|
||||||
$password = lire_config('curl_mdp');
|
$password = lire_config('curl_mdp');
|
||||||
|
|
Loading…
Add table
Reference in a new issue