Fix: better with json_encode for use string for cols and rows name
This commit is contained in:
parent
666e850d72
commit
3c7c220bad
@ -154,13 +154,14 @@ if ($conf->use_javascript_ajax)
|
|||||||
$SommeD=0;
|
$SommeD=0;
|
||||||
$dataval=array();
|
$dataval=array();
|
||||||
$datalabels=array();
|
$datalabels=array();
|
||||||
|
$i=1;
|
||||||
foreach ($AdherentType as $key => $adhtype)
|
foreach ($AdherentType as $key => $adhtype)
|
||||||
{
|
{
|
||||||
$datalabels[]=$adhtype->getNomUrl(0,dol_size(16));
|
$datalabels[]=array($i,$adhtype->getNomUrl(0,dol_size(16)));
|
||||||
$dataval['draft'][]=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
$dataval['draft'][]=array($i,isset($MemberToValidate[$key])?$MemberToValidate[$key]:0);
|
||||||
$dataval['notuptodate'][]=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0;
|
$dataval['notuptodate'][]=array($i,isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0);
|
||||||
$dataval['uptodate'][]=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
$dataval['uptodate'][]=array($i,isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0);
|
||||||
$dataval['resiliated'][]=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
$dataval['resiliated'][]=array($i,isset($MembersResiliated[$key])?$MembersResiliated[$key]:0);
|
||||||
$SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
$SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
||||||
$SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0;
|
$SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0;
|
||||||
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
||||||
@ -169,19 +170,19 @@ if ($conf->use_javascript_ajax)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
$dataseries=array();
|
$dataseries=array();
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=> $dataval['draft']);
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'data'=> $dataval['draft']);
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=> $dataval['notuptodate']);
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'data'=> $dataval['notuptodate']);
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=> $dataval['uptodate']);
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'data'=> $dataval['uptodate']);
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=> $dataval['resiliated']);
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'data'=> $dataval['resiliated']);
|
||||||
$data=array('series'=>$dataseries,'seriestype'=>array('bar','bar','bar','bar'),'xlabel'=>$datalabels);
|
$data=array('series'=>$dataseries,'seriestype'=>array('bar','bar','bar','bar'),'xlabel'=>$datalabels);
|
||||||
dol_print_graph('stats2',300,180,$data,1,'barline');
|
dol_print_graph('stats2',300,180,$data,1,'barline');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$dataseries=array();
|
$dataseries=array();
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=>array(round($SommeB)));
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'data'=>round($SommeB));
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=>array(round($SommeC)));
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'data'=>round($SommeC));
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=>array(round($SommeD)));
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'data'=>round($SommeD));
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=>array(round($SommeA)));
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'data'=>round($SommeA));
|
||||||
$data=array('series'=>$dataseries);
|
$data=array('series'=>$dataseries);
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -121,7 +121,7 @@ if ($resql)
|
|||||||
$listofstatus=array(0,1,2,3,4);
|
$listofstatus=array(0,1,2,3,4);
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$propalstatic->LibStatut($status,1),'values'=>array(0=>(isset($vals[$status])?$vals[$status]:0)));
|
$dataseries[]=array('label'=>$propalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?$vals[$status]:0));
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|||||||
@ -121,7 +121,7 @@ if ($resql)
|
|||||||
$bool=false;
|
$bool=false;
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$commandestatic->LibStatut($status,$bool,1),'values'=>array(0=>(isset($vals[$status.$bool])?$vals[$status.$bool]:0)));
|
$dataseries[]=array('label'=>$commandestatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?$vals[$status.$bool]:0));
|
||||||
if ($status==3 && $bool==false) $bool=true;
|
if ($status==3 && $bool==false) $bool=true;
|
||||||
else $bool=false;
|
else $bool=false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,7 +105,7 @@ print "</tr>\n";
|
|||||||
$listoftype=$tripandexpense_static->listOfTypes();
|
$listoftype=$tripandexpense_static->listOfTypes();
|
||||||
foreach ($listoftype as $code => $label)
|
foreach ($listoftype as $code => $label)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$label,'values'=>array(0=>(isset($nb[$code])?$nb[$code]:0)));
|
$dataseries[]=array('label'=>$label,'data'=>(isset($nb[$code])?$nb[$code]:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
|
|||||||
@ -87,7 +87,7 @@ print "</tr>\n";
|
|||||||
$listofstatus=array(0,1,-1,2);
|
$listofstatus=array(0,1,-1,2);
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$donstatic->LibStatut($status,1),'values'=>array(0=>(isset($nb[$status])?$nb[$status]:0)));
|
$dataseries[]=array('label'=>$donstatic->LibStatut($status,1),'data'=>(isset($nb[$status])?$nb[$status]:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
|
|||||||
@ -180,7 +180,7 @@ $var=true;
|
|||||||
$listofstatus=array(0,4,4,5); $bool=false;
|
$listofstatus=array(0,4,4,5); $bool=false;
|
||||||
foreach($listofstatus as $status)
|
foreach($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$staticcontratligne->LibStatut($status,1,($bool?1:0)),'values'=>array(0=>($nb[$status.$bool]?$nb[$status.$bool]:0)));
|
$dataseries[]=array('label'=>$staticcontratligne->LibStatut($status,1,($bool?1:0)),'data'=>($nb[$status.$bool]?$nb[$status.$bool]:0));
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|||||||
@ -1500,213 +1500,161 @@ function dolibarr_trunc($string,$size=40,$trunc='right',$stringencoding='')
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a javascript graph
|
* Show a javascript graph
|
||||||
* @param htmlid Html id name
|
*
|
||||||
* @param width Width in pixel
|
* @param string $htmlid Html id name
|
||||||
* @param height Height in pixel
|
* @param int $width Width in pixel
|
||||||
* @param data Data array
|
* @param int $height Height in pixel
|
||||||
* @param showlegend 1 to show legend, 0 otherwise
|
* @param array $data Data array
|
||||||
* @param type Type of graph ('pie', 'barline')
|
* @param int $showlegend 1 to show legend, 0 otherwise
|
||||||
* @param showpercent Show percent (with type='pie' only)
|
* @param string $type Type of graph ('pie', 'barline')
|
||||||
* @param url Param to add an url to click values
|
* @param int $showpercent Show percent (with type='pie' only)
|
||||||
|
* @param string $url Param to add an url to click values
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie',$showpercent=0,$url='')
|
function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie',$showpercent=0,$url='')
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
global $theme_datacolor; // To have var kept when function is called several times
|
global $theme_datacolor; // To have var kept when function is called several times
|
||||||
if (empty($conf->use_javascript_ajax)) return;
|
if (empty($conf->use_javascript_ajax)) return;
|
||||||
$jsgraphlib='flot';
|
$jsgraphlib='flot';
|
||||||
$datacolor=array();
|
$datacolor=array();
|
||||||
|
|
||||||
// Load colors of theme into $datacolor array
|
// Load colors of theme into $datacolor array
|
||||||
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
||||||
if (is_readable($color_file))
|
if (is_readable($color_file))
|
||||||
{
|
{
|
||||||
include_once($color_file);
|
include_once($color_file);
|
||||||
if (isset($theme_datacolor))
|
if (isset($theme_datacolor))
|
||||||
{
|
{
|
||||||
$datacolor=array();
|
$datacolor=array();
|
||||||
foreach($theme_datacolor as $val)
|
foreach($theme_datacolor as $val)
|
||||||
{
|
{
|
||||||
$datacolor[]="#".sprintf("%02x",$val[0]).sprintf("%02x",$val[1]).sprintf("%02x",$val[2]);
|
$datacolor[]="#".sprintf("%02x",$val[0]).sprintf("%02x",$val[1]).sprintf("%02x",$val[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<div id="'.$htmlid.'" style="width:'.$width.'px;height:'.$height.'px;"></div>';
|
print '<div id="'.$htmlid.'" style="width:'.$width.'px;height:'.$height.'px;"></div>';
|
||||||
|
|
||||||
// We use Flot js lib
|
// We use Flot js lib
|
||||||
if ($jsgraphlib == 'flot')
|
if ($jsgraphlib == 'flot')
|
||||||
{
|
{
|
||||||
if ($type == 'pie')
|
if ($type == 'pie')
|
||||||
{
|
{
|
||||||
// data is array('series'=>array(serie1,serie2,...),
|
// data is array('series'=>array(serie1,serie2,...),
|
||||||
// 'seriestype'=>array('bar','line',...),
|
// 'seriestype'=>array('bar','line',...),
|
||||||
// 'seriescolor'=>array(0=>'#999999',1=>'#999999',...)
|
// 'seriescolor'=>array(0=>'#999999',1=>'#999999',...)
|
||||||
// 'xlabel'=>array(0=>labelx1,1=>labelx2,...));
|
// 'xlabel'=>array(0=>labelx1,1=>labelx2,...));
|
||||||
// serieX is array('label'=>'label', values=>array(0=>val))
|
// serieX is array('label'=>'label', data=>val)
|
||||||
print '
|
print '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(function () {
|
$(function () {
|
||||||
var data = ['."\n";
|
var data = '.json_encode($data['series']).';
|
||||||
$i=0;
|
|
||||||
foreach($data['series'] as $serie)
|
function plotWithOptions() {
|
||||||
{
|
$.plot($("#'.$htmlid.'"), data,
|
||||||
//print '{ label: "'.($showlegend?$serie['values'][0]:$serie['label'].'<br>'.$serie['values'][0]).'", data: '.$serie['values'][0].' }';
|
{
|
||||||
print '{ label: "'.dol_escape_js($serie['label']).'", data: '.$serie['values'][0].' }';
|
series: {
|
||||||
if ($i < count($data['series'])) print ',';
|
pie: {
|
||||||
print "\n";
|
show: true,
|
||||||
$i++;
|
radius: 3/4,
|
||||||
}
|
label: {
|
||||||
print '];
|
show: true,
|
||||||
|
radius: 3/4,
|
||||||
function plotWithOptions() {
|
formatter: function(label, series) {
|
||||||
jQuery.plot(jQuery("#'.$htmlid.'"), data,
|
var percent=Math.round(series.percent);
|
||||||
{
|
var number=series.data[0][1];
|
||||||
series: {
|
return \'';
|
||||||
pie: {
|
print '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">';
|
||||||
show: true,
|
if ($url) print '<a style="color: #FFFFFF;" border="0" href="'.$url.'=">';
|
||||||
radius: 3/4,
|
print '\'+'.($showlegend?'number':'label+\'<br/>\'+number');
|
||||||
label: {
|
if (! empty($showpercent)) print '+\'<br/>\'+percent+\'%\'';
|
||||||
show: true,
|
print '+\'';
|
||||||
radius: 3/4,
|
if ($url) print '</a>';
|
||||||
formatter: function(label, series) {
|
print '</div>\';
|
||||||
var percent=Math.round(series.percent);
|
},
|
||||||
var number=series.data[0][1];
|
background: {
|
||||||
return \'';
|
opacity: 0.5,
|
||||||
print '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">';
|
color: \'#000000\'
|
||||||
if ($url) print '<a style="color: #FFFFFF;" border="0" href="'.$url.'=">';
|
}
|
||||||
print '\'+'.($showlegend?'number':'label+\'<br/>\'+number');
|
}
|
||||||
if (! empty($showpercent)) print '+\'<br/>\'+percent+\'%\'';
|
}
|
||||||
print '+\'';
|
},
|
||||||
if ($url) print '</a>';
|
zoom: {
|
||||||
print '</div>\';
|
interactive: true
|
||||||
},
|
},
|
||||||
background: {
|
pan: {
|
||||||
opacity: 0.5,
|
interactive: true
|
||||||
color: \'#000000\'
|
},';
|
||||||
}
|
if (count($datacolor))
|
||||||
}
|
{
|
||||||
} },
|
print 'colors: '.(! empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor)).',';
|
||||||
zoom: {
|
}
|
||||||
interactive: true
|
print 'legend: {show: '.($showlegend?'true':'false').', position: \'ne\' }
|
||||||
},
|
});
|
||||||
pan: {
|
}
|
||||||
interactive: true
|
plotWithOptions();
|
||||||
},
|
});
|
||||||
';
|
</script>';
|
||||||
$i=0; $outputserie=0;
|
}
|
||||||
if (count($datacolor))
|
else if ($type == 'barline')
|
||||||
{
|
{
|
||||||
print 'colors: [';
|
// data is array('series'=>array(serie1,serie2,...),
|
||||||
foreach($datacolor as $val)
|
// 'seriestype'=>array('bar','line',...),
|
||||||
{
|
// 'seriescolor'=>array(0=>'#999999',1=>'#999999',...)
|
||||||
if ($outputserie > 0) print ',';
|
// 'xlabel'=>array(1=>labelx1,2=>labelx2,...));
|
||||||
print '"'.(empty($data['seriescolor'][$i])?$val:$data['seriescolor'][$i]).'"';
|
// serieX is array('label'=>'label', data=>array(1=>y1,2=>y2,...)) with same nb of value than into xlabel
|
||||||
$outputserie++;
|
print '
|
||||||
$i++;
|
<script type="text/javascript">
|
||||||
}
|
$(function () {
|
||||||
print '], ';
|
var data = [';
|
||||||
}
|
$i=0; $outputserie=0;
|
||||||
print 'legend: {show: '.($showlegend?'true':'false').', position: \'ne\' }
|
foreach($data['series'] as $serie)
|
||||||
});
|
{
|
||||||
}
|
if ($data['seriestype'][$i]=='line') { $i++; continue; };
|
||||||
plotWithOptions();
|
if ($outputserie > 0) print ',';
|
||||||
});
|
print '{ bars: { stack: 0, show: true, barWidth: 0.9, align: \'center\' }, label: \''.dol_escape_js($serie['label']).'\', data: '.json_encode($serie['data']).'}'."\n";
|
||||||
</script>';
|
$outputserie++; $i++;
|
||||||
}
|
}
|
||||||
else if ($type == 'barline')
|
if ($outputserie) print ', ';
|
||||||
{
|
//print '];
|
||||||
// data is array('series'=>array(serie1,serie2,...),
|
//var datalines = [';
|
||||||
// 'seriestype'=>array('bar','line',...),
|
$i=0; $outputserie=0;
|
||||||
// 'seriescolor'=>array(0=>'#999999',1=>'#999999',...)
|
foreach($data['series'] as $serie)
|
||||||
// 'xlabel'=>array(0=>labelx1,1=>labelx2,...));
|
{
|
||||||
// serieX is array('label'=>'label', values=>array(0=>y1,1=>y2,...)) with same nb of value than into xlabel
|
if (empty($data['seriestype'][$i]) || $data['seriestype'][$i]=='bar') { $i++; continue; };
|
||||||
print '
|
if ($outputserie > 0) print ',';
|
||||||
<script type="text/javascript">
|
print '{ lines: { show: true }, label: \''.dol_escape_js($serie['label']).'\', data: '.json_encode($serie['data']).'}'."\n";
|
||||||
jQuery(function () {
|
$outputserie++; $i++;
|
||||||
var data = [';
|
}
|
||||||
$i=1; $outputserie=0;
|
print '];
|
||||||
foreach($data['series'] as $serie)
|
var dataticks = '.json_encode($data['xlabel']).'
|
||||||
{
|
|
||||||
if ($data['seriestype'][$i-1]=='line') { $i++; continue; };
|
function plotWithOptions() {
|
||||||
if ($outputserie > 0) print ',';
|
$.plot(jQuery("#'.$htmlid.'"), data,
|
||||||
print '{ bars: { stack: 0, show: true, barWidth: 0.9, align: \'center\' }, label: \''.dol_escape_js($serie['label']).'\', data: [';
|
{
|
||||||
$j=1;
|
series: {
|
||||||
foreach($serie['values'] as $val)
|
stack: 0
|
||||||
{
|
},
|
||||||
print '['.$j.','.$val.']';
|
zoom: {
|
||||||
if ($j < count($serie['values'])) print ', ';
|
interactive: true
|
||||||
$j++;
|
},
|
||||||
}
|
pan: {
|
||||||
print ']}'."\n";
|
interactive: true
|
||||||
$outputserie++;
|
},';
|
||||||
$i++;
|
if (count($datacolor))
|
||||||
}
|
{
|
||||||
if ($outputserie) print ', ';
|
print 'colors: '.json_encode($datacolor).',';
|
||||||
//print '];
|
}
|
||||||
//var datalines = [';
|
print 'legend: {show: '.($showlegend?'true':'false').'},
|
||||||
$i=1; $outputserie=0;
|
xaxis: {ticks: dataticks}
|
||||||
foreach($data['series'] as $serie)
|
});
|
||||||
{
|
}
|
||||||
if (empty($data['seriestype'][$i-1]) || $data['seriestype'][$i-1]=='bar') { $i++; continue; };
|
plotWithOptions();
|
||||||
if ($outputserie > 0) print ',';
|
});
|
||||||
print '{ lines: { show: true }, label: \''.dol_escape_js($serie['label']).'\', data: [';
|
</script>';
|
||||||
$j=1;
|
}
|
||||||
foreach($serie['values'] as $val)
|
else print 'BadValueForPArameterType';
|
||||||
{
|
}
|
||||||
print '['.$j.','.$val.']';
|
|
||||||
if ($j < count($serie['values'])) print ', ';
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
print ']}'."\n";
|
|
||||||
$outputserie++;
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print '];
|
|
||||||
var dataticks = [';
|
|
||||||
$i=1;
|
|
||||||
foreach($data['xlabel'] as $label)
|
|
||||||
{
|
|
||||||
print '['.$i.',\''.$label.'\']';
|
|
||||||
if ($i < count($data['xlabel'])) print ',';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print '];
|
|
||||||
|
|
||||||
function plotWithOptions() {
|
|
||||||
jQuery.plot(jQuery("#'.$htmlid.'"), data,
|
|
||||||
{
|
|
||||||
series: {
|
|
||||||
stack: 0
|
|
||||||
},
|
|
||||||
zoom: {
|
|
||||||
interactive: true
|
|
||||||
},
|
|
||||||
pan: {
|
|
||||||
interactive: true
|
|
||||||
},
|
|
||||||
';
|
|
||||||
if (count($datacolor))
|
|
||||||
{
|
|
||||||
print 'colors: [';
|
|
||||||
$j=0;
|
|
||||||
foreach($datacolor as $val)
|
|
||||||
{
|
|
||||||
print '"'.$val.'"';
|
|
||||||
if ($j < count($datacolor)) print ',';
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
print '], ';
|
|
||||||
}
|
|
||||||
print 'legend: {show: '.($showlegend?'true':'false').'},
|
|
||||||
xaxis: {ticks: dataticks},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
plotWithOptions();
|
|
||||||
});
|
|
||||||
</script>';
|
|
||||||
}
|
|
||||||
else print 'BadValueForPArameterType';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -118,7 +118,7 @@ if ($resql)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
foreach (array(0,1,2,3,4,5,6) as $statut)
|
foreach (array(0,1,2,3,4,5,6) as $statut)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$commandestatic->LibStatut($statut,1),'values'=>array(0=>(isset($vals[$statut])?$vals[$statut]:0)));
|
$dataseries[]=array('label'=>$commandestatic->LibStatut($statut,1),'data'=>(isset($vals[$statut])?$vals[$statut]:0));
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|||||||
@ -108,9 +108,9 @@ if ($conf->use_javascript_ajax && ((round($third['prospect'])?1:0)+(round($third
|
|||||||
{
|
{
|
||||||
print '<tr><td align="center">';
|
print '<tr><td align="center">';
|
||||||
$dataseries=array();
|
$dataseries=array();
|
||||||
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'values'=>array(round($third['prospect'])));
|
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect']));
|
||||||
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'values'=>array(round($third['customer'])));
|
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer']));
|
||||||
if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'values'=>array(round($third['supplier'])));
|
if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier']));
|
||||||
$data=array('series'=>$dataseries);
|
$data=array('series'=>$dataseries);
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',0);
|
dol_print_graph('stats',300,180,$data,1,'pie',0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user