Added the feature of time compare overlapped in the simple graph and simple graph baseline in reports.

This commit is contained in:
mdtrooper 2015-04-07 15:03:46 +02:00
parent 38f94086c7
commit 4bae03a227
4 changed files with 91 additions and 13 deletions

View File

@ -88,6 +88,7 @@ $inventory_modules = array();
$date = null;
// Only avg is selected by default for the simple graphs
$only_avg = true;
$time_compare_overlapped = false;
//Added for events items
$filter_event_validated = false;
@ -188,6 +189,9 @@ switch ($action) {
$projection_period = $item['top_n_value'];
$period_pg = $item['period'];
}
// HACK it is saved in show_graph field.
$time_compare_overlapped = $item['show_graph'];
break;
case 'prediction_date':
$description = $item['description'];
@ -1032,6 +1036,14 @@ html_print_input_hidden('id_item', $idItem);
?>
</td>
</tr>
<tr id="row_time_compare_overlapped" style="" class="datos">
<td><?php echo __('Time compare (Overlapped)');?></td>
<td>
<?php
html_print_checkbox('time_compare_overlapped', 1, $time_compare_overlapped);
?>
</td>
</tr>
<tr id="row_only_avg" style="" class="datos">
<td><?php echo __('Only average');?></td>
<td><?php html_print_checkbox('only_avg', 1, $only_avg);?></td>
@ -2002,6 +2014,7 @@ function chooseType() {
$("#row_show_graph").hide();
$("#row_max_min_avg").hide();
$("#row_only_avg").hide();
$("#row_time_compare_overlapped").hide();
$("#row_quantity").hide();
$("#row_exception_condition_value").hide();
$("#row_exception_condition").hide();
@ -2045,6 +2058,7 @@ function chooseType() {
$("#row_event_graphs").show();
break;
case 'simple_graph':
$("#row_time_compare_overlapped").show();
$("#row_only_avg").show();
// The break hasn't be forgotten, this element
// only should be shown on the simple graphs.
@ -2055,6 +2069,7 @@ function chooseType() {
$("#row_period").show();
$("#row_show_in_two_columns").show();
$("#row_show_in_landscape").show();
$("#row_time_compare_overlapped").show();
break;
case 'projection_graph':
$("#row_description").show();

View File

@ -851,11 +851,19 @@ switch ($action) {
$good_format = true;
break;
case 'availability':
$good_format = true;
// HACK it is saved in show_graph field.
// Show interfaces instead the modules
$values['show_graph'] =
get_parameter('checkbox_show_address_agent');
$good_format = true;
break;
case 'simple_graph':
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] =
(int)get_parameter('time_compare_overlapped');
$values['period'] = get_parameter('period');
$good_format = true;
break;
default:
$values['period'] = get_parameter('period');
@ -1073,11 +1081,27 @@ switch ($action) {
$values['top_n_value'] = get_parameter('max_values');
$good_format = true;
break;
case 'availability':
// HACK it is saved in show_graph field.
// Show interfaces instead the modules
$values['show_graph'] =
get_parameter('checkbox_show_address_agent');
$good_format = true;
break;
case 'simple_graph':
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] =
(int)get_parameter('time_compare_overlapped');
$values['period'] = get_parameter('period');
$good_format = true;
break;
default:
$values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg',0);
$values['top_n_value'] = get_parameter('quantity');
$values['text'] = get_parameter('text');
$values['show_graph'] = get_parameter('combo_graph_options');
$good_format = true;
}
@ -1125,7 +1149,6 @@ switch ($action) {
$values['order_uptodown'] = get_parameter ('radiobutton_order_uptodown',0);
$values['exception_condition'] = (int)get_parameter('radiobutton_exception_condition', 0);
$values['exception_condition_value'] = get_parameter('exception_condition_value');
$values['show_graph'] = get_parameter('combo_graph_options');
$values['id_module_group'] = get_parameter('combo_modulegroup');
$values['id_group'] = get_parameter ('combo_group');
$values['server_name'] = get_parameter ('server_name');

View File

@ -705,8 +705,8 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
}*/
if ($show_unknown) {
$legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str;
$chart_extra_data['legend_unknown'] = $legend['unknown'.$series_suffix_str];
$legend['unknown' . $series_suffix] = __('Unknown') . $series_suffix_str;
$chart_extra_data['legend_unknown'] = $legend['unknown' . $series_suffix_str];
}
}
@ -721,7 +721,6 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
global $config;
global $graphic_type;
$flash_chart = $config['flash_charts'];
enterprise_include_once("include/functions_reporting.php");

View File

@ -3510,12 +3510,29 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$urlImage = ui_get_full_url(false, false, false, false);
$data[0] = grafico_modulo_string ($content['id_agent_module'], $content['period'],
false, $sizgraph_w, $sizgraph_h, '', '', false, $only_avg, false,
$report["datetime"], $only_image, $urlImage);
$data[0] = grafico_modulo_string (
$content['id_agent_module'],
$content['period'],
false,
$sizgraph_w,
$sizgraph_h,
'',
'',
false,
$only_avg,
false,
$report["datetime"],
$only_image,
$urlImage);
}
else {
// HACK it is saved in show_graph field.
$time_compare_overlapped = false;
if ($content['show_graph']) {
$time_compare_overlapped = 'overlapped';
}
$data[0] = grafico_modulo_sparse(
$content['id_agent_module'],
@ -3538,7 +3555,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
1,
false,
'',
false,
$time_compare_overlapped,
true);
}
@ -3657,11 +3674,35 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data_desc);
}
// HACK it is saved in show_graph field.
$time_compare_overlapped = false;
if ($content['show_graph']) {
$time_compare_overlapped = 'overlapped';
}
$data = array ();
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
$report["datetime"], '', true, 0, true, $only_image,
ui_get_full_url(false, false, false, false));
$data[0] = grafico_modulo_sparse(
$content['id_agent_module'],
$content['period'],
false,
$sizgraph_w,
$sizgraph_h,
'',
'',
false,
true,
true,
$report["datetime"],
'',
true,
0,
true,
only_image,
ui_get_full_url(false, false, false, false),
1,
false,
'',
$time_compare_overlapped);
/*$data[0] = graphic_combined_module(
$modules,