mode is only customer in stats fichinter
This commit is contained in:
parent
064417dcf1
commit
8ab53012b7
@ -30,7 +30,7 @@ $WIDTH=DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
|
||||
|
||||
$mode='customer';
|
||||
if ($mode == 'customer' && ! $user->rights->ficheinter->lire) accessforbidden();
|
||||
if (! $user->rights->ficheinter->lire) accessforbidden();
|
||||
|
||||
$userid=GETPOST('userid','int');
|
||||
$socid=GETPOST('socid','int');
|
||||
@ -129,14 +129,12 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenameamount = $dir.'/interventionsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstatssupplier&file=interventionsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenameamount = $dir.'/interventionsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstatssupplier&file=interventionsamountinyear-'.$year.'.png';
|
||||
$fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px2 = new DolGraph();
|
||||
@ -171,14 +169,12 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filename_avg = $dir.'/interventionsaverage-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstatssupplier&file=interventionsaverage-'.$user->id.'-'.$year.'.png';
|
||||
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filename_avg = $dir.'/interventionsaverage-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstatssupplier&file=interventionsaverage-'.$year.'.png';
|
||||
$fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px3 = new DolGraph();
|
||||
@ -221,13 +217,12 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
|
||||
$h=0;
|
||||
$head = array();
|
||||
$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php?mode='.$mode;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/fichinter/stats/index.php?mode='.$mode;
|
||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||
$head[$h][2] = 'byyear';
|
||||
$h++;
|
||||
|
||||
if ($mode == 'customer') $type='order_stats';
|
||||
if ($mode == 'supplier') $type='supplier_order_stats';
|
||||
$type='fichinter_stats';
|
||||
|
||||
complete_head_from_modules($conf,$langs,null,$head,$h,$type);
|
||||
|
||||
@ -247,7 +242,6 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
// Company
|
||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
|
||||
Loading…
Reference in New Issue
Block a user