amélioration génération pdf depuis html
FossilOrigin-Name: 996c3a9ad1c56e94c83b77c74aa804ccc3ff2eb7e0f4ea90f885882a801a6a32
This commit is contained in:
parent
057357a58d
commit
5d439d25af
5 changed files with 297 additions and 233 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Garradin;
|
||||
|
||||
use Garradin\Plugin\RecusFiscaux\HtmlPDF;
|
||||
use Garradin\Plugin\RecusFiscaux\RecusHTML;
|
||||
use Garradin\Plugin\RecusFiscaux\Utils;
|
||||
use Garradin\Plugin\RecusFiscaux\Personne;
|
||||
|
||||
|
|
@ -19,18 +19,16 @@ foreach ($lesLignes as $ligne) {
|
|||
$nomAsso = Utils::getNomAsso();
|
||||
$adresseAsso = Utils::getAdresseAsso();
|
||||
|
||||
$logoCERFA = PLUGIN_ROOT . "/data/logoCerfa.png";
|
||||
$signature = PLUGIN_ROOT . "/data/default_signature.png";
|
||||
$listeFichiers = [];
|
||||
|
||||
foreach ($versementsSelectionnes as $ligne)
|
||||
{
|
||||
// générer un fichier par reçu
|
||||
$pdf = new HtmlPDF(
|
||||
$pdf = new RecusHTML(
|
||||
$nomAsso,
|
||||
$adresseAsso,
|
||||
$plugin->getConfig('objet_asso'),
|
||||
$logoCERFA,
|
||||
$signature
|
||||
);
|
||||
|
||||
|
|
@ -46,7 +44,12 @@ foreach ($versementsSelectionnes as $ligne)
|
|||
$_SESSION['membresDonateurs'][$ligne->idUser]->ville
|
||||
);
|
||||
// fabriquer le fichier PDF
|
||||
$nomFichier = \Garradin\Utils::filePDF($pdf->get());
|
||||
$nomPDF = \Garradin\Utils::filePDF($pdf->get());
|
||||
// changer le nom du fichier
|
||||
$nom = str_replace(' ', '_', $_SESSION['membresDonateurs'][$ligne->idUser]->nomPrenom);
|
||||
$nom = str_replace("'", "", $nom);
|
||||
$nomFichier = "recu_" . $_SESSION['annee_recu'] . "_" . $nom . ".pdf";
|
||||
rename($nomPDF, $nomFichier);
|
||||
// ajouter le nom du fichier à la liste pour mettre dans une archive
|
||||
$listeFichiers[] = $nomFichier;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue