diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e4decfb76a..ae5eec55e9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-05-04 Sergio Martin + + * include/functions_reporting.php: Added "mini" + parameter. Usefull for print the report with less + size + 2010-05-04 Sergio Martin * godmode/agentes/module_manager_editor_common.php: diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index fd9a871fa2..9bf8f0a36a 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1442,12 +1442,25 @@ function get_agent_module_info_with_filter ($id_agent,$filter = '') { * @param array $content Record of treport_content table for current item * @param array $table HTML Table row * @param array $report Report contents, with some added fields. + * @param array $mini Mini flag for reduce the size. * */ -function render_report_html_item ($content, $table, $report) { +function render_report_html_item ($content, $table, $report, $mini = false) { global $config; + + if($mini){ + $sizh = 'h6'; + $sizem = '1.5'; + $sizgraph_w = '350'; + } + else{ + $sizh = 'h4'; + $sizem = '3'; + $sizgraph_w = '350'; + } + $module_name = get_db_value ('nombre', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module']); $agent_name = get_agentmodule_agent_name ($content['id_agent_module']); @@ -1457,9 +1470,9 @@ function render_report_html_item ($content, $table, $report) { //RUNNING $table->colspan[1][0] = 4; $data = array (); - $data[0] = '

'.__('Simple graph').'

'; - $data[1] = '

'.$agent_name.' - '.$module_name.'

'; - $data[2] = '

'.human_time_description ($content['period']).'

'; + $data[0] = '<'.$sizh.'>'.__('Simple graph').''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; + $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1471,7 +1484,7 @@ function render_report_html_item ($content, $table, $report) { } $data = array (); - $data[0] = ''; + $data[0] = ''; array_push ($table->data, $data); break; @@ -1481,9 +1494,9 @@ function render_report_html_item ($content, $table, $report) { //RUNNING $graph = get_db_row ("tgraph", "id_graph", $content['id_gs']); $data = array (); - $data[0] = '

'.__('Custom graph').'

'; - $data[1] = "

".$graph["name"]."

"; - $data[2] = "

".human_time_description ($content['period'])."

"; + $data[0] = '<'.$sizh.'>'.__('Custom graph').''; + $data[1] = '<'.$sizh.'>'.$graph['name'].''; + $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1511,7 +1524,7 @@ function render_report_html_item ($content, $table, $report) { $table->colspan[2][0] = 3; $data = array (); - $data[0] = ''; + $data[0] = ''; array_push ($table->data, $data); break; @@ -1520,8 +1533,8 @@ function render_report_html_item ($content, $table, $report) { //RUNNING $table->style[1] = 'text-align: right'; $data = array (); - $data[0] = '

'.__('S.L.A.').'

'; - $data[1] = '

'.human_time_description ($content['period']).'

';; + $data[0] = '<'.$sizh.'>'.__('S.L.A.').''; + $data[1] = '<'.$sizh.'>'.human_time_description ($content['period']).'';; $n = array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1559,14 +1572,14 @@ function render_report_html_item ($content, $table, $report) { $sla_value = get_agentmodule_sla ($sla['id_agent_module'], $content['period'], $sla['sla_min'], $sla['sla_max'], $report["datetime"]); if ($sla_value === false) { - $data[1] = ''; + $data[1] = ''; $data[1] .= __('Unknown'); } else { if ($sla_value >= $sla['sla_limit']) - $data[1] = ''; + $data[1] = ''; else { $sla_failed = true; - $data[1] = ''; + $data[1] = ''; } $data[1] .= format_numeric ($sla_value). " %"; } @@ -1577,9 +1590,9 @@ function render_report_html_item ($content, $table, $report) { if (!empty ($slas)) { $data = array (); if ($sla_failed == false) - $data[0] = ''.__('OK').''; + $data[0] = ''.__('OK').''; else - $data[0] = ''.__('Fail').''; + $data[0] = ''.__('Fail').''; $n = array_push ($table->data, $data); $table->colspan[$n - 1][0] = 3; $table->rowstyle[$n - 1] = 'text-align: right'; @@ -1590,8 +1603,8 @@ function render_report_html_item ($content, $table, $report) { // case 'event_report': // $id_agent = get_agent_id ($agent_name); // $data = array (); -// $data[0] = "

".__('Event report')."

"; -// $data[1] = "

".human_time_description ($content['period'])."

"; +// $data[0] = '<'.$sizh.'>'.__('Event report').''; +// $data[1] = '<'.$sizh.'>'.human_time_description ($content['period']).''; // array_push ($table->data, $data); // // // Put description at the end of the module (if exists) @@ -1615,9 +1628,9 @@ function render_report_html_item ($content, $table, $report) { // case 5: // case 'alert_report': // $data = array (); -// $data[0] = "

".__('Alert report')."

"; -// $data[1] = "

".$report["group_name"]."

"; -// $data[2] = "

".human_time_description ($content['period'])."

"; +// $data[0] = '<'.$sizh.'>'.__('Alert report').''; +// $data[1] = '<'.$sizh.'>'.$report['group_name'].''; +// $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; // array_push ($table->data, $data); // // // Put description at the end of the module (if exists) @@ -1638,9 +1651,9 @@ function render_report_html_item ($content, $table, $report) { case 'monitor_report': //RUNNING $data = array (); - $data[0] = "

".__('Monitor report')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; + $data[0] = '<'.$sizh.'>'.__('Monitor report').''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; + $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1653,10 +1666,10 @@ function render_report_html_item ($content, $table, $report) { $data = array (); $monitor_value = format_numeric (get_agentmodule_sla ($content['id_agent_module'], $content['period'], 1, false, $report["datetime"])); - $data[0] = '

'; + $data[0] = '

'; $data[0] .= $monitor_value.' %

'; $monitor_value = format_numeric (100 - $monitor_value, 2) ; - $data[1] = '

'; + $data[1] = '

'; $data[1] .= $monitor_value.' %

'; array_push ($table->data, $data); @@ -1665,9 +1678,9 @@ function render_report_html_item ($content, $table, $report) { case 'avg_value': //RUNNING $data = array (); - $data[0] = "

".__('Avg. Value')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; + $data[0] = '<'.$sizh.'>'.__('Avg. Value').''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; + $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1681,7 +1694,7 @@ function render_report_html_item ($content, $table, $report) { $data = array (); $table->colspan[2][0] = 3; $value = format_numeric (get_agentmodule_data_average ($content['id_agent_module'], $content['period'], $report["datetime"])); - $data[0] = '

'.$value.'

'; + $data[0] = '

'.$value.'

'; array_push ($table->data, $data); break; @@ -1689,9 +1702,9 @@ function render_report_html_item ($content, $table, $report) { case 'max_value': //RUNNING $data = array (); - $data[0] = "

".__('Max. Value')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; + $data[0] = '<'.$sizh.'>'.__('Max. Value').''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; + $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1705,7 +1718,7 @@ function render_report_html_item ($content, $table, $report) { $data = array (); $table->colspan[2][0] = 3; $value = format_numeric (get_agentmodule_data_max ($content['id_agent_module'], $content['period'], $report["datetime"])); - $data[0] = '

'.$value.'

'; + $data[0] = '

'.$value.'

'; array_push ($table->data, $data); break; @@ -1713,9 +1726,9 @@ function render_report_html_item ($content, $table, $report) { case 'min_value': //RUNNING $data = array (); - $data[0] = "

".__('Min. Value')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; + $data[0] = '<'.$sizh.'>'.__('Min. Value').''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; + $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1729,7 +1742,7 @@ function render_report_html_item ($content, $table, $report) { $data = array (); $table->colspan[1][0] = 2; $value = format_numeric (get_agentmodule_data_min ($content['id_agent_module'], $content['period'], $report["datetime"])); - $data[0] = '

'.$value.'

'; + $data[0] = '

'.$value.'

'; array_push ($table->data, $data); break; @@ -1737,9 +1750,9 @@ function render_report_html_item ($content, $table, $report) { case 'sumatory': //RUNNING $data = array (); - $data[0] = "

".__('Sumatory')."

"; - $data[1] = "

$agent_name - $module_name

"; - $data[2] = "

".human_time_description ($content['period'])."

"; + $data[0] = '<'.$sizh.'>'.__('Sumatory').''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; + $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1753,15 +1766,15 @@ function render_report_html_item ($content, $table, $report) { $data = array (); $table->colspan[1][0] = 2; $value = format_numeric (get_agentmodule_data_sum ($content['id_agent_module'], $content['period'], $report["datetime"])); - $data[0] = '

'.$value.'

'; + $data[0] = '

'.$value.'

'; array_push ($table->data, $data); break; // case 11: // case 'general_group_report': // $data = array (); -// $data[0] = "

".__('Group')."

"; -// $data[1] = "

".$report["group_name"]."

"; +// $data[0] = '<'.$sizh.'>'.__('Group').''; +// $data[1] = '<'.$sizh.'>'.$report['group_name'].''; // array_push ($table->data, $data); // // // Put description at the end of the module (if exists) @@ -1781,9 +1794,9 @@ function render_report_html_item ($content, $table, $report) { // case 12: // case 'monitor_health': // $data = array (); -// $data[0] = "

".__('Monitor health')."

"; -// $data[1] = "

".$report["group_name"]."

"; -// $data[2] = "

".human_time_description ($content['period'])."

"; +// $data[0] = '<'.$sizh.'>'.__('Monitor health').''; +// $data[1] = '<'.$sizh.'>'.$report["group_name"].''; +// $data[2] = '<'.$sizh.'>'.human_time_description ($content['period']).''; // array_push ($table->data, $data); // // // Put description at the end of the module (if exists) @@ -1803,8 +1816,8 @@ function render_report_html_item ($content, $table, $report) { // case 13: // case 'agents_detailed': // $data = array (); -// $data[0] = "

".__('Agents detailed view')."

"; -// $data[1] = "

".$report["group_name"]."

"; +// $data[0] = '<'.$sizh.'>'.__('Agents detailed view').''; +// $data[1] = '<'.$sizh.'>'.$report["group_name"].''; // array_push ($table->data, $data); // // // Put description at the end of the module (if exists) @@ -1825,8 +1838,8 @@ function render_report_html_item ($content, $table, $report) { case 'event_report_agent': //RUNNING $data = array (); - $data[0] = "

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

"; - $data[1] = "

".get_agent_name($content['id_agent'])."

"; + $data[0] = '<'.$sizh.'>'.__('Agent detailed event').''; + $data[1] = '<'.$sizh.'>'.get_agent_name($content['id_agent']).''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1844,7 +1857,7 @@ function render_report_html_item ($content, $table, $report) { break; case 'text': $data = array(); - $data[0] = "

" . __('Text') . "

"; + $data[0] = '<'.$sizh.'>' . __('Text') . ''; array_push ($table->data, $data); $table->colspan[0][0] = 2; @@ -1861,7 +1874,7 @@ function render_report_html_item ($content, $table, $report) { break; case 'sql': $data = array(); - $data[0] = "

" . __('SQL') . "

"; + $data[0] = '<'.$sizh.'>' . __('SQL') . ''; array_push ($table->data, $data); $table->colspan[0][0] = 2; @@ -1910,8 +1923,8 @@ function render_report_html_item ($content, $table, $report) { break; case 'event_report_module': $data = array (); - $data[0] = "

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

"; - $data[1] = "

$agent_name - $module_name

"; + $data[0] = '<'.$sizh.'>' . __('Module detailed event') . ''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1929,8 +1942,8 @@ function render_report_html_item ($content, $table, $report) { break; case 'alert_report_module': $data = array (); - $data[0] = "

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

"; - $data[1] = "

$agent_name - $module_name

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

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

"; - $data[1] = "

$agent_name

"; + $data[0] = '<'.$sizh.'>' . __('Alert report agent') . ''; + $data[1] = '<'.$sizh.'>'.$agent_name.''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1968,7 +1981,7 @@ function render_report_html_item ($content, $table, $report) { case 'url': $table->colspan[1][0] = 2; $data = array (); - $data[0] = "

" . __('Import text from URL') . "

"; + $data[0] = '<'.$sizh.'>' . __('Import text from URL') . ''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -1991,8 +2004,8 @@ function render_report_html_item ($content, $table, $report) { break; case 'database_serialized': $data = array (); - $data[0] = "

" . __('Serialize data') . "

"; - $data[1] = "

$agent_name - $module_name

"; + $data[0] = '<'.$sizh.'>' . __('Serialize data') . ''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -2041,8 +2054,8 @@ function render_report_html_item ($content, $table, $report) { break; case 'TTRT': $data = array (); - $data[0] = "

" . __('TTRT') . "

"; - $data[1] = "

$agent_name - $module_name

"; + $data[0] = '<'.$sizh.'>' . __('TTRT') . ''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -2062,8 +2075,8 @@ function render_report_html_item ($content, $table, $report) { break; case 'TTO': $data = array (); - $data[0] = "

" . __('TTO') . "

"; - $data[1] = "

$agent_name - $module_name

"; + $data[0] = '<'.$sizh.'>' . __('TTO') . ''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -2083,8 +2096,8 @@ function render_report_html_item ($content, $table, $report) { break; case 'MTBF': $data = array (); - $data[0] = "

" . __('MTBF') . "

"; - $data[1] = "

$agent_name - $module_name

"; + $data[0] = '<'.$sizh.'>' . __('MTBF') . ''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; array_push ($table->data, $data); // Put description at the end of the module (if exists) @@ -2104,8 +2117,8 @@ function render_report_html_item ($content, $table, $report) { break; case 'MTTR': $data = array (); - $data[0] = "

" . __('MTTR') . "

"; - $data[1] = "

$agent_name - $module_name

"; + $data[0] = '<'.$sizh.'>' . __('MTTR') . ''; + $data[1] = '<'.$sizh.'>'.$agent_name.' - '.$module_name.''; array_push ($table->data, $data); // Put description at the end of the module (if exists)