diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 001f6132e95..a04b1df5786 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -165,12 +165,13 @@ if ($conf->use_javascript_ajax) print '
'; print ''; print ''; - print ''; print '\n"; $listofstatus=array(0,1,-1,2); foreach ($listofstatus as $status) { - $dataseries[]=array('label'=>$donstatic->LibStatut($status,1),'data'=>(isset($nb[$status])?(int) $nb[$status]:0)); + $dataseries[]=array($donstatic->LibStatut($status,1), (isset($nb[$status])?(int) $nb[$status]:0)); } if ($conf->use_javascript_ajax) { - print ''; } @@ -141,7 +153,7 @@ $totalnb=0; $var=true; foreach ($listofstatus as $status) { - + print ''; print ''; print ''; @@ -191,7 +203,7 @@ if ($resql) $var = True; while ($i < $num) { - + $obj = $db->fetch_object($resql); print ''; diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 0d9bcd20577..77db05da49a 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -118,14 +118,23 @@ print "\n"; $listoftype=$tripandexpense_static->listOfTypes(); foreach ($listoftype as $code => $label) { - $dataseries[]=array('label'=>$label,'data'=>(isset($somme[$code])?(int) $somme[$code]:0)); + $dataseries[]=array($label, (isset($somme[$code])?(int) $somme[$code]:0)); } if ($conf->use_javascript_ajax) { - print ''; } @@ -208,7 +217,7 @@ if ($result) print $expensereportstatic->LibStatut($obj->fk_status,3); print ''; print ''; - + $i++; } diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 53116dae843..d7cae075eb1 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Charlie Benke - + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,15 +121,25 @@ if ($resql) $bool=false; foreach ($listofstatus as $status) { - $dataseries[]=array('label'=>$fichinterstatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); + $dataseries[]=array($fichinterstatic->LibStatut($status,$bool,1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); if ($status==3 && ! $bool) $bool=true; else $bool=false; } if ($conf->use_javascript_ajax) { print ''; } $var=true; @@ -138,7 +148,7 @@ if ($resql) { if (! $conf->use_javascript_ajax) { - + print ''; print ''; print ''; print ''; @@ -311,7 +321,7 @@ if (! empty($conf->ficheinter->enabled)) $var = true; while ($i < $num) { - + $obj = $db->fetch_object($resql); print ''; print '\n"; foreach (array(0,1,2,3,4,5,6) as $statut) { - $dataseries[]=array('label'=>$commandestatic->LibStatut($statut,1),'data'=>(isset($vals[$statut])?(int) $vals[$statut]:0)); + $dataseries[]=array($commandestatic->LibStatut($statut,1), (isset($vals[$statut])?(int) $vals[$statut]:0)); if (! $conf->use_javascript_ajax) { - + print ''; print ''; print ''; @@ -129,8 +129,17 @@ if ($resql) if ($conf->use_javascript_ajax) { print ''; } //if ($totalinprocess != $total) @@ -177,7 +186,7 @@ if ($resql) while ($i < $num) { $row = $db->fetch_row($resql); - + print ''; print ''; @@ -225,7 +234,7 @@ if (! empty($conf->fournisseur->enabled)) $var = True; while ($i < $num) { - + $obj = $db->fetch_object($resql); print ''; print ''; print ''; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 3e29bf4e041..6eebc4d85e2 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -221,25 +221,38 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS { $obj = $db->fetch_object($result); if ($i < $nbmax) - $dataseries[]=array('label'=>$obj->label,'data'=>round($obj->nb)); + { + $dataseries[]=array($obj->label, round($obj->nb)); + } else + { $rest+=$obj->nb; + } $total+=$obj->nb; $i++; } if ($i > $nbmax) - $dataseries[]=array('label'=>$langs->trans("Other"),'data'=>round($rest)); - $data=array('series'=>$dataseries); - dol_print_graph('statscategproduct',300,180,$data,1,'pie',0); + { + $dataseries[]=array($langs->trans("Other"), round($rest)); + } + + 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('idstatscategproduct'); + print $dolgraph->show($total?0:1); } else { - $var=true; while ($i < $num) { $obj = $db->fetch_object($result); - print ''; + print ''; $total+=$obj->nb; $i++; } diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 60b0ffa0809..8c919b5d213 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -52,7 +52,6 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print '
'; print '
'.$langs->trans("Statistics").'
'; + print '
'; $SommeA=0; $SommeB=0; $SommeC=0; $SommeD=0; + $total=0; $dataval=array(); $datalabels=array(); $i=0; @@ -187,14 +188,23 @@ if ($conf->use_javascript_ajax) $SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0; $i++; } - + $total = $SommeA + $SommeB + $SommeC + $SommeD; $dataseries=array(); - $dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'data'=>round($SommeB)); - $dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'data'=>round($SommeC)); - $dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'data'=>round($SommeD)); - $dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'data'=>round($SommeA)); - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1); + $dataseries[]=array($langs->trans("MenuMembersNotUpToDate"), round($SommeB)); + $dataseries[]=array($langs->trans("MenuMembersUpToDate"), round($SommeC)); + $dataseries[]=array($langs->trans("MembersStatusResiliated"), round($SommeD)); + $dataseries[]=array($langs->trans("MembersStatusToValid"), round($SommeA)); + + 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('idgraphstatus'); + print $dolgraph->show($total?0:1); + print '
'.$langs->trans("Total").''; print $SommeA+$SommeB+$SommeC+$SommeD; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index a54ceb32f0b..42a7bb4b448 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -61,7 +61,6 @@ print '
'; if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo { - $var=false; print '
'; print ''; print ''; @@ -115,14 +114,13 @@ if ($resql) print '
'; print ''."\n"; - $var=true; $listofstatus=array(0,1,2,3,4); foreach ($listofstatus as $status) { - $dataseries[]=array('label'=>$propalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0)); + $dataseries[]=array($propalstatic->LibStatut($status,1), (isset($vals[$status])?(int) $vals[$status]:0)); if (! $conf->use_javascript_ajax) { - + print ''; print ''; print ''; @@ -131,9 +129,18 @@ if ($resql) } if ($conf->use_javascript_ajax) { - print ''; } //if ($totalinprocess != $total) @@ -173,10 +180,8 @@ if (! empty($conf->propal->enabled)) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; @@ -233,10 +238,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; @@ -308,8 +311,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $i = 0; if ($num > 0) { - $var=true; - print '
'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'
'.$propalstatic->LibStatut($status,0).''.(isset($vals[$status])?$vals[$status]:0).'
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1); + print '
'; + + 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($total?0:1); + print '
'; print ''; @@ -317,7 +318,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) while ($i < $nbofloop) { $obj = $db->fetch_object($result); - + print ''; // Ref @@ -402,10 +403,9 @@ if (! empty($conf->propal->enabled)) if ($num) { $i = 0; - $var = True; while ($i < $num) { - + $obj = $db->fetch_object($resql); print ''; print ''; print '
'.$langs->trans("ProposalsOpened").' '.$num.'
'; @@ -474,10 +474,9 @@ if (! empty($conf->propal->enabled)) if ($num) { $i = 0; - $var = True; while ($i < $num) { - + $obj = $db->fetch_object($resql); print '
'; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 1a694336714..feacdd70b07 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -79,7 +79,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele * Statistics */ -$sql = "SELECT count(c.rowid), c.fk_statut, c.facture"; +$sql = "SELECT count(c.rowid), c.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."commande as c"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -87,7 +87,8 @@ $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity IN (".getEntity('societe').")"; if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -$sql.= " GROUP BY c.fk_statut, c.facture"; +$sql.= " GROUP BY c.fk_statut"; + $resql = $db->query($sql); if ($resql) { @@ -98,7 +99,6 @@ if ($resql) $totalinprocess=0; $dataseries=array(); $vals=array(); - $bool=false; // -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not) while ($i < $num) { @@ -107,8 +107,7 @@ if ($resql) { //if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1)) { - $bool=(! empty($row[2])?true:false); - if (! isset($vals[$row[1].$bool])) $vals[$row[1].$bool]=0; + if (! isset($vals[$row[1]])) $vals[$row[1]]=0; $vals[$row[1].$bool]+=$row[0]; $totalinprocess+=$row[0]; } @@ -119,37 +118,38 @@ if ($resql) $db->free($resql); print ''; print ''."\n"; - $listofstatus=array(0,1,2,3,3,-1); - $bool=false; + $listofstatus=array(0,1,2,3,-1); foreach ($listofstatus as $status) { - $dataseries[]=array('label'=>$commandestatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); - if ($status==3 && ! $bool) $bool=true; - else $bool=false; + $dataseries[]=array($commandestatic->LibStatut($status,$bool,1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); } if ($conf->use_javascript_ajax) { print ''; } - $var=true; - $bool=false; - foreach ($listofstatus as $status) + else { - if (! $conf->use_javascript_ajax) - { - - print ''; + foreach ($listofstatus as $status) + { + print ''; print ''; print ''; print "\n"; - if ($status==3 && ! $bool) $bool=true; - else $bool=false; } } //if ($totalinprocess != $total) diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index fdb7e46900c..2cd3823bacd 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -106,14 +106,23 @@ print "\n"; $listoftype=$tripandexpense_static->listOfTypes(); foreach ($listoftype as $code => $label) { - $dataseries[]=array('label'=>$label,'data'=>(isset($nb[$code])?(int) $nb[$code]:0)); + $dataseries[]=array($label, (isset($nb[$code])?(int) $nb[$code]:0)); } if ($conf->use_javascript_ajax) { - print ''; } @@ -180,7 +189,7 @@ if ($result) print ''; print ''; print ''; - + $i++; } diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index e0874d41595..5cd0d3773de 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -184,7 +184,7 @@ print ''; } $listofstatus=array(0,4,4,5); $bool=false; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 988a3e2d352..34924681c87 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -125,7 +125,7 @@ $arrayfields=array( 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), - 'sale_representative'=>array('label'=>$langs->trans("SalesRepresentative"), 'checked'=>1), + 'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1), 'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1), 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), @@ -740,10 +740,16 @@ if ($resql) $userstatic->id=$val['id']; $userstatic->lastname=$val['lastname']; $userstatic->firstname=$val['firstname']; - print '
'.$userstatic->getNomUrl(1); + $userstatic->email=$val['email']; + $userstatic->statut=$val['statut']; + $userstatic->entity=$val['entity']; + $userstatic->photo=$val['photo']; + + //print '
': + print $userstatic->getNomUrl(-2); $j++; - if ($j < $nbofsalesrepresentative) print ', '; - print '
'; + if ($j < $nbofsalesrepresentative) print ' '; + //print '
'; } } //else print $langs->trans("NoSalesRepresentativeAffected"); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index f2885a50951..329383160aa 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -27,7 +27,7 @@ * Class to build graphs. * Usage is: * $dolgraph=new DolGraph(); - * $dolgraph->SetTitle($langs->transnoentities('Tracking_Projects_Pourcent').'
'.$langs->transnoentities('Tracking_IndicatorDefGraph').'%'); + * $dolgraph->SetTitle($langs->transnoentities('MyTitle').'
'.$langs->transnoentities('MyTitlePercent').'%'); * $dolgraph->SetMaxValue(50); * $dolgraph->SetData($data); * $dolgraph->setShowLegend(1); @@ -35,7 +35,7 @@ * $dolgraph->SetType(array('pie')); * $dolgraph->setWidth('100%'); * $dolgraph->draw('idofgraph'); - * print $dolgraph->show(); + * print $dolgraph->show($total?0:1); */ class DolGraph { @@ -796,7 +796,7 @@ class DolGraph * Build a graph using JFlot library. Input when calling this method should be: * $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB)); * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x - * $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // TODO Syntax not supported. Removed when dol_print_graph_removed + * $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated * $this->legend= array("Val1",...,"Valn"); // list of n series name * $this->type = array('bars',...'lines'); or array('pie') * $this->mode = 'depth' ??? @@ -1041,10 +1041,20 @@ class DolGraph /** * Output HTML string to show graph * - * @return string HTML string to show graph + * @param int $shownographyet Show graph to say there is not enough data + * @return string HTML string to show graph */ - function show() + function show($shownographyet=0) { + global $langs; + + if ($shownographyet) + { + $s= '
'; + $s.='
'.$langs->trans("NotEnoughDataYet").'
'; + return $s; + } + return $this->stringtoshow; } diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 4912b6d8f1a..e9a12861968 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -52,6 +52,7 @@ llxHeader('',$langs->trans("Donations"),$help_url); $nb=array(); $somme=array(); +$total = 0; $sql = "SELECT count(d.rowid) as nb, sum(d.amount) as somme , d.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d"; @@ -69,6 +70,8 @@ if ($result) $somme[$objp->fk_statut] = $objp->somme; $nb[$objp->fk_statut] = $objp->nb; + $total += $objp->somme; + $i++; } $db->free($result); @@ -87,7 +90,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele { $listofsearchfields['search_donation']=array('text'=>'Donation'); } - + if (count($listofsearchfields)) { print ''; @@ -103,7 +106,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; $i++; } - print '
'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1); + + 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('idgraphstatus'); + print $dolgraph->show($total?0:1); + print '
'.$commandestatic->LibStatut($status,$bool,0).''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; print $commandestatic->LibStatut($status,$bool,3); print ''; print '
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1); + print '
'; + + 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('idgraphstatus'); + print $dolgraph->show($totalnb?0:1); + print '
'.dol_print_date($db->jdate($obj->dm),'day').''.$deplacementstatic->LibStatut($obj->fk_statut,3).'
'.$langs->trans("Statistics").' - $listofstatus=array(0,4,4,5); $bool=false; foreach($listofstatus as $status) { - $dataseries[]=array('label'=>$staticcontratligne->LibStatut($status,1,($bool?1:0)),'data'=>(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0)); + $dataseries[]=array($staticcontratligne->LibStatut($status,1,($bool?1:0)),(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0)); if (empty($conf->use_javascript_ajax)) { @@ -199,8 +199,17 @@ foreach($listofstatus as $status) if (! empty($conf->use_javascript_ajax)) { print '
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1); + + 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('idgraphstatus'); + print $dolgraph->show($total?0:1); + print '
'; + print '
'; print '
'; print '
'; } @@ -118,14 +121,23 @@ print "
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1); + print '
'; + + 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('idgraphstatus'); + print $dolgraph->show($total?0:1); + print '
'.$donstatic->LibStatut($status,4).''.(! empty($nb[$status])?$nb[$status]:' ').'
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',320,180,$data,1,'pie',0,'',0); + print '
'; + + 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('idgraphstatus'); + print $dolgraph->show($totalnb?0:1); + print '
'; + + 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('idgraphstatus'); + print $dolgraph->show($total?0:1); $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1); + print '
'.$fichinterstatic->LibStatut($status,$bool,0).''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; @@ -190,7 +200,7 @@ if (! empty($conf->ficheinter->enabled)) $var = true; while ($i < $num) { - + $obj = $db->fetch_object($resql); print '
'; @@ -240,7 +250,7 @@ if ($resql) $var = true; while ($i < $num) { - + $obj = $db->fetch_object($resql); print '
'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 89ad3f77c3a..84ccb017266 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -304,7 +304,7 @@ if ($resql) $topicmail="Information"; $modelmail="intervention"; - $objecttmp=new Intervention($db); + $objecttmp=new Fichinter($db); $trackid='int'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index ccb54930573..ca395d0cf47 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -116,10 +116,10 @@ if ($resql) print "
'.$commandestatic->LibStatut($statut,0).''.(isset($vals[$statut])?$vals[$statut]:0).'
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1,'',0); + + 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('idgraphstatus'); + print $dolgraph->show($total?0:1); + print '
'.$langs->trans($commandestatic->statuts[$row[1]]).'
'; @@ -268,7 +277,7 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - + print '
'; @@ -324,7 +333,7 @@ if ($resql) $var = True; while ($i < $num) { - + $obj = $db->fetch_object($resql); print '
'.$obj->label.''.$obj->nb.'
'.$obj->label.''.$obj->nb.'
'; print ''."\n"; - $var=true; $listofstatus=array_keys($listofoppstatus); foreach ($listofstatus as $status) { @@ -65,7 +64,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) //$labelstatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')'; //$labelstatus .= ' - '.price2num($listofoppstatus[$status]).'%'; - $dataseries[]=array('label'=>$labelstatus,'data'=>(isset($valsamount[$status])?(float) $valsamount[$status]:0)); + $dataseries[]=array($labelstatus, (isset($valsamount[$status])?(float) $valsamount[$status]:0)); if (! $conf->use_javascript_ajax) { @@ -77,9 +76,19 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) } if ($conf->use_javascript_ajax) { - print ''; } //if ($totalinprocess != $total) diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 1c16d48e086..4b25dfb82ac 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -122,10 +122,10 @@ if ($resql) $listofstatus=array(0,1,2,3,4); foreach ($listofstatus as $status) { - $dataseries[]=array('label'=>$supplier_proposalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0)); + $dataseries[]=array($supplier_proposalstatic->LibStatut($status,1), (isset($vals[$status])?(int) $vals[$status]:0)); if (! $conf->use_javascript_ajax) { - + print ''; print ''; print ''; @@ -134,9 +134,18 @@ if ($resql) } if ($conf->use_javascript_ajax) { - print ''; } @@ -178,7 +187,7 @@ if (! empty($conf->supplier_proposal->enabled)) $var = True; while ($i < $num) { - + $obj = $db->fetch_object($resql); print ''; @@ -236,7 +245,7 @@ if ($resql) $var = True; while ($i < $num) { - + $obj = $db->fetch_object($resql); print ''; @@ -317,7 +326,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos while ($i < $nbofloop) { $obj = $db->fetch_object($result); - + print ''; // Ref
'.$langs->trans("Statistics").' - '.$langs->trans("OpportunitiesStatusForOpenedProjects").'
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',360,180,$data,1,'pie',0,'',0,$totaloppnb?0:1); + print '
'; + + 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->SetHeight(180); + $dolgraph->draw('idgraphstatus'); + print $dolgraph->show($totaloppnb?0:1); + print '
'.$supplier_proposalstatic->LibStatut($status,0).''.(isset($vals[$status])?$vals[$status]:0).'
'; - $data=array('series'=>$dataseries); - dol_print_graph('stats',300,180,$data,1,'pie',1,'',0); + print '
'; + + 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('idgraphstatus'); + print $dolgraph->show($total?0:1); + print '