From 812d13f84bca7055eaf9c206fca7913823760f3c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 8 Mar 2006 14:28:35 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20permission=20"consulter=20tou?= =?UTF-8?q?s=20les=20clients"=20dans=20le=20module=20commercial,=20afin=20?= =?UTF-8?q?=20qu'un=20commercial=20puisse=20voir=20que=20les=20clients=20q?= =?UTF-8?q?ui=20lui=20sont=20affect=E9s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index fc5fa6be7ba..f5151113438 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -129,10 +129,13 @@ if ($conf->contrat->enabled) if ($conf->propal->enabled && $user->rights->propale->lire) { $sql = "SELECT p.rowid, p.ref, p.price, s.idp, s.nom"; + if (!$user->rights->commercial->client->voir) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->commercial->client->voir) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.fk_statut = 0 and p.fk_soc = s.idp"; $sql.= " AND s.idp = ".$socidp; - + if (!$user->rights->commercial->client->voir) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; + $resql=$db->query($sql); if ($resql) {