From 5a80ce51413a85207b760f0f68e34fd6e69466a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2010 13:55:27 +0000 Subject: [PATCH] Qual: Mutualize and uniformize code --- htdocs/compta/clients.php | 13 +++++++++---- htdocs/societe/class/societe.class.php | 7 +------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 3bca42e3cfd..9f342f500fa 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -60,6 +60,8 @@ $pagenext = $page + 1; llxHeader(); +$thirdpartystatic=new Societe($db); + if ($action == 'attribute_prefix') { $societe = new Societe($db, $socid); @@ -96,7 +98,7 @@ if ($mode == 'search') { * */ -$sql = "SELECT s.rowid, s.nom, s.ville, s.datec, s.datea"; +$sql = "SELECT s.rowid, s.nom, s.client, s.ville, s.datec, s.datea"; $sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta "; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st"; @@ -199,9 +201,12 @@ if ($resql) $var=!$var; print ""; - print ''; - print img_object($langs->trans("ShowCustomer"),"company"); - print ' '.$obj->nom.''; + print ''; + $thirdpartystatic->id=$obj->rowid; + $thirdpartystatic->nom=$obj->nom; + $thirdpartystatic->client=$obj->client; + print $thirdpartystatic->getNomUrl(1,'compta'); + print ''; print ''.$obj->ville.' '; print ''.$obj->code_client.' '; print ''.$obj->code_compta.' '; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 96f2d970666..2768b7a24f2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1307,7 +1307,7 @@ class Societe extends CommonObject $result=''; $lien=$lienfin=''; - if ($option == 'customer') + if ($option == 'customer' || $option == 'compta') { if ($this->client == 1) { @@ -1325,11 +1325,6 @@ class Societe extends CommonObject $lien = ''; $lienfin=''; } - if ($option == 'compta') - { - $lien = ''; - $lienfin=''; - } if (empty($lien)) { $lien = '';