diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8b9ca77f6a9..1ff5509528c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1725,11 +1725,12 @@ function dol_substr($string,$start,$length,$stringencoding='') * @param string $type Type of graph ('pie', 'barline') * @param int $showpercent Show percent (with type='pie' only) * @param string $url Param to add an url to click values + * @param int $combineother 0=No combine, 0.05=Combine if lower than 5% * @return void * @deprecated * @see DolGraph */ -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='',$combineother=0.05) { dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); @@ -1777,10 +1778,15 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie', series: { pie: { show: true, - radius: 0.8, + radius: 0.8,'; + if ($combineother) + { + print ' combine: { - threshold: 0.05 - }, + threshold: '.$combineother.' + },'; + } + print ' label: { show: true, radius: 0.9, diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 5a6eee1184a..606b8ce430d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -584,6 +584,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } } + $newmenu->add("/societe/list.php?leftmenu=thirdparties", $langs->trans("List"),1); + // Prospects if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 12de6db7707..efc669ddd78 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -146,7 +146,7 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier'])); if (! empty($conf->societe->enabled)) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other'])); $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',0); + dol_print_graph('stats',300,180,$data,1,'pie',0,'',0); print ''."\n"; } else @@ -189,6 +189,7 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS $sql.= " FROM ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; $sql.= " WHERE c.type = 2"; + if (! is_numeric($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) $sql.= " AND c.label like '".$db->escape($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)."'"; $sql.= " AND c.entity IN (".getEntity('category',1).")"; $sql.= " GROUP BY c.label"; $total=0;