From 7e0ae4bf0ef1c1d98b34d4c95fa519146ec08e96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Nov 2019 14:17:22 +0100 Subject: [PATCH] FIX The pdf templates were using the large logo making PDF too large --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 +++++++- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 8 +++++++- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 8 +++++++- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 8 +++++++- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 8 +++++++- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 +++++++- 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f7f2acfbeb5..34fd8681178 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1260,9 +1260,15 @@ class pdf_einstein extends ModelePDFCommandes // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->dir_output.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index fe0a3cb0570..94adf8e8c07 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1394,9 +1394,15 @@ class pdf_eratosthene extends ModelePDFCommandes // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->dir_output.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 2cd59d94ee7..8ab120b19e4 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1571,9 +1571,15 @@ class pdf_crabe extends ModelePDFFactures // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->dir_output.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index afdee523bbd..9cde518fa67 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1602,9 +1602,15 @@ class pdf_sponge extends ModelePDFFactures // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->dir_output.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 14f4dfe8f9f..ebfaf64d4ff 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1462,9 +1462,15 @@ class pdf_azur extends ModelePDFPropales // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->dir_output.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index d8b20db9a40..770515959cd 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1507,9 +1507,15 @@ class pdf_cyan extends ModelePDFPropales // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->dir_output.'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo);