diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index cb4c9a652e..c6b863f268 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2013-10-07 Sergio Martin + + * include/styles/pandora.css + include/functions_reporting.php + include/fonts/FreeSans.ttf + include/fonts/FreeSansBold.ttf + include/config_process.php + operation/reporting/reporting_viewer.php + images/pandora_logo_white.jpg + godmode/reporting/reporting_builder.list_items.php + godmode/reporting/reporting_builder.main.php + godmode/reporting/reporting_builder.php: Fix several visual + issues in reports. Update FreeSans font. Add some code for + pdf reports in enterprise side + 2013-10-07 Junichi Satoh * extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql, diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index f6482bd154..d2bcad85a6 100644 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -155,6 +155,7 @@ $table->data[0][2] = __('Modules'); $table->data[0][3] = html_print_select($modules, 'module_filter', $moduleFilter, '', __('All'), 0, true); $table->data[1][0] = __('Type'); $table->data[1][1] = html_print_select($types, 'type_filter', $typeFilter, '', __('All'), 0, true); +$table->data[1][2] = $table->data[1][3] = ''; echo ''; break; } } - \ No newline at end of file + diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 8fbccdcff1..99558035b2 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -290,7 +290,7 @@ switch ($action) { $search_name = "%$search%' OR description LIKE '%$search%"; } - $table_aux->width = '98%'; + $table_aux->width = '99%'; $table_aux->colspan[0][0] = 4; $table_aux->data[0][0] = "". __("Group") . ""; diff --git a/pandora_console/images/pandora_logo_white.jpg b/pandora_console/images/pandora_logo_white.jpg new file mode 100644 index 0000000000..6d87852134 Binary files /dev/null and b/pandora_console/images/pandora_logo_white.jpg differ diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 0b58bd433a..02b0a892d3 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -42,7 +42,7 @@ if ($develop_bypass != 1) { if (version_compare(PHP_VERSION, '5.3.0') >= 0) { - error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT); + error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE); } else { @@ -56,7 +56,7 @@ else { // Develop mode, show all notices and errors on Console (and log it) if (version_compare(PHP_VERSION, '5.3.0') >= 0) { - error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); + error_reporting(E_ALL & ~E_DEPRECATED); } else { diff --git a/pandora_console/include/fonts/FreeSans.ttf b/pandora_console/include/fonts/FreeSans.ttf index 5909637eef..9db958532c 100755 Binary files a/pandora_console/include/fonts/FreeSans.ttf and b/pandora_console/include/fonts/FreeSans.ttf differ diff --git a/pandora_console/include/fonts/FreeSansBold.ttf b/pandora_console/include/fonts/FreeSansBold.ttf new file mode 100755 index 0000000000..63644e7437 Binary files /dev/null and b/pandora_console/include/fonts/FreeSansBold.ttf differ diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index c6990c9bf3..e07e902d34 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2907,8 +2907,8 @@ function reporting_header_content($mini, $content, $report, &$table, $title = fa else { $data[] = "
" . $sizh . "(" . human_time_description_raw ($content['period']) . ") " . - __("From:") . " " . date($config["date_format"], $report["datetime"]) . "
" . - __("To:") . " " . date($config["date_format"], $report["datetime"] - $content['period']) . "
" . + __("From:") . " " . date($config["date_format"], $report["datetime"] - $content['period']) . "
" . + __("To:") . " " . date($config["date_format"], $report["datetime"]) . "
" . $sizhfin . "
"; } @@ -2982,16 +2982,21 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f ui_print_truncate_text($module_name, 'module_medium', false)); //RUNNING - $table->colspan[1][0] = 4; + + $next_row = 1; // Put description at the end of the module (if exists) - $table->colspan[2][0] = 4; if ($content["description"] != "") { $data_desc = array(); $data_desc[0] = $content["description"]; array_push ($table->data, $data_desc); + $table->colspan[$next_row][0] = 3; + $next_row++; } + $table->colspan[$next_row][0] = 3; + $table->cellstyle[$next_row][0] = 'text-align: center;'; + $data = array (); $moduletype_name = modules_get_moduletype_name( @@ -3026,14 +3031,18 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f set_time_limit(500); + $next_row = 1; // Put description at the end of the module (if exists) - $table->colspan[2][0] = 4; if ($content["description"] != "") { $data_desc = array(); $data_desc[0] = $content["description"]; array_push ($table->data, $data_desc); + $table->colspan[$next_row][0] = 3; + $next_row++; } + $table->colspan[$next_row][0] = 3; + $table->cellstyle[$next_row][0] = 'text-align: center;'; $data = array (); $output_projection = forecast_projection_graph($content['id_agent_module'], $content['period'], $content['top_n_value']); @@ -3518,6 +3527,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f '
'.ui_print_truncate_text($module_name, 'module_medium', false)); //RUNNING + $next_row = 1; // Put description at the end of the module (if exists) if ($content["description"] != "") { @@ -3525,6 +3535,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $data_desc = array(); $data_desc[0] = $content["description"]; array_push ($table->data, $data_desc); + $next_row++; } $data = array (); @@ -3535,6 +3546,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f else { $monitor_value = format_numeric ($monitor_value); } + + $table->colspan[$next_row][0] = 2; $data[0] = '

'; $data[0] .= html_print_image("images/module_ok.png", true) . ' ' . __('OK') . ': ' . $monitor_value.' %

'; if ($monitor_value !== __('Unknown')) { @@ -3611,7 +3624,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f //RUNNING // Put description at the end of the module (if exists) - $table->colspan[0][0] = 2; + $table->colspan[1][0] = 3; if ($content["description"] != "") { $data_desc = array(); $data_desc[0] = $content["description"]; @@ -3619,7 +3632,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f } $data = array (); - $table->colspan[1][0] = 2; + $table->colspan[2][0] = 3; + $value = reporting_get_agentmodule_data_min ($content['id_agent_module'], $content['period'], $report["datetime"]); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $content ['id_agent_module']); if ($value === false) { @@ -3640,16 +3654,20 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f //RUNNING + $next_row = 1; + // Put description at the end of the module (if exists) - $table->colspan[0][0] = 2; if ($content["description"] != "") { $data_desc = array(); $data_desc[0] = $content["description"]; array_push ($table->data, $data_desc); + $table->colspan[$next_row][0] = 3; + $next_row++; } + $table->colspan[$next_row][0] = 3; + $data = array (); - $table->colspan[1][0] = 2; $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $content['id_agent_module']); $value = reporting_get_agentmodule_data_sum ($content['id_agent_module'], $content['period'], $report["datetime"]); @@ -3852,9 +3870,14 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $cellContent = html_print_table($table2, true); array_push($table->data, array($cellContent)); break; - case 'sql_graph_pie': case 'sql_graph_vbar': case 'sql_graph_hbar': + case 'sql_graph_pie': + $sizgraph_h = 300; + + if ($content['type'] == 'sql_graph_vbar') { + $sizgraph_h = 400; + } if ($config['metaconsole'] == 1 && defined('METACONSOLE')) metaconsole_restore_db(); @@ -3863,13 +3886,17 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f "", ""); // Put description at the end of the module (if exists) - $table->colspan[0][0] = 2; + $next_row = 1; if ($content["description"] != "") { $data_desc = array(); $data_desc[0] = $content["description"]; array_push ($table->data, $data_desc); + $table->colspan[$next_row][0] = 3; + $next_row++; } + $table->colspan[$next_row][0] = 3; + $table2->class = 'databox'; $table2->width = '100%'; @@ -3881,7 +3908,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $data = array (); - $data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, 200, $content["type"], true, ui_get_full_url(false) . '/'); + $data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, $sizgraph_h, $content["type"], true, ui_get_full_url(false) . '/'); array_push($table->data, $data); break; @@ -4118,14 +4145,18 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f ui_print_truncate_text($module_name, 'module_medium', false)); // Put description at the end of the module (if exists) - $table->colspan[1][0] = 3; + $next_row = 1; if ($content["description"] != "") { $data_desc = array(); $data_desc[0] = $content["description"]; + $table->colspan[$next_row][0] = 3; array_push ($table->data, $data_desc); + $next_row++; } - $table2->class = 'databox'; + $table->colspan[$next_row][0] = 3; + + $table2->class = 'databox alternate'; $table2->width = '100%'; //Create the head @@ -4184,7 +4215,6 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $cellContent = html_print_table($table2, true); array_push($table->data, array($cellContent)); - $table->colspan[1][0] = 2; break; case 'TTRT': reporting_header_content($mini, $content, $report, $table, __('TTRT'), @@ -4322,7 +4352,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $table->colspan[2][0] = 3; - $table->data[2][0] = html_print_table($table2, true) . + $table->data[2][0] = " @@ -5513,7 +5543,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f } $table->colspan[3][0] = 3; - + $table->cellstyle[3][0] = 'text-align: center;'; + $data = array(); if ($show_graph == 1 || $show_graph == 2) { $data[0] = pie3d_graph(false, $data_pie_graph, @@ -5522,7 +5553,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f array_push ($table->data, $data); //Display bars graph $table->colspan[4][0] = 3; - $height = count($data_pie_graph) * 20 + 35; + $table->cellstyle[4][0] = 'text-align: center;'; + $height = count($data_pie_graph) * 20 + 85; $data = array(); $data[0] = hbar_graph(false, $data_hbar, 600, $height, array(), array(), "", "", true, ui_get_full_url(false) . '/', $config['homedir'] . "/images/logo_vertical_water.png", '', '', true, 1, true); @@ -5545,6 +5577,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $table_summary->data[0][2] = format_for_graph($max,2); $table->colspan[5][0] = 3; + $table->cellstyle[5][0] = 'text-align: center;'; array_push ($table->data, array(''.__('Summary').'')); $table->colspan[6][0] = 3; array_push ($table->data, array(html_print_table($table_summary, true))); @@ -5631,13 +5664,13 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f } $table_data = '
'; - $table_data .= ""; + $table_data .= ""; $nmodules = 0; foreach ($modules_by_name as $module) { $nmodules++; - $file_name = string2image(ui_print_truncate_text($module['name'], 'module_small', false, true, false, '...'), false, false, 6, 270, '#90B165', 'FFF', 4, 0); + $file_name = string2image(ui_print_truncate_text($module['name'], 'module_small', false, true, false, '...'), false, false, 6, 270, '#B1B1B1', 'FFF', 4, 0); $table_data .= '"; } // Dont use pagination @@ -5659,26 +5692,26 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f switch($agent_status) { case 4: // Alert fired status - $rowcolor = '#ffa300'; + $rowcolor = COL_ALERTFIRED; $textcolor = '#000'; break; case 1: // Critical status - $rowcolor = '#bc0000'; + $rowcolor = COL_CRITICAL; $textcolor = '#FFF'; break; case 2: // Warning status - $rowcolor = '#f2ef00'; + $rowcolor = COL_WARNING; $textcolor = '#000'; break; case 0: // Normal status - $rowcolor = '#8ae234'; - $textcolor = '#000'; + $rowcolor = COL_NORMAL; + $textcolor = '#FFF'; break; case 3: case -1: default: // Unknown status - $rowcolor = '#babdb6'; - $textcolor = '#000'; + $rowcolor = COL_UNKNOWN; + $textcolor = '#FFF'; break; } @@ -5737,30 +5770,17 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $table_data .= "
".__("Agents")." / ".__("Modules")."".__("Agents")." / ".__("Modules")."' . html_print_image($file_name, true, array('title' => $module['name']))."
"; - $table_data .= "

" . __("The colours meaning:") . - "

" . - "

"; + $table_data .= "
"; + + $table_data .= ""; + $table_data .= ""; + $table_data .= ""; + $table_data .= ""; + $table_data .= ""; + $table_data .= ""; + $table_data .= ""; + $table_data .= "
" . __('Legend') . "
" . __("Orange cell when the module has fired alerts") . "
" . __("Red cell when the module has a critical status") . "
" . __("Yellow cell when the module has a warning status") . "
" . __("Green cell when the module has a normal status") . "
" . __("Grey cell when the module has an unknown status") . "
"; + $table_data .= "
"; $data = array (); $table->colspan[2][0] = 3; $data[0] = $table_data; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 16a47ffa04..de47d3d219 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -77,6 +77,11 @@ input.button { padding: 2px 3px; margin: 10px 15px; } + +input[type=submit], input[type=button] { + cursor: pointer; +} + select { border:1px solid #ddd; } @@ -2207,49 +2212,49 @@ div.cellWhite { div.cellNormal { width: 100%; height: 100%; - background: #008e00; + background: #6EB432; color: #fff; } div.cellCritical { width: 100%; height: 100%; - background: #cc0000; + background: #FF4040; color: #fff; } div.cellWarning { width: 100%; height: 100%; - background: #fce94f; + background: #F2D400; color: #111; } div.cellUnknown { width: 100%; height: 100%; - background: #babdb6; - color: #3F3F3F; + background: #AAAAAA; + color: #FFFFFF; } div.cellNotInit { width: 100%; height: 100%; - background: #729fcf; - color: #111; + background: #3BA0FF; + color: #FFFFFF; } div.cellAlert { width: 100%; height: 100%; - background: #ffa300; + background: #FF8800; color: #111; } div.cellBorder1 { width: 100%; height: 100%; - border: 1px solid black; + border: 1px solid #666; } div.cellBig { diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 021a919ea0..40531f356a 100644 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -63,6 +63,10 @@ $enable_init_date = get_parameter('enable_init_date', 0); $url = "index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=$id_report&date=$date&time=$time&pure=$pure"; +$options['list_reports'] = array('active' => false, + 'text' => '' . + html_print_image("images/report_list.png", true, array ("title" => __('Report list'))) .''); + if (check_acl ($config['id_user'], 0, "RW")) { $options['main']['text'] = '' . html_print_image("images/op_reporting.png", true, array ("title" => __('Main data'))) .''; @@ -81,10 +85,6 @@ $options['view'] = array('active' => true, 'text' => '' . html_print_image("images/operation.png", true, array ("title" => __('View report'))) .''); -$options['list_reports'] = array('active' => false, - 'text' => '' . - html_print_image("images/report_list.png", true, array ("title" => __('Report list'))) .''); - if (!defined('METACONSOLE')) { if ($config["pure"] == 0) { $options['screen']['text'] = "" @@ -123,10 +123,11 @@ if ($enable_init_date) { } $table->id = 'controls_table'; -$table->width = '98%'; +$table->width = '99%'; $table->class = 'databox'; $table->style = array (); $table->style[0] = 'width: 60px;'; +$table->rowspan[0][0] = 2; // Set initial conditions for these controls, later will be modified by javascript if (!$enable_init_date) { @@ -145,7 +146,6 @@ else { $table->size = array (); $table->size[0] = '60px'; $table->colspan[0][1] = 2; -$table->rowspan[0][0] = 2; $table->style[0] = 'text-align:center;'; $table->data = array (); $table->data[0][0] = html_print_image("images/reporting32.png", true, array("width" => "32", "height" => "32")); @@ -179,6 +179,9 @@ html_print_table ($table); html_print_input_hidden ('id_report', $id_report); echo ''; +// The rowspan of the first row is only 2 in controls table. Why is used the same code here and in the items?? +$table->rowspan[0][0] = 1; + echo '
'; echo html_print_image("images/wait.gif", true, array("border" => '0')); echo ''.__('Loading').'...';