Fixed the menu buttons in charts. TICKET: #1818

(cherry picked from commit dac81d2640158bcf7f91ee36700d3dd82ffc0e46)
This commit is contained in:
mdtrooper 2015-02-19 12:52:03 +01:00
parent e15b9ddbfb
commit 66feffb0f7
4 changed files with 57 additions and 66 deletions

View File

@ -773,7 +773,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
} }
// Build the data of the current period // Build the data of the current period
$data_returned = grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $data_returned = grafico_modulo_sparse_data ($agent_module_id,
$period, $show_events,
$width, $height , $title, $unit_name, $width, $height , $title, $unit_name,
$show_alerts, $avg_only, $show_alerts, $avg_only,
$date, $unit, $baseline, $return_data, $show_title, $date, $unit, $baseline, $return_data, $show_title,
@ -801,8 +802,9 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$flash_chart = false; $flash_chart = false;
} }
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", $water_mark = array('file' =>
'url' => ui_get_full_url("/images/logo_vertical_water.png")); $config['homedir'] . "/images/logo_vertical_water.png",
'url' => ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png");
if ($compare === 'separated') { if ($compare === 'separated') {
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend, return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,

View File

@ -2530,7 +2530,9 @@ function reporting_alert_reporting ($id_group, $period = 0, $date = 0, $return =
$data[__('Alerts not fired')] = $not_fired_percentage; $data[__('Alerts not fired')] = $not_fired_percentage;
$output .= pie3d_graph(false, $data, 280, 150, $output .= pie3d_graph(false, $data, 280, 150,
__("other"), ui_get_full_url(false) . '/', $config['homedir'] . "/images/logo_vertical_water.png", __("other"),
ui_get_full_url(false, false, false, false) . '/',
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
$output .= '<strong>'.__('Alerts fired').': '.sizeof ($alerts_fired).'</strong><br />'; $output .= '<strong>'.__('Alerts fired').': '.sizeof ($alerts_fired).'</strong><br />';
@ -2606,7 +2608,9 @@ function reporting_monitor_health ($id_group, $period = 0, $date = 0, $return =
$data[__('Monitors BAD')] = $not_down_percentage; $data[__('Monitors BAD')] = $not_down_percentage;
$output .= pie3d_graph(false, $data, 280, 150, $output .= pie3d_graph(false, $data, 280, 150,
__("other"), ui_get_full_url(false) . '/', $config['homedir'] . "/images/logo_vertical_water.png", __("other"),
ui_get_full_url(false, false, false, false) . '/',
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
if (!$return) if (!$return)
@ -3550,7 +3554,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
0, 0,
true, true,
$only_image, $only_image,
ui_get_full_url(false) . '/', ui_get_full_url(false, false, false, false),
1, 1,
false, false,
'', '',
@ -3609,7 +3613,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
0, 0,
$report["datetime"], $report["datetime"],
true, true,
ui_get_full_url(false) . '/', ui_get_full_url(false, false, false, false) . '/',
1, 1,
// Important parameter, this tell to graphic_combined_module function that is a projection graph // Important parameter, this tell to graphic_combined_module function that is a projection graph
$output_projection, $output_projection,
@ -3676,7 +3680,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array (); $data = array ();
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'], $data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true, false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
$report["datetime"], '', true, 0, true, $only_image, ui_get_full_url(false) . '/'); $report["datetime"], '', true, 0, true, $only_image,
ui_get_full_url(false, false, false, false));
/*$data[0] = graphic_combined_module( /*$data[0] = graphic_combined_module(
$modules, $modules,
@ -3748,7 +3753,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$graph["stacked"], $graph["stacked"],
$report["datetime"], $report["datetime"],
$only_image, $only_image,
ui_get_full_url(false) . '/'); ui_get_full_url(false, false, false, false));
array_push ($table->data, $data); array_push ($table->data, $data);
break; break;
@ -4271,40 +4276,6 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
// $data = array(); // $data = array();
// $data_pie_graph = json_encode ($data_graph); // $data_pie_graph = json_encode ($data_graph);
if ($show_graphs && !empty($slas)) { if ($show_graphs && !empty($slas)) {
// $data[0] = pie3d_graph(false, $data_graph,
// 500, 150, __("other"),
// ui_get_full_url(false, false, false, false),
// $config['homedir'] . "/images/logo_vertical_water.png",
// $config['fontpath'], $config['font_size']);
// //Print resume
// $table_resume = null;
// $table_resume->head[0] = __('Average Value');
// $table_resume->data[0][0] = '<span style="font: bold '.$sizem.'em Arial, Sans-serif; color: #000000;">';
// $table_resume->data[0][0] .= format_numeric($total_SLA / count($sla_showed), 2);
// $table_resume->data[0][0] .= "%</span>";
// $data[1] = html_print_table($table_resume, true);
// $table_resume = null;
// $table_resume->head[0] = __('SLA Compliance');
// if ($total_result_SLA == 'ok') {
// $table_resume->data[0][0] = '<span style="font: bold '.$sizem.'em Arial, Sans-serif; color: #000000;">'.__('OK').'</span>';
// }
// if ($total_result_SLA == 'fail') {
// $table_resume->data[0][0] = '<span style="font: bold '.$sizem.'em Arial, Sans-serif; color: #ff0000;">'.__('Fail').'</span>';
// }
// if ($total_result_SLA == 'unknown') {
// $table_resume->data[0][0] = '<span style="font: bold '.$sizem.'em Arial, Sans-serif; color: #736F6E;">'.__('Unknown').'</span>';
// }
// $data[2] = html_print_table($table_resume, true);
// $next_row++;
// array_push ($table->data, $data);
$table->colspan[$next_row][0] = 3; $table->colspan[$next_row][0] = 3;
$next_row++; $next_row++;
$data = array(); $data = array();
@ -4563,7 +4534,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table_event_graph->data[0][0] = pie3d_graph( $table_event_graph->data[0][0] = pie3d_graph(
false, $data_graph, 500, 150, __("other"), "", false, $data_graph, 500, 150, __("other"), "",
$config['homedir'] . "/images/logo_vertical_water.png", ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
$data[0] = html_print_table($table_event_graph, true); $data[0] = html_print_table($table_event_graph, true);
@ -4591,7 +4562,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table_event_graph->data[0][0] = pie3d_graph( $table_event_graph->data[0][0] = pie3d_graph(
false, $data_graph, 500, 150, __("other"), "", false, $data_graph, 500, 150, __("other"), "",
$config['homedir'] . "/images/logo_vertical_water.png", ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size'], 1, false, $colors); $config['fontpath'], $config['font_size'], 1, false, $colors);
$data[0] = html_print_table($table_event_graph, true); $data[0] = html_print_table($table_event_graph, true);
@ -4617,7 +4588,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table_event_graph->data[0][0] = pie3d_graph( $table_event_graph->data[0][0] = pie3d_graph(
false, $data_graph, 500, 150, __("other"), "", false, $data_graph, 500, 150, __("other"), "",
$config['homedir'] . "/images/logo_vertical_water.png", ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
$data[0] = html_print_table($table_event_graph, true); $data[0] = html_print_table($table_event_graph, true);
@ -4764,7 +4735,13 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array (); $data = array ();
$data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, $sizgraph_h, $content["type"], true, ui_get_full_url(false) . '/'); $data[0] = graph_custom_sql_graph(
$content["id_rc"],
$sizgraph_w,
$sizgraph_h,
$content["type"],
true,
ui_get_full_url(false, false, false, false));
array_push($table->data, $data); array_push($table->data, $data);
break; break;
@ -4830,7 +4807,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table_event_graph->data[0][0] = pie3d_graph( $table_event_graph->data[0][0] = pie3d_graph(
false, $data_graph, 500, 150, __("other"), "", false, $data_graph, 500, 150, __("other"), "",
$config['homedir'] . "/images/logo_vertical_water.png", ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
$data[0] = html_print_table($table_event_graph, true); $data[0] = html_print_table($table_event_graph, true);
@ -4856,7 +4833,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table_event_graph->data[0][0] = pie3d_graph( $table_event_graph->data[0][0] = pie3d_graph(
false, $data_graph, 500, 150, __("other"), "", false, $data_graph, 500, 150, __("other"), "",
$config['homedir'] . "/images/logo_vertical_water.png", ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
$data[0] = html_print_table($table_event_graph, true); $data[0] = html_print_table($table_event_graph, true);
@ -4884,7 +4861,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table_event_graph->data[0][0] = pie3d_graph( $table_event_graph->data[0][0] = pie3d_graph(
false, $data_graph, 500, 150, __("other"), "", false, $data_graph, 500, 150, __("other"), "",
$config['homedir'] . "/images/logo_vertical_water.png", ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size'], 1, false, $colors); $config['fontpath'], $config['font_size'], 1, false, $colors);
$data[0] = html_print_table($table_event_graph, true); $data[0] = html_print_table($table_event_graph, true);
@ -4910,7 +4887,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table_event_graph->data[0][0] = pie3d_graph( $table_event_graph->data[0][0] = pie3d_graph(
false, $data_graph, 500, 150, __("other"), "", false, $data_graph, 500, 150, __("other"), "",
$config['homedir'] . "/images/logo_vertical_water.png", ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
$data[0] = html_print_table($table_event_graph, true); $data[0] = html_print_table($table_event_graph, true);
@ -6136,7 +6113,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data[0] = pie3d_graph(false, $data_pie_graph, $data[0] = pie3d_graph(false, $data_pie_graph,
$sizgraph_w, $sizgraph_h, __("other"), $sizgraph_w, $sizgraph_h, __("other"),
ui_get_full_url(false, true, false, false) . '/', $config['homedir'] . "/images/logo_vertical_water.png", ui_get_full_url(false, true, false, false) . '/',
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
@ -6531,7 +6509,9 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array(); $data = array();
if ($show_graph == 1 || $show_graph == 2) { if ($show_graph == 1 || $show_graph == 2) {
$data[0] = pie3d_graph(false, $data_pie_graph, $data[0] = pie3d_graph(false, $data_pie_graph,
600, 150, __("other"), ui_get_full_url(false) . '/', $config['homedir'] . "/images/logo_vertical_water.png", 600, 150, __("other"),
ui_get_full_url(false, false, false, false),
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']); $config['fontpath'], $config['font_size']);
array_push ($table->data, $data); array_push ($table->data, $data);
//Display bars graph //Display bars graph
@ -6540,7 +6520,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$height = count($data_pie_graph) * 20 + 85; $height = count($data_pie_graph) * 20 + 85;
$data = array(); $data = array();
$data[0] = hbar_graph(false, $data_hbar, 600, $height, array(), array(), "", "", true, ui_get_full_url(false) . '/', $config['homedir'] . "/images/logo_vertical_water.png", '', '', true, 1, true); $data[0] = hbar_graph(false, $data_hbar, 600, $height,
array(), array(), "", "", true,
ui_get_full_url(false, false, false, false),
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png", '', '', true, 1, true);
array_push ($table->data, $data); array_push ($table->data, $data);
} }

View File

@ -292,7 +292,13 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
} }
$menu_width = 25 * $nbuttons + 15; $menu_width = 25 * $nbuttons + 15;
$return .= "<div id='menu_$graph_id' class='menu_graph' style='display:none; text-align:center; width:".$menu_width."px; border: solid 1px #666; border-bottom: 0px; padding: 4px 4px 4px 4px'> $return .= "<div id='menu_$graph_id' class='menu_graph' " .
"style='display: none; " .
"text-align: center; " .
"width: " . $menu_width . "px; ".
"border: solid 1px #666; ".
"border-bottom: 0px; " .
"padding: 4px 4px 4px 4px'>
<a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>"; <a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>";
if ($threshold) { if ($threshold) {
$return .= "<a href='javascript:'><img id='menu_threshold_$graph_id' src='".$homeurl."images/chart_curve_threshold.png' alt='".__('Warning and Critical thresholds')."' title='".__('Warning and Critical thresholds')."'></a>"; $return .= "<a href='javascript:'><img id='menu_threshold_$graph_id' src='".$homeurl."images/chart_curve_threshold.png' alt='".__('Warning and Critical thresholds')."' title='".__('Warning and Critical thresholds')."'></a>";
@ -382,7 +388,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
"$watermark, " . "$watermark, " .
"$width, " . "$width, " .
"$max_x, " . "$max_x, " .
"'" . $config['homeurl'] . "', " . "'" . $homeurl . "', " .
"'$unit', " . "'$unit', " .
"$font_size, " . "$font_size, " .
"$menu, " . "$menu, " .