diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 9311832d3be..1080c37caa2 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -112,12 +112,13 @@ class box_graph_product_distribution extends ModeleBoxes { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; - $showpointvalue = 1; + $showpointvalue = 1; $nocolor = 0; $stats_invoice = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0)); $data1 = $stats_invoice->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24))); if (empty($data1)) { $showpointvalue=0; + $nocolor=1; $data1=array(array(0=>$langs->trans("None"),1=>1)); } $filenamenb = $dir."/prodserforinvoice-".$year.".png"; @@ -129,6 +130,8 @@ class box_graph_product_distribution extends ModeleBoxes { $px1->SetData($data1); unset($data1); + + if ($nocolor) $px1->SetDataColor(array(array(220,220,220))); $px1->SetPrecisionY(0); $i=0;$tot=count($data1);$legend=array(); while ($i <= $tot) @@ -164,12 +167,13 @@ class box_graph_product_distribution extends ModeleBoxes { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; - $showpointvalue = 1; + $showpointvalue = 1; $nocolor = 0; $stats_proposal = new PropaleStats($this->db, 0, $mode, ($userid>0?$userid:0)); $data2 = $stats_proposal->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24))); if (empty($data2)) { $showpointvalue = 0; + $nocolor = 1; $data2=array(array(0=>$langs->trans("None"),1=>1)); } @@ -182,6 +186,8 @@ class box_graph_product_distribution extends ModeleBoxes { $px2->SetData($data2); unset($data2); + + if ($nocolor) $px2->SetDataColor(array(array(220,220,220))); $px2->SetPrecisionY(0); $i=0;$tot=count($data2);$legend=array(); while ($i <= $tot) @@ -217,12 +223,13 @@ class box_graph_product_distribution extends ModeleBoxes { include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; - $showpointvalue = 1; + $showpointvalue = 1; $nocolor = 0; $stats_order = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0)); $data3 = $stats_order->getAllByProductEntry($year,(GETPOST('action')==$refreshaction?-1:(3600*24))); if (empty($data3)) { $showpointvalue = 0; + $nocolor = 1; $data3=array(array(0=>$langs->trans("None"),1=>1)); } @@ -235,6 +242,8 @@ class box_graph_product_distribution extends ModeleBoxes { $px3->SetData($data3); unset($data3); + + if ($nocolor) $px3->SetDataColor(array(array(220,220,220))); $px3->SetPrecisionY(0); $i=0;$tot=count($data3);$legend=array(); while ($i <= $tot) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 54ec78a8287..ac603837240 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -242,9 +242,19 @@ class DolGraph function SetData($data) { $this->data = $data; - //var_dump($this->data); } + /** + * Set data + * + * @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...) + * @return void + */ + function SetDataColor($datacolor) + { + $this->datacolor = $datacolor; + } + /** * Set type * @@ -779,7 +789,7 @@ class DolGraph /** * Build a graph onto disk using JFlot library. Input when calling this method should be: * $this->data = array(array( 0=>'labelxA', 1=>yA), array('labelxB',yB)); or - * $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); + * $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(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // when there is n series to show for each x * $this->legend= array("Val1",...,"Valn"); // list of n series name * $this->type = array('bars',...'lines'); or array('pie') @@ -820,7 +830,7 @@ class DolGraph $x++; } - // TODO Avoid push by adding generating a long array... + // TODO Avoid push by adding generated long array... if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'pie') { foreach($values as $x => $y) { if (isset($y)) $serie[$i].='d'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n"; } diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index f5e900c0eee..1fcd3d7d6a8 100644 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -1356,6 +1356,7 @@ tr.box_pair { .formboxfilter { vertical-align: middle; + margin-bottom: 6px; } .formboxfilter input[type=image] { diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 5ae45bc19fb..7bb4f391221 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1523,6 +1523,7 @@ tr.box_pair td, tr.box_impair td, td.box_pair, td.box_impair .formboxfilter { vertical-align: middle; + margin-bottom: 6px; } .formboxfilter input[type=image] { diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index f93f38b1a57..2e1cc0e3ef5 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -1650,6 +1650,7 @@ font-family: ; .formboxfilter { vertical-align: middle; + margin-bottom: 6px; } .formboxfilter input[type=image] { diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index a54115d164b..17b1d67d899 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -1656,6 +1656,7 @@ border: 0px; .formboxfilter { vertical-align: middle; + margin-bottom: 6px; } .formboxfilter input[type=image] { diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ddafc390fde..95886133893 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1947,6 +1947,7 @@ tr.box_pair { .formboxfilter { vertical-align: middle; + margin-bottom: 6px; } .formboxfilter input[type=image] {