From 69c0e840eead14098d555aeb6650e4494e182162 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Apr 2009 02:23:57 +0000 Subject: [PATCH] Minor change --- htdocs/comm/index.php | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index d8e80c93e47..3f4b7dd71ae 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -86,6 +86,8 @@ if (isset($_GET["action"]) && $_GET["action"] == 'del_bookmark') $html = new Form($db); $formfile = new FormFile($db); +$companystatic=new Societe($db); +$propalstatic=new Propal($db); llxHeader(); @@ -134,7 +136,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire) */ if ($conf->propal->enabled && $user->rights->propale->lire) { - $sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom"; + $sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom, s.client"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -162,8 +164,17 @@ if ($conf->propal->enabled && $user->rights->propale->lire) { $obj = $db->fetch_object($resql); $var=!$var; - print ''."rowid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref.''; - print ''.dol_trunc($obj->nom,18).''; + print ''; + $propalstatic->id=$obj->rowid; + $propalstatic->ref=$obj->ref; + print $propalstatic->getNomUrl(1); + print ''; + print ''; + $companystatic->id=$obj->socid; + $companystatic->nom=$obj->nom; + $companystatic->client=$obj->client; + print $companystatic->getNomUrl(1,'customer',16); + print ''; print ''.price($obj->total_ht).''; $i++; $total += $obj->price; @@ -177,6 +188,10 @@ if ($conf->propal->enabled && $user->rights->propale->lire) } $db->free($resql); } + else + { + dol_print_error($db); + } } @@ -186,7 +201,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) if ($conf->commande->enabled && $user->rights->commande->lire) { $langs->load("orders"); - $sql = "SELECT c.rowid, c.ref, c.total_ttc, s.nom, s.rowid as socid"; + $sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom, s.client"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -215,7 +230,12 @@ if ($conf->commande->enabled && $user->rights->commande->lire) $var=!$var; $obj = $db->fetch_object($resql); print ''.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''; - print ''.dol_trunc($obj->nom,18).''; + print ''; + $companystatic->id=$obj->socid; + $companystatic->nom=$obj->nom; + $companystatic->client=$obj->client; + print $companystatic->getNomUrl(1,'customer',16); + print ''; print ''.price($obj->total_ttc).''; $i++; $total += $obj->total_ttc;