diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 0973de848b5..c2e232fcec0 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -69,7 +69,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele { $listofsearchfields['search_contact']=array('text'=>'Contact'); } - + if (count($listofsearchfields)) { print '
'; print '| '.$langs->trans("Statistics").' | |
|---|---|
| '; + print ' | |
| '; $dataseries=array(); - if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect'])); - if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer'])); - if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && 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,'',0); + if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array($langs->trans("Prospects"), round($third['prospect'])); + if (! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array($langs->trans("Customers"), round($third['customer'])); + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array($langs->trans("Suppliers"), round($third['supplier'])); + if (! empty($conf->societe->enabled)) $dataseries[]=array($langs->trans("Others"), round($third['other'])); + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + $dolgraph = new DolGraph(); + $dolgraph->SetData($dataseries); + $dolgraph->setShowLegend(1); + $dolgraph->setShowPercent(1); + $dolgraph->SetType(array('pie')); + $dolgraph->setWidth('100%'); + $dolgraph->draw('idgraphthirdparties'); + print $dolgraph->show(); print ' | |
| '.$langs->trans("Prospects").' | '.round($third['prospect']).' | '; $statstring.= "
| '.$langs->trans("Customers").' | '.round($third['customer']).' | '; $statstring.= "
| '.$langs->trans("Suppliers").' | '.round($third['supplier']).' | '; $statstring2.= "
| '.$obj->label.' | '.$obj->nb.' | '.$langs->trans('Status').' | '; print ''."\n"; - $var=True; - while ($i < $num) { $objp = $db->fetch_object($result); - - print '
| '; $thirdparty_static->id=$objp->rowid; $thirdparty_static->name=$objp->name; $thirdparty_static->client=$objp->client; @@ -295,6 +308,10 @@ if ($result) $thirdparty_static->code_client = $objp->code_client; $thirdparty_static->code_fournisseur = $objp->code_fournisseur; $thirdparty_static->canvas=$objp->canvas; + + print ' | |
| '; print $thirdparty_static->getNomUrl(1); print " | \n"; // Type|