From c3f07dd2e08bd6b8cf67da2b76b1577d98de5014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Oct 2018 19:28:52 +0200 Subject: [PATCH] define $code for all execution paths --- htdocs/societe/class/societe.class.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 729995a81d0..de5ce919a64 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1837,24 +1837,28 @@ class Societe extends CommonObject if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) { + $code = ''; if (($this->client) && (! empty ( $this->code_client )) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 ) - ) - $code = $this->code_client . ' - '; + ) { + $code .= $this->code_client . ' - '; + } if (($this->fournisseur) && (! empty ( $this->code_fournisseur )) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 ) - ) - $code .= $this->code_fournisseur . ' - '; + ) { + $code .= $this->code_fournisseur . ' - '; + } - if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) - $name =$code.' '.$name; - else - $name =$code; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) { + $name = $code.' '.$name; + } else { + $name = $code; + } } if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')';