diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index fc69133d06..43880a22f8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2011-07-27 Sergio Martin + + * include/functions_html.php + godmode/reporting/reporting_builder.php + godmode/reporting/reporting_builder.item_editor.php: Fixed several + warnings of undeclared variables and use of not supported parameter + of function strstr in php 3.2 + 2011-07-27 Vanessa Gil * operation/agentes/status_monitor.php: Update the monitor search with "Filter" button. diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 25283f89e0..04060a97f1 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -33,43 +33,44 @@ if (enterprise_include_once ('include/functions_metaconsole.php')) { $servers = enterprise_hook("metaconsole_get_connection_names"); } +$idAgent = null; +$idCustomGraph = null; +$text = null; +$header = null; +$idCustom = null; +$url = null; +$field = null; +$line = null; +$group = 0; +$group_by_agent = 0; +$order_uptodown = 0; +$show_resume = 0; +$top_n = 0; +$top_n_value = 10; +$exception_condition = 0; +$exception_condition_value = 10; +$modulegroup = 0; +$period = 86400; +$only_display_wrong = 0; +$monday = true; +$tuesday = true; +$wednesday = true; +$thursday = true; +$friday = true; +$saturday = true; +$sunday = true; +$time_from = '00:00'; +$time_to = '23:59'; +$show_graph = 0; + switch ($action) { case 'new': $actionParameter = 'save'; $type = get_parameter('type', 'SLA'); - $period = 86400; - $idAgent = null; - $idCustomGraph = null; - $text = null; - $header = null; - $idCustom = null; - $url = null; - $field = null; - $line = null; $description = null; $sql = null; - $group = 0; - $only_display_wrong = 0; - $monday = true; - $tuesday = true; - $wednesday = true; - $thursday = true; - $friday = true; - $saturday = true; - $sunday = true; - $time_from = '00:00'; - $time_to = '23:59'; - $group_by_agent = 0; - $order_uptodown = 0; - $show_resume = 0; - $top_n = 0; - $top_n_value = 10; - $exception_condition = 0; - $exception_condition_value = 10; - $show_graph = 0; $show_in_two_columns = 0; $show_in_landscape = 0; - $modulegroup = 0; $server_name = ''; break; default: diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 90377fee91..9336f619fe 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -155,7 +155,13 @@ switch ($action) { $resultOperationDB = (bool)db_process_sql_update('treport', array('name' => $reportName, 'id_group' => $idGroupReport, 'description' => $description), array('id_report' => $idReport)); } else if ($action == 'save') { - $idOrResult = db_process_sql_insert('treport', array('name' => $reportName, 'id_group' => $idGroupReport, 'description' => $description)); + if($reportName != "" && $idGroupReport != "") { + $idOrResult = db_process_sql_insert('treport', array('name' => $reportName, 'id_group' => $idGroupReport, 'description' => $description)); + } + else { + $idOrResult = false; + } + if ($idOrResult === false) { $resultOperationDB = false; } @@ -213,7 +219,7 @@ switch ($action) { break; } - $id_gs = strstr($values ['id_gs'], '|', true); + $id_gs = substr ($values['id_gs'], 0, strpos ($values['id_gs'], '|')); if ($id_gs !== false) { $server_name = strstr($values ['id_gs'], '|'); $values ['id_gs'] = $id_gs; @@ -305,8 +311,7 @@ switch ($action) { $resultOperationDB = false; break; } - - $id_gs = strstr($values ['id_gs'], '|', true); + $id_gs = substr ($values['id_gs'], 0, strpos ($values['id_gs'], '|')); if ($id_gs !== false) { $server_name = strstr($values ['id_gs'], '|'); $values ['id_gs'] = $id_gs; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 9e7e5c1242..79835c99c3 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -299,7 +299,7 @@ function html_print_select ($fields, $name, $selected = '', $script = '', $nothi $output .= '>'.$nothing.''; } - if (!empty ($fields)) { + if (is_array($fields) && !empty ($fields)) { if ($sort !== false) { asort ($fields); }