diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 718b13ffbf..b600d5232a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,4 +1,15 @@ -2010-04-30 Miguel de Dios +2010-05-03 Miguel de Dios + + * include/functions_reporting.php: added the parameter "$html" in the + function "alert_reporting_agent" and "alert_reporting_module", this flag is + for return the html table or object table, by default the html. And fixed + the title of "alert_report_module" and "alert_report_agent", fixed return + of list "event_report_module" in the function "render_report_html_item". + + * godmode/reporting/reporting_builder.item_editor.php: fixed the lost field + "period" in the item "database_serialized". + +2010-05-03 Miguel de Dios * include/functions_reporting.php: added the parameter "$html" in the function "get_module_detailed_event_reporting", this flag is for return diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 46a247d267..9710285136 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -133,6 +133,7 @@ switch ($action) { $header = $item['header_definition']; $field = $item['column_separator']; $line = $item['line_separator']; + $period = $item['period']; break; case 'TTRT': $description = $item['description']; @@ -621,6 +622,7 @@ function chooseType() { $("#row_header").css('display', ''); $("#row_field_separator").css('display', ''); $("#row_line_separator").css('display', ''); + $("#row_period").css('display', ''); break; case 'TTRT': $("#row_description").css('display', ''); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index e127975ecd..fd9a871fa2 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -579,10 +579,11 @@ function get_fired_alerts_reporting_table ($alerts_fired) { * @param int $period Period of time of the desired alert report. * @param int $date Beggining date of the report (current date by default). * @param bool $return Flag to return or echo the report (echo by default). - * - * @return string + * @param bool Flag to return the html or table object, by default html. + * + * @return mixed A table object (XHTML) or object table is false the html. */ -function alert_reporting_agent ($id_agent, $period = 0, $date = 0, $return = true) { +function alert_reporting_agent ($id_agent, $period = 0, $date = 0, $return = true, $html = true) { if (!is_numeric ($date)) { $date = strtotime ($date); } @@ -643,7 +644,12 @@ function alert_reporting_agent ($id_agent, $period = 0, $date = 0, $return = tru } } - return print_table ($table, $return); + if ($html) { + return print_table ($table, $return); + } + else { + return $table; + } } /** @@ -655,10 +661,11 @@ function alert_reporting_agent ($id_agent, $period = 0, $date = 0, $return = tru * @param int $period Period of time of the desired alert report. * @param int $date Beggining date of the report (current date by default). * @param bool $return Flag to return or echo the report (echo by default). - * - * @return string + * @param bool Flag to return the html or table object, by default html. + * + * @return mixed A table object (XHTML) or object table is false the html. */ -function alert_reporting_module ($id_agent_module, $period = 0, $date = 0, $return = true) { +function alert_reporting_module ($id_agent_module, $period = 0, $date = 0, $return = true, $html = true) { if (!is_numeric ($date)) { $date = strtotime ($date); } @@ -719,7 +726,12 @@ function alert_reporting_module ($id_agent_module, $period = 0, $date = 0, $retu array_push ($table->data, $data); } - return print_table ($table, $return); + if ($html) { + return print_table ($table, $return); + } + else { + return $table; + } } /** @@ -1912,13 +1924,13 @@ function render_report_html_item ($content, $table, $report) { $data = array (); $table->colspan[2][0] = 3; - $data[0] = get_module_detailed_event_reporting($content['id_agent_module'], $content['period'], $report["datetime"]); + $data[0] = get_module_detailed_event_reporting($content['id_agent_module'], $content['period'], $report["datetime"], true); array_push ($table->data, $data); break; case 'alert_report_module': $data = array (); - $data[0] = "

" . __('Agent detailed event') . "

"; - $data[1] = "

$agent_name

"; + $data[0] = "

" . __('Alert report module') . "

"; + $data[1] = "

$agent_name - $module_name

"; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1936,8 +1948,8 @@ function render_report_html_item ($content, $table, $report) { break; case 'alert_report_agent': $data = array (); - $data[0] = "

" . __('Module detailed event') . "

"; - $data[1] = "

$agent_name - $module_name

"; + $data[0] = "

" . __('Alert report agent') . "

"; + $data[1] = "

$agent_name

"; array_push ($table->data, $data); // Put description at the end of the module (if exists)