Skip to content

Commit

Permalink
Fix: Can't view thirdparties that are not customer nor prospect nor
Browse files Browse the repository at this point in the history
supplier.
  • Loading branch information
eldy committed Jul 15, 2015
1 parent 3ace940 commit 4d6ce2a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
14 changes: 10 additions & 4 deletions htdocs/core/lib/functions.lib.php
Expand Up @@ -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);

Expand Down Expand Up @@ -1777,10 +1778,15 @@ function plotWithOptions() {
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,
Expand Down
2 changes: 2 additions & 0 deletions htdocs/core/menus/standard/eldy.lib.php
Expand Up @@ -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))
{
Expand Down
3 changes: 2 additions & 1 deletion htdocs/societe/index.php
Expand Up @@ -146,7 +146,7 @@
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 '</td></tr>'."\n";
}
else
Expand Down Expand Up @@ -189,6 +189,7 @@
$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;
Expand Down

0 comments on commit 4d6ce2a

Please sign in to comment.