2013-10-07 Sergio Martin <sergio.martin@artica.es>

* 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



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8858 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-10-07 08:38:41 +00:00
parent 8f5c8146ce
commit 2f555980ce
11 changed files with 115 additions and 71 deletions

View File

@ -1,3 +1,18 @@
2013-10-07 Sergio Martin <sergio.martin@artica.es>
* 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 <junichi@rworks.jp>
* extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,

View File

@ -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 '<div id="form_filter" style="display: none;">';
echo '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report=' . $idReport . '">';
@ -230,7 +231,7 @@ $table->style[0] = 'text-align: right;';
if ($items) {
$table->width = '100%';
$table->width = '98%';
$table->size = array();
$table->size[0] = '5px';

View File

@ -115,4 +115,4 @@ echo '</div></form>';
break;
}
}
</script>
</script>

View File

@ -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] = "<b>". __("Group") . "</b>";

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -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
{

Binary file not shown.

View File

@ -2907,8 +2907,8 @@ function reporting_header_content($mini, $content, $report, &$table, $title = fa
else {
$data[] = "<div style='text-align: right;'>" . $sizh .
"(" . human_time_description_raw ($content['period']) . ") " .
__("From:") . " " . date($config["date_format"], $report["datetime"]) . "<br />" .
__("To:") . " " . date($config["date_format"], $report["datetime"] - $content['period']) . "<br />" .
__("From:") . " " . date($config["date_format"], $report["datetime"] - $content['period']) . "<br />" .
__("To:") . " " . date($config["date_format"], $report["datetime"]) . "<br />" .
$sizhfin . "</div>";
}
@ -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
' <br> '.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] = '<p style="font: bold '.$sizem.'em Arial, Sans-serif; color: ' . COL_NORMAL . ';">';
$data[0] .= html_print_image("images/module_ok.png", true) . ' ' . __('OK') . ': ' . $monitor_value.' %</p>';
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] =
"<table width='100%'>
<tr>
<td></td>
@ -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('<b>'.__('Summary').'</b>'));
$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 cellpadding="1" cellspacing="4" cellspacing="0" border="0" style="background-color: #EEE;">';
$table_data .= "<th style='background-color: #799E48;'>".__("Agents")." / ".__("Modules")."</th>";
$table_data .= "<th>".__("Agents")." / ".__("Modules")."</th>";
$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 .= '<th width="22px">' . html_print_image($file_name, true, array('title' => $module['name']))."</th>";
}
// 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 .= "</table>";
$table_data .= "<br><br><p>" . __("The colours meaning:") .
"<ul style='float: left;'>" .
'<li style="clear: both;">
<div style="float: left; background: #ffa300; height: 14px; width: 26px;margin-right: 5px; margin-bottom: 5px;">&nbsp;</div>' .
__("Orange cell when the module has fired alerts") .
'</li>' .
'<li style="clear: both;">
<div style="float: left; background: #cc0000; height: 14px; width: 26px;margin-right: 5px; margin-bottom: 5px;">&nbsp;</div>' .
__("Red cell when the module has a critical status") .
'</li>' .
'<li style="clear: both;">
<div style="float: left; background: #fce94f; height: 14px; width: 26px;margin-right: 5px; margin-bottom: 5px;">&nbsp;</div>' .
__("Yellow cell when the module has a warning status") .
'</li>' .
'<li style="clear: both;">
<div style="float: left; background: #8ae234; height: 14px; width: 26px;margin-right: 5px; margin-bottom: 5px;">&nbsp;</div>' .
__("Green cell when the module has a normal status") .
'</li>' .
'<li style="clear: both;">
<div style="float: left; background: #babdb6; height: 14px; width: 26px;margin-right: 5px; margin-bottom: 5px;">&nbsp;</div>' .
__("Grey cell when the module has an unknown status") .
'</li>' .
"</ul>" .
"</p>";
$table_data .= "<div class='legend_basic' style='width: 96%'>";
$table_data .= "<table>";
$table_data .= "<tr><td colspan='2' style='padding-bottom: 10px;'><b>" . __('Legend') . "</b></td></tr>";
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_ALERTFIRED . ";'></div></td><td>" . __("Orange cell when the module has fired alerts") . "</td></tr>";
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_CRITICAL . ";'></div></td><td>" . __("Red cell when the module has a critical status") . "</td></tr>";
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_WARNING . ";'></div></td><td>" . __("Yellow cell when the module has a warning status") . "</td></tr>";
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NORMAL . ";'></div></td><td>" . __("Green cell when the module has a normal status") . "</td></tr>";
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_UNKNOWN . ";'></div></td><td>" . __("Grey cell when the module has an unknown status") . "</td></tr>";
$table_data .= "</table>";
$table_data .= "</div>";
$data = array ();
$table->colspan[2][0] = 3;
$data[0] = $table_data;

View File

@ -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 {

View File

@ -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' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">' .
html_print_image("images/report_list.png", true, array ("title" => __('Report list'))) .'</a>');
if (check_acl ($config['id_user'], 0, "RW")) {
$options['main']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=edit&id_report=' . $id_report . '&pure='.$pure.'">' .
html_print_image("images/op_reporting.png", true, array ("title" => __('Main data'))) .'</a>';
@ -81,10 +85,6 @@ $options['view'] = array('active' => true,
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=' . $id_report . '&pure='.$pure.'">' .
html_print_image("images/operation.png", true, array ("title" => __('View report'))) .'</a>');
$options['list_reports'] = array('active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">' .
html_print_image("images/report_list.png", true, array ("title" => __('Report list'))) .'</a>');
if (!defined('METACONSOLE')) {
if ($config["pure"] == 0) {
$options['screen']['text'] = "<a href='$url&pure=1&enable_init_date=$enable_init_date&date_init=$date_init&time_init=$time_init'>"
@ -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 '</form>';
// 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 '<div id="loading" style="text-align: center;">';
echo html_print_image("images/wait.gif", true, array("border" => '0'));
echo '<strong>'.__('Loading').'...</strong>';