--- /tmp/dsg/dolibarr/htdocs/compta/deplacement/stats/github_index.php +++ /tmp/dsg/dolibarr/htdocs/compta/deplacement/stats/client_index.php @@ -164,38 +164,40 @@ if (!$user->rights->societe->client->voir || $user->socid) { - $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; -} else { - $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; + $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; + if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; + if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; +} +else +{ + $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; + if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; + if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; } $px3 = new DolGraph(); $mesg = $px3->isGraphKo(); if (!$mesg) { - $px3->SetData($data); - $i = $startyear; $legend = array(); - while ($i <= $endyear) - { - $legend[] = $i; - $i++; - } - $px3->SetLegend($legend); - $px3->SetYLabel($langs->trans("AmountAverage")); - $px3->SetMaxValue($px3->GetCeilMaxValue()); - $px3->SetMinValue($px3->GetFloorMinValue()); - $px3->SetWidth($WIDTH); - $px3->SetHeight($HEIGHT); - $px3->SetShading(3); - $px3->SetHorizTickIncrement(1); - $px3->mode = 'depth'; - $px3->SetTitle($langs->trans("AmountAverage")); - - $px3->draw($filename_avg, $fileurl_avg); + $px3->SetData($data); + $i = $startyear; $legend = array(); + while ($i <= $endyear) + { + $legend[] = $i; + $i++; + } + $px3->SetLegend($legend); + $px3->SetYLabel($langs->trans("AmountAverage")); + $px3->SetMaxValue($px3->GetCeilMaxValue()); + $px3->SetMinValue($px3->GetFloorMinValue()); + $px3->SetWidth($WIDTH); + $px3->SetHeight($HEIGHT); + $px3->SetShading(3); + $px3->SetHorizTickIncrement(1); + $px3->mode = 'depth'; + $px3->SetTitle($langs->trans("AmountAverage")); + + $px3->draw($filename_avg, $fileurl_avg); } @@ -203,7 +205,7 @@ $data = $stats->getAllByYear(); $arrayyears = array(); foreach ($data as $val) { - $arrayyears[$val['year']] = $val['year']; + $arrayyears[$val['year']] = $val['year']; } if (!count($arrayyears)) $arrayyears[$nowyear] = $nowyear; @@ -217,7 +219,7 @@ complete_head_from_modules($conf, $langs, null, $head, $h, 'trip_stats'); -print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); +dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
';
-if ($mesg) { print $mesg; } else {
- print $px1->show();
+if ($mesg) { print $mesg; }
+else {
+ print $px1->show();
print " \n"; print $px2->show(); - print " \n"; - print $px3->show(); + print " \n"; + print $px3->show(); } print ' |