2013-05-21 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_reporting.php, include/functions.php: improved
	the source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8180 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-05-21 13:45:03 +00:00
parent ac4d5799d8
commit 3ed70944e4
3 changed files with 57 additions and 45 deletions

View File

@ -1,3 +1,8 @@
2013-05-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php, include/functions.php: improved
the source code style.
2013-05-21 Miguel de Dios <miguel.dedios@artica.es> 2013-05-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_modules.php: fixed false error when update the * include/functions_modules.php: fixed false error when update the

View File

@ -498,7 +498,8 @@ function human_time_description_raw ($seconds, $exactly = false, $units = 'large
$returnTime .= "$mins $minutesString "; $returnTime .= "$mins $minutesString ";
} }
else { else {
$returnTime = sprintf("%02d",$hours).':'.sprintf("%02d",$mins); $returnTime = sprintf("%02d",$hours) . ':' .
sprintf("%02d",$mins);
} }
} }
@ -507,7 +508,9 @@ function human_time_description_raw ($seconds, $exactly = false, $units = 'large
$returnTime .= "$seconds $secondsString "; $returnTime .= "$seconds $secondsString ";
} }
else { else {
$returnTime = sprintf("%02d",$hours).':'.sprintf("%02d",$mins).':'.sprintf("%02d",$seconds); $returnTime = sprintf("%02d",$hours) . ':' .
sprintf("%02d",$mins) . ':' .
sprintf("%02d",$seconds);
} }
} }

View File

@ -5626,10 +5626,6 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$nmodules = 0; $nmodules = 0;
foreach ($modules_by_name as $module) { foreach ($modules_by_name as $module) {
$nmodules++; $nmodules++;
// Don't use pagination
/*if($nmodules > $block) { //Will show only the (block) first modules
continue;
}*/
$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, '#90B165', 'FFF', 4, 0);
$table_data .= '<th width="22px">' . html_print_image($file_name, true, array('title' => $module['name']))."</th>"; $table_data .= '<th width="22px">' . html_print_image($file_name, true, array('title' => $module['name']))."</th>";
@ -5936,8 +5932,11 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
modules_get_status($id_agent_module, $module_status['estado'], $module_status['datos'], $status, $title); modules_get_status($id_agent_module, $module_status['estado'], $module_status['datos'], $status, $title);
$data[9] = ui_print_status_image($status, $title, true); $data[9] = ui_print_status_image($status, $title, true);
$sql_tag = "SELECT name FROM ttag WHERE id_tag IN ( $sql_tag = "SELECT name
SELECT id_tag FROM ttag_module FROM ttag
WHERE id_tag IN (
SELECT id_tag
FROM ttag_module
WHERE id_agente_modulo = $id_agent_module)"; WHERE id_agente_modulo = $id_agent_module)";
$tags = db_get_all_rows_sql($sql_tag); $tags = db_get_all_rows_sql($sql_tag);
if ($tags === false) if ($tags === false)
@ -6088,8 +6087,11 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
modules_get_status($id_agent_module, $module_status['estado'], $module_status['datos'], $status, $title); modules_get_status($id_agent_module, $module_status['estado'], $module_status['datos'], $status, $title);
$data[9] = ui_print_status_image($status, $title, true); $data[9] = ui_print_status_image($status, $title, true);
$sql_tag = "SELECT name FROM ttag WHERE id_tag IN ( $sql_tag = "SELECT name
SELECT id_tag FROM ttag_module FROM ttag
WHERE id_tag IN (
SELECT id_tag
FROM ttag_module
WHERE id_agente_modulo = $id_agent_module)"; WHERE id_agente_modulo = $id_agent_module)";
$tags = db_get_all_rows_sql($sql_tag); $tags = db_get_all_rows_sql($sql_tag);
if ($tags === false) if ($tags === false)
@ -6126,7 +6128,9 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$start_date = $end_date - $period; $start_date = $end_date - $period;
// Get item filters // Get item filters
$filter = db_get_row_sql("SELECT * FROM tnetflow_filter WHERE id_sg = '" . (int)$content['text'] . "'", false, true); $filter = db_get_row_sql("SELECT *
FROM tnetflow_filter
WHERE id_sg = '" . (int)$content['text'] . "'", false, true);
if ($description == '') { if ($description == '') {
$description = $filter['id_name']; $description = $filter['id_name'];
} }