From e7e7b3574268298d341e7730370881cb88195543 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2008 12:43:27 +0000 Subject: [PATCH] Solve sql error on some mysql versions --- htdocs/projet/liste.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index 841f0ca5a4c..629e4da4488 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -71,9 +71,9 @@ $staticsoc=new Societe($db); $sql = "SELECT p.rowid as projectid, p.ref, p.title, ".$db->pdate("p.dateo")." as do"; $sql .= ", s.nom, s.rowid as socid, s.client"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; -$sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; +$sql .= " FROM (".MAIN_DB_PREFIX."projet as p"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = p.fk_soc"; +$sql .= ") LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = p.fk_soc"; $sql .= " WHERE 1 = 1 "; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid)