Ajout de restriction pour les commerciaux et les accès sociétés
This commit is contained in:
parent
4a5acbf87b
commit
489be5ef26
@ -64,9 +64,16 @@ if (! file_exists($dir))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$user->rights->commercial->client->voir || $user->societe_id)
|
||||||
$filename = $conf->commande->dir_images."/nbcommande2year-".$year.".png";
|
{
|
||||||
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=nbcommande2year-'.$year.'.png';
|
$filename = $conf->commande->dir_images.'/nbcommande2year-'.$user->id.'-'.$year.'.png';
|
||||||
|
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=nbcommande2year-'.$user->id.'-'.$year.'.png';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$filename = $conf->commande->dir_images.'/nbcommande2year-'.$year.'.png';
|
||||||
|
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=nbcommande2year-'.$year.'.png';
|
||||||
|
}
|
||||||
|
|
||||||
$px = new BarGraph();
|
$px = new BarGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
|
|||||||
@ -64,8 +64,16 @@ $data = $stats->getNbByMonth($year);
|
|||||||
|
|
||||||
if (! is_dir($conf->commande->dir_images)) { mkdir($conf->commande->dir_images); }
|
if (! is_dir($conf->commande->dir_images)) { mkdir($conf->commande->dir_images); }
|
||||||
|
|
||||||
$filename = $conf->commande->dir_images."/commande".$year.".png";
|
if (!$user->rights->commercial->client->voir || $user->societe_id)
|
||||||
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commande'.$year.'.png';
|
{
|
||||||
|
$filename = $conf->commande->dir_images.'/commande-'.$user->id.'-'.$year.'.png';
|
||||||
|
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commande-'.$user->id.'-'.$year.'.png';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$filename = $conf->commande->dir_images.'/commande'.$year.'.png';
|
||||||
|
$fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commande'.$year.'.png';
|
||||||
|
}
|
||||||
|
|
||||||
$px = new BarGraph();
|
$px = new BarGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
@ -87,8 +95,16 @@ for ($i = 1 ; $i < 13 ; $i++)
|
|||||||
$data[$i-1] = array(ucfirst(substr(strftime("%b",mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]);
|
$data[$i-1] = array(ucfirst(substr(strftime("%b",mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename_amount = $conf->commande->dir_images."/commandeamount".$year.".png";
|
if (!$user->rights->commercial->client->voir || $user->societe_id)
|
||||||
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commandeamount'.$year.'.png';
|
{
|
||||||
|
$filename_amount = $conf->commande->dir_images.'/commandeamount-'.$user->id.'-'.$year.'.png';
|
||||||
|
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commandeamount-'.$user->id.'-'.$year.'.png';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$filename_amount = $conf->commande->dir_images.'/commandeamount'.$year.'.png';
|
||||||
|
$fileurl_amount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commandeamount'.$year.'.png';
|
||||||
|
}
|
||||||
|
|
||||||
$px = new BarGraph();
|
$px = new BarGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
@ -109,8 +125,16 @@ for ($i = 1 ; $i < 13 ; $i++)
|
|||||||
$data[$i-1] = array(ucfirst(substr(strftime("%b",mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]);
|
$data[$i-1] = array(ucfirst(substr(strftime("%b",mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename_avg = $conf->commande->dir_images."/commandeaverage".$year.".png";
|
if (!$user->rights->commercial->client->voir || $user->societe_id)
|
||||||
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commandeaverage'.$year.'.png';
|
{
|
||||||
|
$filename_avg = $conf->commande->dir_images.'/commandeaverage-'.$user->id.'-'.$year.'.png';
|
||||||
|
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commandeaverage-'.$user->id.'-'.$year.'.png';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$filename_avg = $conf->commande->dir_images.'/commandeaverage'.$year.'.png';
|
||||||
|
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=commandeaverage'.$year.'.png';
|
||||||
|
}
|
||||||
|
|
||||||
$px = new BarGraph();
|
$px = new BarGraph();
|
||||||
$mesg = $px->isGraphKo();
|
$mesg = $px->isGraphKo();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user