2013-07-11 Sergio Martin <sergio.martin@artica.es>

* include/graphs/pChart/pPie.class.php: Fix the colors of the
	legend when we want to have legend of data that not appears
	in the pie. Merge from 4.1

	* operation/users/user_edit.php: Fix repeated select control
	for main page in workspace section

	* godmode/servers/modificar_server.php: Fix crash in
	servers view



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8516 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-07-11 11:11:16 +00:00
parent eb7ada05c5
commit b535f03d22
4 changed files with 30 additions and 15 deletions

View File

@ -1,3 +1,15 @@
2013-07-11 Sergio Martin <sergio.martin@artica.es>
* include/graphs/pChart/pPie.class.php: Fix the colors of the
legend when we want to have legend of data that not appears
in the pie. Merge from 4.1
* operation/users/user_edit.php: Fix repeated select control
for main page in workspace section
* godmode/servers/modificar_server.php: Fix crash in
servers view
2013-07-11 Sergio Martin <sergio.martin@artica.es>
* include/functions_graph.php: Change Data by Avg on graphs legends

View File

@ -17,6 +17,7 @@
global $config;
require_once ("include/functions_servers.php");
require_once ("include/functions_graph.php");
check_login();

View File

@ -84,9 +84,12 @@
/* Dump the real number of data to draw */
$Values = "";
$PaletteAux = array(); // Fix to store only necesary colors
foreach ($Data["Series"][$DataSerie]["Data"] as $Key => $Value)
{ if ($Value != 0) { $Values[] = $Value; } }
{ if ($Value != 0) { $Values[$Key] = $Value; $PaletteAux[] = $Palette[$Key]; } }
$Palette = $PaletteAux;
/* Compute the wasted angular space between series */
if (count($Values)==1) { $WastedAngular = 0; } else { $WastedAngular = count($Values) * $DataGapAngle; }
@ -292,9 +295,12 @@
/* Dump the real number of data to draw */
$Values = "";
$PaletteAux = array(); // Fix to store only necesary colors
foreach ($Data["Series"][$DataSerie]["Data"] as $Key => $Value)
{ if ($Value != 0) { $Values[$Key] = $Value; } }
{ if ($Value != 0) { $Values[$Key] = $Value; $PaletteAux[] = $Palette[$Key]; } }
$Palette = $PaletteAux;
/* Compute the wasted angular space between series */
if (count($Values)==1) { $WastedAngular = 0; } else { $WastedAngular = count($Values) * $DataGapAngle; }
@ -306,17 +312,15 @@
/* Draw the polygon pie elements */
$Step = 360 / (2 * PI * $Radius);
$Offset = 360;
// Commented due to fix bellow
//$ID = count($Values)-1;
$Offset = 360;
$ID = count($Values)-1;
// Commented due to fix bellow
// $Values = array_reverse($Values);
$Slice = 0; $Slices = ""; $SliceColors = ""; $Visible = ""; $SliceAngle = "";
foreach($Values as $Key => $Value)
{
// Fix: ID equal to the index of array
$ID = $Key;
$Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);
$SliceColors[$Slice] = $Settings;
@ -518,7 +522,8 @@
if ( $SecondPass )
{
$Step = 360 / (2 * PI * $Radius);
$Offset = 360; $ID = 0;
$Offset = 360;
$ID = count($Values)-1;
foreach($Values as $Key => $Value)
{
$FirstPoint = TRUE;
@ -566,7 +571,7 @@
}
$this->pChartObject->drawLine($Xc,$Yc,$X0,$Y0,$Settings);
$Offset = $i - $DataGapAngle; $ID++;
$Offset = $i - $DataGapAngle; $ID--;
}
}

View File

@ -294,10 +294,7 @@ if (!$meta) {
}
$data[1] .= '<br>' . html_print_select($values, 'section', io_safe_output($user_info["section"]), 'show_data_section();', '', -1, true, false, false);
echo html_print_select($values, 'section', io_safe_output($user_info["section"]), 'show_data_section();', '', -1, true, false, false);
echo "&nbsp;&nbsp;";
if (enterprise_installed()) {
$dashboards = get_user_dashboards ($config['id_user']);
$dashboards_aux = array();