From 3825e9af06bc7c65a2feb0cbefa6abab857eb44f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Jan 2020 03:00:10 +0100 Subject: [PATCH] FIX logo not found in some cases --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 6 ++++-- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 6 ++++-- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 ++++-- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 6 ++++-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 6 ++++-- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 6 ++++-- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 994b71a416d..075ba0efb84 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1260,12 +1260,14 @@ class pdf_einstein extends ModelePDFCommandes { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 68fa5f179e7..6342cd6ce74 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1393,12 +1393,14 @@ class pdf_eratosthene extends ModelePDFCommandes { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index f39934a7f65..64aa3c52e25 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1618,12 +1618,14 @@ class pdf_crabe extends ModelePDFFactures { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index ecaa4ba14a0..3e00e2cab68 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1834,12 +1834,14 @@ class pdf_sponge extends ModelePDFFactures { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 4391c52d482..9219de5863c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1467,12 +1467,14 @@ class pdf_azur extends ModelePDFPropales { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) { diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index b26b8831f32..1e67ac6485c 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1503,12 +1503,14 @@ class pdf_cyan extends ModelePDFPropales { if ($this->emetteur->logo) { + $logodir = $conf->mycompany->dir_output; + if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity]; if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; } else { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + $logo = $logodir.'/logos/'.$this->emetteur->logo; } if (is_readable($logo)) {