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

* 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".



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2654 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-05-03 12:02:56 +00:00
parent 0964265d71
commit 66f8330894
3 changed files with 39 additions and 14 deletions

View File

@ -1,4 +1,15 @@
2010-04-30 Miguel de Dios <miguel.dedios@artica.es>
2010-05-03 Miguel de Dios <miguel.dedios@artica.es>
* 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 <miguel.dedios@artica.es>
* include/functions_reporting.php: added the parameter "$html" in the
function "get_module_detailed_event_reporting", this flag is for return

View File

@ -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', '');

View File

@ -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] = "<h4>" . __('Agent detailed event') . "</h4>";
$data[1] = "<h4>$agent_name</h4>";
$data[0] = "<h4>" . __('Alert report module') . "</h4>";
$data[1] = "<h4>$agent_name - $module_name</h4>";
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] = "<h4>" . __('Module detailed event') . "</h4>";
$data[1] = "<h4>$agent_name - $module_name</h4>";
$data[0] = "<h4>" . __('Alert report agent') . "</h4>";
$data[1] = "<h4>$agent_name</h4>";
array_push ($table->data, $data);
// Put description at the end of the module (if exists)