mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Some changes and fixed for the reports in PDF.
This commit is contained in:
parent
def5a597a2
commit
7ce25e9627
@ -2671,7 +2671,10 @@ function grafico_eventos_usuario ($width, $height) {
|
|||||||
* @param integer width graph width
|
* @param integer width graph width
|
||||||
* @param integer Graph type 1 vbar, 2 hbar, 3 pie
|
* @param integer Graph type 1 vbar, 2 hbar, 3 pie
|
||||||
*/
|
*/
|
||||||
function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar', $only_image = false, $homeurl = '', $ttl = 1) {
|
function graph_custom_sql_graph ($id, $width, $height,
|
||||||
|
$type = 'sql_graph_vbar', $only_image = false, $homeurl = '',
|
||||||
|
$ttl = 1) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$report_content = db_get_row ('treport_content', 'id_rc', $id);
|
$report_content = db_get_row ('treport_content', 'id_rc', $id);
|
||||||
|
@ -365,7 +365,10 @@ function reporting_make_reporting_data($id_report, $date, $time,
|
|||||||
case 'event_report_agent':
|
case 'event_report_agent':
|
||||||
$report['contents'][] = reporting_event_report_agent(
|
$report['contents'][] = reporting_event_report_agent(
|
||||||
$report,
|
$report,
|
||||||
$content);
|
$content,
|
||||||
|
$type,
|
||||||
|
$force_width_chart,
|
||||||
|
$force_height_chart);
|
||||||
break;
|
break;
|
||||||
case 'group_report':
|
case 'group_report':
|
||||||
$report['contents'][] = reporting_group_report(
|
$report['contents'][] = reporting_group_report(
|
||||||
@ -1894,7 +1897,10 @@ function reporting_group_report($report, $content) {
|
|||||||
return reporting_check_structure_content($return);
|
return reporting_check_structure_content($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
function reporting_event_report_agent($report, $content) {
|
function reporting_event_report_agent($report, $content,
|
||||||
|
$type = 'dinamic', $force_width_chart = null,
|
||||||
|
$force_height_chart = null) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$return['type'] = 'event_report_agent';
|
$return['type'] = 'event_report_agent';
|
||||||
@ -1930,6 +1936,21 @@ function reporting_event_report_agent($report, $content) {
|
|||||||
$filter_event_no_validated,
|
$filter_event_no_validated,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
reporting_set_conf_charts($width, $height, $only_image, $type,
|
||||||
|
$content, $ttl);
|
||||||
|
|
||||||
|
if (!empty($force_width_chart)) {
|
||||||
|
$width = $force_width_chart;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($force_height_chart)) {
|
||||||
|
$height = $force_height_chart;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$return["chart"]["by_user_validator"] = null;
|
$return["chart"]["by_user_validator"] = null;
|
||||||
$return["chart"]["by_criticity"] = null;
|
$return["chart"]["by_criticity"] = null;
|
||||||
$return["chart"]["validated_vs_unvalidated"] = null;
|
$return["chart"]["validated_vs_unvalidated"] = null;
|
||||||
@ -1951,10 +1972,11 @@ function reporting_event_report_agent($report, $content) {
|
|||||||
500,
|
500,
|
||||||
150,
|
150,
|
||||||
__("other"),
|
__("other"),
|
||||||
"",
|
ui_get_full_url(false, false, false, false),
|
||||||
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
|
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'],
|
$config['fontpath'],
|
||||||
$config['font_size']);
|
$config['font_size'],
|
||||||
|
$ttl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($event_graph_by_criticity) {
|
if ($event_graph_by_criticity) {
|
||||||
@ -1969,9 +1991,18 @@ function reporting_event_report_agent($report, $content) {
|
|||||||
$colors = get_criticity_pie_colors($data_graph);
|
$colors = get_criticity_pie_colors($data_graph);
|
||||||
|
|
||||||
$return["chart"]["by_criticity"] = pie3d_graph(
|
$return["chart"]["by_criticity"] = pie3d_graph(
|
||||||
false, $data_graph, 500, 150, __("other"), "",
|
false,
|
||||||
|
$data_graph,
|
||||||
|
500,
|
||||||
|
150,
|
||||||
|
__("other"),
|
||||||
|
ui_get_full_url(false, false, false, false),
|
||||||
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
|
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'], $config['font_size'], 1, false, $colors);
|
$config['fontpath'],
|
||||||
|
$config['font_size'],
|
||||||
|
$ttl,
|
||||||
|
false,
|
||||||
|
$colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($event_graph_validated_vs_unvalidated) {
|
if ($event_graph_validated_vs_unvalidated) {
|
||||||
@ -1984,9 +2015,16 @@ function reporting_event_report_agent($report, $content) {
|
|||||||
$filter_event_no_validated);
|
$filter_event_no_validated);
|
||||||
|
|
||||||
$return["chart"]["validated_vs_unvalidated"] = pie3d_graph(
|
$return["chart"]["validated_vs_unvalidated"] = pie3d_graph(
|
||||||
false, $data_graph, 500, 150, __("other"), "",
|
false,
|
||||||
|
$data_graph,
|
||||||
|
500,
|
||||||
|
150,
|
||||||
|
__("other"),
|
||||||
|
ui_get_full_url(false, false, false, false),
|
||||||
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
|
ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'],
|
||||||
|
$config['font_size'],
|
||||||
|
$ttl);
|
||||||
}
|
}
|
||||||
|
|
||||||
return reporting_check_structure_content($return);
|
return reporting_check_structure_content($return);
|
||||||
@ -2593,7 +2631,8 @@ function reporting_sql_graph($report, $content, $type,
|
|||||||
$height,
|
$height,
|
||||||
$content["type"],
|
$content["type"],
|
||||||
true,
|
true,
|
||||||
ui_get_full_url(false, false, false, false));
|
ui_get_full_url(false, false, false, false),
|
||||||
|
$ttl);
|
||||||
break;
|
break;
|
||||||
case 'data':
|
case 'data':
|
||||||
break;
|
break;
|
||||||
@ -3997,6 +4036,13 @@ function reporting_set_conf_charts(&$width, &$height, &$only_image, $type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
@ -4005,6 +4051,94 @@ function reporting_set_conf_charts(&$width, &$height, &$only_image, $type,
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a detailed reporting of groups's events.
|
||||||
|
*
|
||||||
|
* @param unknown_type $id_group Id of the group.
|
||||||
|
* @param unknown_type $period Time period of the report.
|
||||||
|
* @param unknown_type $date Date of the report.
|
||||||
|
* @param unknown_type $return Whether to return or not.
|
||||||
|
* @param unknown_type $html Whether to return HTML code or not.
|
||||||
|
*
|
||||||
|
* @return string Report of groups's events
|
||||||
|
*/
|
||||||
|
function reporting_get_count_events_validated ($filter, $period = 0,
|
||||||
|
$date = 0,
|
||||||
|
$filter_event_validated = false, $filter_event_critical = false,
|
||||||
|
$filter_event_warning = false, $filter_event_no_validated = false,
|
||||||
|
$filter_event_search = false) {
|
||||||
|
|
||||||
|
if (!is_numeric ($date)) {
|
||||||
|
$date = strtotime ($date);
|
||||||
|
}
|
||||||
|
if (empty ($date)) {
|
||||||
|
$date = get_system_time ();
|
||||||
|
}
|
||||||
|
|
||||||
|
return events_get_count_events_validated($filter, $period, $date,
|
||||||
|
$filter_event_validated, $filter_event_critical,
|
||||||
|
$filter_event_warning, $filter_event_no_validated,
|
||||||
|
$filter_event_search);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a detailed reporting of groups's events.
|
||||||
|
*
|
||||||
|
* @param unknown_type $id_group Id of the group.
|
||||||
|
* @param unknown_type $period Time period of the report.
|
||||||
|
* @param unknown_type $date Date of the report.
|
||||||
|
* @param unknown_type $return Whether to return or not.
|
||||||
|
* @param unknown_type $html Whether to return HTML code or not.
|
||||||
|
*
|
||||||
|
* @return string Report of groups's events
|
||||||
|
*/
|
||||||
|
function reporting_get_count_events_by_criticity ($filter, $period = 0,
|
||||||
|
$date = 0,
|
||||||
|
$filter_event_validated = false, $filter_event_critical = false,
|
||||||
|
$filter_event_warning = false, $filter_event_no_validated = false,
|
||||||
|
$filter_event_search = false) {
|
||||||
|
|
||||||
|
if (!is_numeric ($date)) {
|
||||||
|
$date = strtotime ($date);
|
||||||
|
}
|
||||||
|
if (empty ($date)) {
|
||||||
|
$date = get_system_time ();
|
||||||
|
}
|
||||||
|
|
||||||
|
return events_get_count_events_by_criticity($filter, $period, $date,
|
||||||
|
$filter_event_validated, $filter_event_critical,
|
||||||
|
$filter_event_warning, $filter_event_no_validated,
|
||||||
|
$filter_event_search);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a detailed reporting of groups's events.
|
||||||
|
*
|
||||||
|
* @param unknown_type $filter.
|
||||||
|
* @param unknown_type $period Time period of the report.
|
||||||
|
* @param unknown_type $date Date of the report.
|
||||||
|
* @param unknown_type $return Whether to return or not.
|
||||||
|
* @param unknown_type $html Whether to return HTML code or not.
|
||||||
|
*
|
||||||
|
* @return string Report of groups's events
|
||||||
|
*/
|
||||||
|
function reporting_get_count_events_validated_by_user ($filter, $period = 0,
|
||||||
|
$date = 0,
|
||||||
|
$filter_event_validated = false, $filter_event_critical = false,
|
||||||
|
$filter_event_warning = false, $filter_event_no_validated = false,
|
||||||
|
$filter_event_search = false) {
|
||||||
|
|
||||||
|
if (!is_numeric ($date)) {
|
||||||
|
$date = strtotime ($date);
|
||||||
|
}
|
||||||
|
if (empty ($date)) {
|
||||||
|
$date = get_system_time ();
|
||||||
|
}
|
||||||
|
|
||||||
|
return events_get_count_events_validated_by_user($filter, $period, $date,
|
||||||
|
$filter_event_validated, $filter_event_critical,
|
||||||
|
$filter_event_warning, $filter_event_no_validated, $filter_event_search);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a detailed reporting of groups's events.
|
* Gets a detailed reporting of groups's events.
|
||||||
|
@ -3549,21 +3549,6 @@ function reporting_header_content($mini, $content, $report, &$table,
|
|||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This function is used once, in reporting_viewer.php, the HTML report render
|
|
||||||
* file. This function proccess each report item and write the render in the
|
|
||||||
* table record.
|
|
||||||
*
|
|
||||||
* @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 reporting_render_report_html_item ($content, $table, $report, $mini = false) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -3648,94 +3633,10 @@ function reporting_get_count_events_by_agent ($id_group, $period = 0,
|
|||||||
$filter_event_filter_search);
|
$filter_event_filter_search);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a detailed reporting of groups's events.
|
|
||||||
*
|
|
||||||
* @param unknown_type $filter.
|
|
||||||
* @param unknown_type $period Time period of the report.
|
|
||||||
* @param unknown_type $date Date of the report.
|
|
||||||
* @param unknown_type $return Whether to return or not.
|
|
||||||
* @param unknown_type $html Whether to return HTML code or not.
|
|
||||||
*
|
|
||||||
* @return string Report of groups's events
|
|
||||||
*/
|
|
||||||
function reporting_get_count_events_validated_by_user ($filter, $period = 0,
|
|
||||||
$date = 0,
|
|
||||||
$filter_event_validated = false, $filter_event_critical = false,
|
|
||||||
$filter_event_warning = false, $filter_event_no_validated = false,
|
|
||||||
$filter_event_search = false) {
|
|
||||||
|
|
||||||
if (!is_numeric ($date)) {
|
|
||||||
$date = strtotime ($date);
|
|
||||||
}
|
|
||||||
if (empty ($date)) {
|
|
||||||
$date = get_system_time ();
|
|
||||||
}
|
|
||||||
|
|
||||||
return events_get_count_events_validated_by_user($filter, $period, $date,
|
|
||||||
$filter_event_validated, $filter_event_critical,
|
|
||||||
$filter_event_warning, $filter_event_no_validated, $filter_event_search);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a detailed reporting of groups's events.
|
|
||||||
*
|
|
||||||
* @param unknown_type $id_group Id of the group.
|
|
||||||
* @param unknown_type $period Time period of the report.
|
|
||||||
* @param unknown_type $date Date of the report.
|
|
||||||
* @param unknown_type $return Whether to return or not.
|
|
||||||
* @param unknown_type $html Whether to return HTML code or not.
|
|
||||||
*
|
|
||||||
* @return string Report of groups's events
|
|
||||||
*/
|
|
||||||
function reporting_get_count_events_by_criticity ($filter, $period = 0,
|
|
||||||
$date = 0,
|
|
||||||
$filter_event_validated = false, $filter_event_critical = false,
|
|
||||||
$filter_event_warning = false, $filter_event_no_validated = false,
|
|
||||||
$filter_event_search = false) {
|
|
||||||
|
|
||||||
if (!is_numeric ($date)) {
|
|
||||||
$date = strtotime ($date);
|
|
||||||
}
|
|
||||||
if (empty ($date)) {
|
|
||||||
$date = get_system_time ();
|
|
||||||
}
|
|
||||||
|
|
||||||
return events_get_count_events_by_criticity($filter, $period, $date,
|
|
||||||
$filter_event_validated, $filter_event_critical,
|
|
||||||
$filter_event_warning, $filter_event_no_validated,
|
|
||||||
$filter_event_search);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a detailed reporting of groups's events.
|
|
||||||
*
|
|
||||||
* @param unknown_type $id_group Id of the group.
|
|
||||||
* @param unknown_type $period Time period of the report.
|
|
||||||
* @param unknown_type $date Date of the report.
|
|
||||||
* @param unknown_type $return Whether to return or not.
|
|
||||||
* @param unknown_type $html Whether to return HTML code or not.
|
|
||||||
*
|
|
||||||
* @return string Report of groups's events
|
|
||||||
*/
|
|
||||||
function reporting_get_count_events_validated ($filter, $period = 0,
|
|
||||||
$date = 0,
|
|
||||||
$filter_event_validated = false, $filter_event_critical = false,
|
|
||||||
$filter_event_warning = false, $filter_event_no_validated = false,
|
|
||||||
$filter_event_search = false) {
|
|
||||||
|
|
||||||
if (!is_numeric ($date)) {
|
|
||||||
$date = strtotime ($date);
|
|
||||||
}
|
|
||||||
if (empty ($date)) {
|
|
||||||
$date = get_system_time ();
|
|
||||||
}
|
|
||||||
|
|
||||||
return events_get_count_events_validated($filter, $period, $date,
|
|
||||||
$filter_event_validated, $filter_event_critical,
|
|
||||||
$filter_event_warning, $filter_event_no_validated,
|
|
||||||
$filter_event_search);
|
|
||||||
}
|
|
||||||
|
|
||||||
function reporting_get_agents_by_status ($data, $graph_width = 250, $graph_height = 150, $links = false) {
|
function reporting_get_agents_by_status ($data, $graph_width = 250, $graph_height = 150, $links = false) {
|
||||||
global $config;
|
global $config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user