diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 973ba5404b..e1ce45cdde 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2012-05-03 Miguel de Dios + + * 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 * include/styles/menu.css: fixed bad colour name "#grey" for correct diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index abce0eac08..7f8b4a4bce 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -65,7 +65,7 @@ $id = (int) get_parameter ('id'); $multiple_delete = (bool)get_parameter('multiple_delete', 0); // Header -ui_print_page_header (__('Reporting')." » ".__('Custom graphs'), "images/reporting", false, "", false, $buttons); +ui_print_page_header (__('Reporting')." » ".__('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 = "

".__('Successfully deleted')."

"; - } else { + } + else { db_pandora_audit("Report management", "Fail try to delete graph #$id"); $result = "

".__('Not deleted. Error deleting data')."

"; } diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index dae01b45c2..06d35f1fa6 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -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) { diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 8367c41f1c..b69c72f4fe 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -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; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 0da840a283..35659df514 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -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; - } +}