2012-05-03 Miguel de Dios <miguel.dedios@artica.es>

* include/styles/pandora.css: fixed ".is_submenu2 li" because there
	is not ":".
	
	* include/functions_reporting.php: cleaned source code style.
	
	* godmode/reporting/reporting_builder.php: removed a PHP notice
	message about a uninicialized var.
	
	* godmode/reporting/graphs.php: fixed lost icon in the header bar
	in this page.
	
	MERGED FROM 4.0.2




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6248 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-05-03 13:57:55 +00:00
parent beb743815b
commit 8e027fc001
5 changed files with 61 additions and 41 deletions

View File

@ -1,3 +1,18 @@
2012-05-03 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/pandora.css: fixed ".is_submenu2 li" because there
is not ":".
* include/functions_reporting.php: cleaned source code style.
* godmode/reporting/reporting_builder.php: removed a PHP notice
message about a uninicialized var.
* godmode/reporting/graphs.php: fixed lost icon in the header bar
in this page.
MERGED FROM 4.0.2
2012-05-03 Miguel de Dios <miguel.dedios@artica.es>
* include/styles/menu.css: fixed bad colour name "#grey" for correct

View File

@ -65,7 +65,7 @@ $id = (int) get_parameter ('id');
$multiple_delete = (bool)get_parameter('multiple_delete', 0);
// Header
ui_print_page_header (__('Reporting')." &raquo; ".__('Custom graphs'), "images/reporting", false, "", false, $buttons);
ui_print_page_header (__('Reporting')." &raquo; ".__('Custom graphs'), "images/reporting.png", false, "", false, $buttons);
// Delete module SQL code
if ($delete_graph) {
@ -82,7 +82,8 @@ if ($delete_graph) {
if ($result) {
db_pandora_audit("Report management", "Delete graph #$id");
$result = "<h3 class=suc>".__('Successfully deleted')."</h3>";
} else {
}
else {
db_pandora_audit("Report management", "Fail try to delete graph #$id");
$result = "<h3 class=error>".__('Not deleted. Error deleting data')."</h3>";
}

View File

@ -424,13 +424,16 @@ switch ($action) {
$values['text'] = get_parameter('text');
$good_format = true;
}
$values['id_agent'] = get_parameter('id_agent');
$values['id_gs'] = get_parameter('id_custom_graph');
if (($type == 'alert_report_agent') or ($type == 'event_report_agent'))
$values['id_agent_module'] = '';
else
$values['id_agent_module'] = get_parameter('id_agent_module');
$values['id_agent_module'] = '';
if (isset($type)) {
if (($type == 'alert_report_agent') or ($type == 'event_report_agent'))
$values['id_agent_module'] = '';
else
$values['id_agent_module'] = get_parameter('id_agent_module');
}
$values['only_display_wrong'] = get_parameter('checkbox_only_display_wrong');
$values['monday'] = get_parameter('monday', 0);
$values['tuesday'] = get_parameter('tuesday', 0);
@ -452,7 +455,7 @@ switch ($action) {
$values['server_name'] = get_parameter ('server_name');
if ($values['server_name'] == '')
$values['server_name'] = get_parameter ('combo_server');
if (($values['type'] == 'custom_graph') && ($values['id_gs'] == 0 || $values['id_gs'] == '')) {
$resultOperationDB = false;
break;
@ -464,7 +467,7 @@ switch ($action) {
$values ['id_gs'] = $id_gs;
$values['server_name'] = substr ($server_name, 1, strlen($server_name));
}
if (($values['type'] == 'sql') OR ($values['type'] == 'sql_graph_hbar')OR ($values['type'] == 'sql_graph_vbar') OR ($values['type'] == 'sql_graph_pie')) {
$values['treport_custom_sql_id'] = get_parameter('id_custom');
if ($values['treport_custom_sql_id'] == 0) {

View File

@ -52,11 +52,11 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period, $dat
if (empty ($date)) $date = get_system_time ();
if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"];
$datelimit = $date - $period;
$id_module_type = modules_get_agentmodule_type ($id_agent_module);
$module_type = modules_get_moduletype_name ($id_module_type);
$uncompressed_module = is_module_uncompressed ($module_type);
// Get module data
$interval_data = db_get_all_rows_sql ('SELECT * FROM tagente_datos
WHERE id_agente_modulo = ' . (int) $id_agent_module .
@ -64,7 +64,7 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period, $dat
' AND utimestamp < ' . (int) $date .
' ORDER BY utimestamp ASC', true);
if ($interval_data === false) $interval_data = array ();
// Uncompressed module data
if ($uncompressed_module) {
$min_necessary = 1;
@ -95,11 +95,11 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period, $dat
$min_necessary = 2;
}
if (count ($interval_data) < $min_necessary) {
return false;
}
// Set initial conditions
$total = 0;
$count = 0;
@ -121,21 +121,21 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period, $dat
$count++;
}
}
// Compressed module data
if (! $uncompressed_module) {
if ($period == 0) {
return 0;
}
return $total / $period;
}
// Uncompressed module data
if ($count == 0) {
return 0;
}
return $total / $count;
}
@ -155,11 +155,11 @@ function reporting_get_agentmodule_data_max ($id_agent_module, $period, $date =
if (empty ($date)) $date = get_system_time ();
if ((empty ($period)) OR ($period == 0)) $period = $config["sla_period"];
$datelimit = $date - $period;
$id_module_type = modules_get_agentmodule_type ($id_agent_module);
$module_type = modules_get_moduletype_name ($id_module_type);
$uncompressed_module = is_module_uncompressed ($module_type);
// Get module data
$interval_data = db_get_all_rows_sql ('SELECT * FROM tagente_datos
WHERE id_agente_modulo = ' . (int) $id_agent_module .
@ -167,7 +167,7 @@ function reporting_get_agentmodule_data_max ($id_agent_module, $period, $date =
' AND utimestamp < ' . (int) $date .
' ORDER BY utimestamp ASC', true);
if ($interval_data === false) $interval_data = array ();
// Uncompressed module data
if ($uncompressed_module) {
@ -193,7 +193,7 @@ function reporting_get_agentmodule_data_max ($id_agent_module, $period, $date =
array_push ($interval_data, $next_data);
}
}
// Set initial conditions
if (empty($iterval_data)) {
$max = 0;
@ -206,13 +206,13 @@ function reporting_get_agentmodule_data_max ($id_agent_module, $period, $date =
$max = 0;
}
}
foreach ($interval_data as $data) {
if ($data['datos'] > $max) {
$max = $data['datos'];
}
}
return $max;
}
@ -308,15 +308,15 @@ function reporting_get_agentmodule_data_sum ($id_agent_module, $period, $date =
$module_name = db_get_value ('nombre', 'ttipo_modulo', 'id_tipo', $id_module_type);
$module_interval = modules_get_interval ($id_agent_module);
$uncompressed_module = is_module_uncompressed ($module_name);
// Wrong module type
if (is_module_data_string ($module_name)) {
return 0;
}
// Incremental modules are treated differently
$module_inc = is_module_inc ($module_name);
// Get module data
$interval_data = db_get_all_rows_sql ('SELECT * FROM tagente_datos
WHERE id_agente_modulo = ' . (int) $id_agent_module .
@ -324,7 +324,7 @@ function reporting_get_agentmodule_data_sum ($id_agent_module, $period, $date =
' AND utimestamp < ' . (int) $date .
' ORDER BY utimestamp ASC', true);
if ($interval_data === false) $interval_data = array ();
// Uncompressed module data
if ($uncompressed_module) {
$min_necessary = 1;
@ -355,17 +355,17 @@ function reporting_get_agentmodule_data_sum ($id_agent_module, $period, $date =
$min_necessary = 2;
}
if (count ($interval_data) < $min_necessary) {
return false;
}
// Set initial conditions
$total = 0;
if (! $uncompressed_module) {
$previous_data = array_shift ($interval_data);
}
foreach ($interval_data as $data) {
if ($uncompressed_module) {
$total += $data['datos'];
@ -378,7 +378,7 @@ function reporting_get_agentmodule_data_sum ($id_agent_module, $period, $date =
}
$previous_data = $data;
}
return $total;
}
@ -2331,7 +2331,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data_desc[0] = $content["description"];
array_push ($table->data, $data_desc);
}
$data = array ();
$table->colspan[2][0] = 3;
$intervals_text = $content['text'];
@ -2384,7 +2384,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
array_push ($table->data, $data);
break;
case 2:
case 'custom_graph':
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
@ -2437,7 +2437,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
true,
$urlImage);
array_push ($table->data, $data);
break;
case 3:
case 'SLA':
@ -2448,7 +2448,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table->style[1] = 'text-align: right';
// Put description at the end of the module (if exists)
$table->colspan[1][0] = 3;
if ($content["description"] != ""){
$data_desc = array();
@ -3489,6 +3489,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$i++;
$x++;
}
foreach ($agent_list as $a) {
$data = array();
$data[0] = $a;

View File

@ -1611,7 +1611,7 @@ td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yel
}
.menu li.selected {
background-color: #B1B1B1 !important;
background-color: #B1B1B1 !important;
}
.menu li {
@ -1619,7 +1619,7 @@ td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yel
}
.submenu li a{
background-color: #E4E4E4 !important;
background-color: #E4E4E4 !important;
}
.menu li a:hover,
@ -1628,11 +1628,11 @@ td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yel
}
.is_submenu2 li {
background-color #ff0000;
background-color: #ff0000;
}
.is_submenu2 {
background-color: #222222 !important;
background-color: #222222 !important;
}
.menu li.submenu_selected a {
@ -1659,5 +1659,5 @@ td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yel
input#text-id_parent.ac_input, input, textarea, select {
background-color: #ffffff !important;
border: 1px solid #cbcbcb;
}
}