From cea58d91227ca33d5a5b0574589b33279636d7a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jun 2005 21:28:56 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Zone=20des=20derniers=20clients=20sur=20?= =?UTF-8?q?la=20page=20commercial=20non=20prot=E9g=E9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/index.php | 75 ++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index d49ea34e92c..67d1b468927 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -238,46 +238,49 @@ print ''; /* - * Derniers clients enregsitrés + * Derniers clients enregistrés */ -$sql = "SELECT s.idp,s.nom,".$db->pdate("datec")." as datec"; -$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE s.client = 1"; -if ($user->societe_id > 0) +if ($user->rights->societe->lire) { - $sql .= " AND s.idp = $user->societe_id"; -} -$sql .= " ORDER BY s.datec DESC "; -$sql .= $db->plimit($max, 0); - -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - if ($num) + $sql = "SELECT s.idp,s.nom,".$db->pdate("datec")." as datec"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= " WHERE s.client = 1"; + if ($user->societe_id > 0) { - $langs->load("boxes"); - - print ''; - print ''; - print ''; - - $i = 0; - $var=false; - while ($i < $num) - { - $objp = $db->fetch_object($resql); - print ""; - print ""; - print '"; - print ''; - $i++; - $var=!$var; - - } - print "
'.$langs->trans("BoxTitleLastCustomers",$max).'
idp."\">".img_object($langs->trans("ShowCustomer"),"company")." ".$objp->nom."'.dolibarr_print_date($objp->datec)."

"; + $sql .= " AND s.idp = $user->societe_id"; + } + $sql .= " ORDER BY s.datec DESC "; + $sql .= $db->plimit($max, 0); - $db->free($resql); + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + if ($num) + { + $langs->load("boxes"); + + print ''; + print ''; + print ''; + + $i = 0; + $var=false; + while ($i < $num) + { + $objp = $db->fetch_object($resql); + print ""; + print ""; + print '"; + print ''; + $i++; + $var=!$var; + + } + print "
'.$langs->trans("BoxTitleLastCustomers",$max).'
idp."\">".img_object($langs->trans("ShowCustomer"),"company")." ".$objp->nom."'.dolibarr_print_date($objp->datec)."

"; + + $db->free($resql); + } } }