Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
This commit is contained in:
commit
9012f6ecc5
@ -30,7 +30,7 @@ $WIDTH=DolGraph::getDefaultGraphSizeForStats('width');
|
|||||||
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
|
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
|
||||||
|
|
||||||
$mode='customer';
|
$mode='customer';
|
||||||
if ($mode == 'customer' && ! $user->rights->ficheinter->lire) accessforbidden();
|
if (! $user->rights->ficheinter->lire) accessforbidden();
|
||||||
|
|
||||||
$userid=GETPOST('userid','int');
|
$userid=GETPOST('userid','int');
|
||||||
$socid=GETPOST('socid','int');
|
$socid=GETPOST('socid','int');
|
||||||
@ -49,10 +49,7 @@ $endyear=$year;
|
|||||||
|
|
||||||
$object_status=GETPOST('object_status');
|
$object_status=GETPOST('object_status');
|
||||||
|
|
||||||
$langs->load('interventions');
|
$langs->loadLangs(array('interventions', 'companies', 'other', 'suppliers'));
|
||||||
$langs->load('companies');
|
|
||||||
$langs->load('other');
|
|
||||||
$langs->load('suppliers');
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -62,11 +59,8 @@ $langs->load('suppliers');
|
|||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
$objectstatic=new FichInter($db);
|
$objectstatic=new FichInter($db);
|
||||||
|
|
||||||
if ($mode == 'customer')
|
$title=$langs->trans("InterventionStatistics");
|
||||||
{
|
$dir=$conf->ficheinter->dir_temp;
|
||||||
$title=$langs->trans("InterventionStatistics");
|
|
||||||
$dir=$conf->ficheinter->dir_temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
|
|
||||||
@ -79,19 +73,18 @@ if ($object_status != '' && $object_status > -1) $stats->where .= ' AND c.fk_sta
|
|||||||
|
|
||||||
// Build graphic number of object
|
// Build graphic number of object
|
||||||
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||||
//var_dump($data);
|
|
||||||
// $data = array(array('Lib',val1,val2,val3),...)
|
// $data = array(array('Lib',val1,val2,val3),...)
|
||||||
|
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filenamenb = $dir.'/interventionsnbinyear-'.$user->id.'-'.$year.'.png';
|
$filenamenb = $dir.'/interventionsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$user->id.'-'.$year.'.png';
|
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filenamenb = $dir.'/interventionsnbinyear-'.$year.'.png';
|
$filenamenb = $dir.'/interventionsnbinyear-'.$year.'.png';
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$year.'.png';
|
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$year.'.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
$px1 = new DolGraph();
|
$px1 = new DolGraph();
|
||||||
@ -123,20 +116,17 @@ if (! $mesg)
|
|||||||
|
|
||||||
// Build graphic amount of object
|
// Build graphic amount of object
|
||||||
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||||
//var_dump($data);
|
|
||||||
// $data = array(array('Lib',val1,val2,val3),...)
|
// $data = array(array('Lib',val1,val2,val3),...)
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filenameamount = $dir.'/interventionsamountinyear-'.$user->id.'-'.$year.'.png';
|
$filenameamount = $dir.'/interventionsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$user->id.'-'.$year.'.png';
|
$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';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filenameamount = $dir.'/interventionsamountinyear-'.$year.'.png';
|
$filenameamount = $dir.'/interventionsamountinyear-'.$year.'.png';
|
||||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$year.'.png';
|
$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';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$px2 = new DolGraph();
|
$px2 = new DolGraph();
|
||||||
@ -171,14 +161,12 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
|||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
$filename_avg = $dir.'/interventionsaverage-'.$user->id.'-'.$year.'.png';
|
$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';
|
$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';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filename_avg = $dir.'/interventionsaverage-'.$year.'.png';
|
$filename_avg = $dir.'/interventionsaverage-'.$year.'.png';
|
||||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$year.'.png';
|
$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';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$px3 = new DolGraph();
|
$px3 = new DolGraph();
|
||||||
@ -221,13 +209,12 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
|||||||
|
|
||||||
$h=0;
|
$h=0;
|
||||||
$head = array();
|
$head = array();
|
||||||
$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php?mode='.$mode;
|
$head[$h][0] = DOL_URL_ROOT . '/fichinter/stats/index.php';
|
||||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||||
$head[$h][2] = 'byyear';
|
$head[$h][2] = 'byyear';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($mode == 'customer') $type='order_stats';
|
$type = 'fichinter_stats';
|
||||||
if ($mode == 'supplier') $type='supplier_order_stats';
|
|
||||||
|
|
||||||
complete_head_from_modules($conf,$langs,null,$head,$h,$type);
|
complete_head_from_modules($conf,$langs,null,$head,$h,$type);
|
||||||
|
|
||||||
@ -246,9 +233,8 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||||
// Company
|
// Company
|
||||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
$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 $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
||||||
@ -289,7 +275,8 @@ foreach ($data as $val)
|
|||||||
{
|
{
|
||||||
$year = $val['year'];
|
$year = $val['year'];
|
||||||
while (! empty($year) && $oldyear > $year+1)
|
while (! empty($year) && $oldyear > $year+1)
|
||||||
{ // If we have empty year
|
{
|
||||||
|
// If we have empty year
|
||||||
$oldyear--;
|
$oldyear--;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].' height="24">';
|
print '<tr '.$bc[$var].' height="24">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user