From 10ff957206940acf52f423bfc1f25046ef409d9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 May 2011 18:08:55 +0000 Subject: [PATCH] New: First add of js graph --- htdocs/societe/index.php | 50 +++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 7fd8f44f911..4e95ea291cd 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -100,26 +100,44 @@ else dol_print_error($db); print ''; print ''; -if ($conf->societe->enabled) +if ($conf->use_javascript_ajax && $conf->societe->enabled && $conf->fournisseur->enabled + && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { - if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + print ''; +} +else +{ + if ($conf->societe->enabled) { - $statstring = ""; - $statstring.= ''; - $statstring.= ""; + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + $statstring = ""; + $statstring.= ''; + $statstring.= ""; + } + if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + { + $statstring.= ""; + $statstring.= ''; + $statstring.= ""; + } } - $statstring.= ""; - $statstring.= ''; - $statstring.= ""; + if ($conf->fournisseur->enabled) + { + $statstring2 = ""; + $statstring2.= ''; + $statstring2.= ""; + } + print $statstring; + print $statstring2; } -if ($conf->fournisseur->enabled) -{ - $statstring2 = ""; - $statstring2.= ''; - $statstring2.= ""; -} -print $statstring; -print $statstring2; print '';
'.$langs->trans("Statistics").'
'; + $data=array( + array('label'=>$langs->trans("Prospects"),'values'=>array(round($third['prospect']))), + array('label'=>$langs->trans("Customers"),'values'=>array(round($third['customer']))), + array('label'=>$langs->trans("Suppliers"),'values'=>array(round($third['supplier']))) + ); + dol_print_graph('stats',300,180,$data,0,'pie'); + print '
'.$langs->trans("Prospects").''.round($third['prospect']).'
'.$langs->trans("Prospects").''.round($third['prospect']).'
'.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'.$langs->trans("UniqueThirdParties").''; print $total; print '