diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 4fb10bb565..8464aa70f7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2009-06-08 Esteban Sanchez + + * godmode/reporting/reporting_builder.php: Replaced SQL with pandora + database functions. Do not order period values. Some style to delete + icons. + + * include/functions_reports.php: Tiny fix on update_report() when + checking if report exists. Fixes #2791058. + 2009-06-08 Esteban Sanchez * godmode/setup/file_manager.php: Many fixes to the interface. Removed diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 97eccfadda..3b8af123b5 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -184,12 +184,15 @@ if ($edit_sla_report_content) { $sla_min = (float) get_parameter ('sla_min'); $sla_limit = (float) get_parameter ('sla_limit'); - $sql = sprintf ('INSERT INTO treport_content_sla_combined (id_report_content, - id_agent_module, sla_max, sla_min, sla_limit) VALUES (%d, %d, %f, %f, %f)', - $id_report_content, $id_module, $sla_max, $sla_min, $sla_limit); if ($id_module) { - $result = process_sql ($sql); + $result = process_sql_insert ('treport_content', + array ('id_repport_content' => $id_report_content, + 'id_agent_module' => $id_module, + 'sla_max' => $sla_max, + 'sla_min' => $sla_min, + 'sla_limit' => $sla_limit)); + if ($result !== false) { echo "

".__('SLA was successfully created')."

"; } else { @@ -367,7 +370,7 @@ if ($edit_sla_report_content) { $periods[720] = __('1 month'); $periods[2160] = __('3 months'); $periods[4320] = __('6 months'); - $table->data[1][1] = print_select ($periods, 'period', 0, '', '--', 0, true, false, false); + $table->data[1][1] = print_select ($periods, 'period', 0, '', '--', 0, true, false, false, false); $table->data[2][0] = __('Source agent'); $table->data[2][1] = print_select ($agents, 'id_agent', $id_agent, '', '--', 0, true); @@ -493,12 +496,15 @@ if ($edit_sla_report_content) { $table->head = array (); $table->align = array (); $table->align[2] = 'center'; + $table->align[4] = 'center'; $table->data = array (); $table->head[0] = __('Report name'); $table->head[1] = __('Description'); $table->head[2] = __('Private'); $table->head[3] = __('Group'); - $table->head[4] = __('Delete'); + $table->head[4] = ''; + $table->size = array (); + $table->size[4] = '40px'; foreach ($reports as $report) { diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index b745f4141b..b809c0ff18 100644 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -116,7 +116,7 @@ function create_report ($name, $id_group, $values = false) { * @return bool True if the report was updated. False otherwise. */ function update_report ($id_report, $values) { - $report = get_report ($id_report); + $report = get_report ($id_report, false, array ('id_report')); if ($report === false) return false; return (@process_sql_update ('treport',