From 5b74a5aa9af31d301a75bb3d24f39d80b740dc80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Apr 2011 18:53:31 +0000 Subject: [PATCH] Fix: bug #32920 : Commercial -> Customers area (missing customer and suppliers name --- htdocs/societe/class/societe.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4468afd8efb..ef932386510 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -815,14 +815,14 @@ class Societe extends CommonObject dol_syslog("Societe::Delete erreur -1 ".$this->error, LOG_ERR); return -1; } - } + } if ($haschild > 0) { $this->error="ErrorRecordHasChildren"; return -1; } - + if ($this->db->begin()) { // Added by Matelli (see http://matelli.fr/showcases/patchs-dolibarr/fix-third-party-deleting.html) @@ -1340,9 +1340,12 @@ class Societe extends CommonObject $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'">'; $lienfin=''; - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->nom,'company').$lienfin); + $name=$this->name; + if (empty($name)) $name=$this->nom; + + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin); if ($withpicto && $withpicto != 2) $result.=' '; - $result.=$lien.($maxlen?dol_trunc($this->nom,$maxlen):$this->nom).$lienfin; + $result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin; return $result; }