From 972b60fe4cb50b7b379b43c2b9a094e7970d7215 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Oct 2008 20:41:23 +0000 Subject: [PATCH] Code cleaner --- htdocs/societe.class.php | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 87f17b36050..744f5c48773 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -1165,34 +1165,41 @@ class Societe extends CommonObject * \param maxlen Longueur max libelle * \return string Chaine avec URL */ - function getNomUrl($withpicto=0,$option='',$maxlen=0) + function getNomUrl($withpicto=0,$option='customer',$maxlen=0) { global $langs; $result=''; - if ($this->client == 1) + if ($option == 'customer') { - $lien = ''; + if ($this->client == 1) + { + $lien = ''; + $lienfin=''; + } + elseif($this->client == 2) + { + $lien= ''; + $lienfin=''; + } + else + { + $lien = ''; + $lienfin=''; + } + } + if ($option == 'supplier') + { + $lien = ''; $lienfin=''; } - elseif($this->client == 2) - { - $lien= ''; - $lienfin=''; - } - else - { - $lien = ''; - $lienfin=''; - } - if ($option == 'compta') { $lien = ''; $lienfin=''; } - + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->nom,'company').$lienfin.' '); $result.=$lien.($maxlen?dolibarr_trunc($this->nom,$maxlen):$this->nom).$lienfin; return $result;