From 4e588520bd7cacb2f1921815965167a6121f9ea9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 May 2006 14:53:06 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20restriction=20pour=20les=20commerc?= =?UTF-8?q?iaux=20et=20les=20acc=E8s=20soci=E9t=E9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal/stats/index.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 0ddb852ab9a..bdc3a79a223 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -45,8 +45,16 @@ $data = $stats->getNbByMonthWithPrevYear($year); if (! is_dir($conf->propal->dir_images)) { mkdir($conf->propal->dir_images); } -$filename = $conf->propal->dir_images."/nbpropale2year-$year.png"; -$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=nbpropale2year-'.$year.'.png'; +if (!$user->rights->commercial->client->voir || $user->societe_id) +{ + $filename = $conf->propal->dir_images.'/nbpropale2year-'.$user->id.'-'.$year.'.png'; + $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=nbpropale2year-'.$user->id.'-'.$year.'.png'; +} +else +{ + $filename = $conf->propal->dir_images.'/nbpropale2year-'.$year.'.png'; + $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=nbpropale2year'.$year.'.png'; +} $px = new BarGraph(); $mesg = $px->isGraphKo();