2013-06-10 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_html.php, include/functions_reporting.php,
	include/graphs/functions_utils.php, include/graphs/fgraph.php,
	include/graphs/functions_pchart.php: fixed the graphs in the
	reports.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8281 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-06-10 11:13:38 +00:00
parent a40f68bdaf
commit 0a2ac656a5
6 changed files with 146 additions and 146 deletions

View File

@ -1,3 +1,10 @@
2013-06-10 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php, include/functions_reporting.php,
include/graphs/functions_utils.php, include/graphs/fgraph.php,
include/graphs/functions_pchart.php: fixed the graphs in the
reports.
2013-06-10 Sergio Martin <sergio.martin@artica.es>
* include/styles/datepicker.css

View File

@ -1639,22 +1639,22 @@ function html_print_image ($src, $return = false, $options = false, $return_src
}
if (!$relative) {
$src_tmp = $src;
$src = ui_get_full_url($src);
}
// If metaconsole is activated and image doesn't exists try to search on normal console
if (defined('METACONSOLE')) {
if (!$relative) {
if (false === @file_get_contents($src, 0, null, 0, 1)) {
$src = ui_get_full_url('../../' . $src_tmp);
$src = ui_get_full_url('../../' . $src);
}
}
else {
$src = '../../' . $src;
}
}
else {
if (!$relative) {
$src = ui_get_full_url($src);
}
}
// Only return src field of image
if ($return_src) {

View File

@ -3471,7 +3471,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$dataslice[1] = graph_sla_slicebar ($sla['id_agent_module'], $content['period'],
$sla['sla_min'], $sla['sla_max'], $report['datetime'], $content, $content['time_from'],
$content['time_to'], 650, 25, ui_get_full_url(false) . '/', 1, $sla_data_arrays[$k], false);
$content['time_to'], 650, 25, ui_get_full_url(false, false, false, false), 1, $sla_data_arrays[$k], false);
array_push ($tableslice->data, $dataslice);
}
@ -3494,7 +3494,9 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data_pie_graph = json_encode ($data_graph);
if ($show_graphs && !empty($slas)) {
$data[0] = pie3d_graph(false, $data_graph,
500, 150, __("other"), ui_get_full_url(false) . '/', $config['homedir'] . "/images/logo_vertical_water.png",
500, 150, __("other"),
ui_get_full_url(false, false, false, false),
$config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']);

View File

@ -435,7 +435,8 @@ function pch_pie_graph ($graph_type, $data_values, $legend_values, $width,
}
/* Enable shadow computing */
$myPicture->setShadow(TRUE,array("X"=>3,"Y"=>3,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
$myPicture->setShadow(TRUE,
array("X" => 3, "Y" => 3, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Render the picture */
$myPicture->stroke();

View File

@ -135,6 +135,9 @@ function graph_get_max_index($legend_values) {
function setup_watermark($water_mark, &$water_mark_file, &$water_mark_url) {
if (!is_array($water_mark)) {
$water_mark_file = $water_mark;
$water_mark_url = '';
return;
}
if (isset($water_mark['file'])) {
@ -214,19 +217,15 @@ function get_complementary_rgb ($hexcode) {
$l = ($var_max + $var_min) / 2;
if ($del_max == 0)
{
if ($del_max == 0) {
$h = 0;
$s = 0;
}
else
{
if ($l < 0.5)
{
else {
if ($l < 0.5) {
$s = $del_max / ($var_max + $var_min);
}
else
{
else {
$s = $del_max / (2 - $var_max - $var_min);
};
@ -234,26 +233,21 @@ function get_complementary_rgb ($hexcode) {
$del_g = ((($var_max - $var_g) / 6) + ($del_max / 2)) / $del_max;
$del_b = ((($var_max - $var_b) / 6) + ($del_max / 2)) / $del_max;
if ($var_r == $var_max)
{
if ($var_r == $var_max) {
$h = $del_b - $del_g;
}
elseif ($var_g == $var_max)
{
elseif ($var_g == $var_max) {
$h = (1 / 3) + $del_r - $del_b;
}
elseif ($var_b == $var_max)
{
elseif ($var_b == $var_max) {
$h = (2 / 3) + $del_g - $del_r;
};
if ($h < 0)
{
if ($h < 0) {
$h += 1;
};
if ($h > 1)
{
if ($h > 1) {
$h -= 1;
};
};
@ -276,20 +270,16 @@ function get_complementary_rgb ($hexcode) {
// Output is RGB in normal 255 255 255 format, held in $r, $g, $b
// Hue is converted using function hue_2_rgb, shown at the end of this code
if ($s == 0)
{
if ($s == 0) {
$r = $l * 255;
$g = $l * 255;
$b = $l * 255;
}
else
{
if ($l < 0.5)
{
else {
if ($l < 0.5) {
$var_2 = $l * (1 + $s);
}
else
{
else {
$var_2 = ($l + $s) - ($s * $l);
};
$var_1 = 2 * $l - $var_2;