diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 3edfefb9f7..633e695a55 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -491,6 +491,16 @@ $table_other->data[$row][0] = __('Default line thickness for the Visual Console' $table_other->data[$row][1] = html_print_input_text ('vc_line_thickness', $config["vc_line_thickness"], '', 5, 5, true); $row++; +// Enrique (27/01/2017) New feature: Show report info on top of reports +$table_other->data[$row][0] = __('Show report info with description') . + ui_print_help_tip( + __('Custom report description info. It will be applied to all reports and templates by default.'), true); +$table_other->data[$row][1] = html_print_checkbox('custom_report_info', 1, + $config['custom_report_info'], true); +$row++; + +//---------------------------------------------------------------------- + // Juanma (07/05/2014) New feature: Table for custom front page for reports $table_other->data[$row][0] = __('Custom report front page') . ui_print_help_tip( @@ -500,28 +510,6 @@ $table_other->data[$row][1] = html_print_checkbox('custom_report_front', 1, $row++; //---------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - $dirItems = scandir($config['homedir'] . '/images/custom_logo'); foreach ($dirItems as $entryDir) { if (strstr($entryDir, '.jpg') !== false) { diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index fef5bcb16f..fc541a6584 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -593,10 +593,9 @@ function config_update_config () { if (!config_update_value ('interval_values', $interval_values)) $error_update[] = __('Delete interval'); //-------------------------------------------------- - - - - + if (!config_update_value ('custom_report_info', get_parameter('custom_report_info'))) + $error_update[] = __('Custom report info'); + // Juanma (06/05/2014) New feature: Custom front page for reports if (!config_update_value ('custom_report_front', get_parameter('custom_report_front'))) $error_update[] = __('Custom report front'); diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index e55c67f02c..0a05053bac 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -100,7 +100,39 @@ function reporting_html_header(&$table, $mini, $title, $subtitle, array_push ($table->data, $data); } -function reporting_html_print_report($report, $mini = false) { +function html_do_report_info($report) { + global $config; + + $date_today = date ($config["date_format"]); + + $html = '
' . + ' + + + + + '; + if (isset($report['period'])) { + $html .= ''; + } + $html .= ' + + + +
' . __('Generated') . ': ' . $date_today . '
' . __('Report date') . ': ' . date($config["date_format"], ($report['datetime'] - $report['period'])); + } + else { + $html .= '' . __('Items period before') . ' ' . date($config["date_format"], $report['datetime']) . '
' . __('Description') . ': ' . io_safe_output($report['description']) . '
' . + '
'; + + echo $html; +} + +function reporting_html_print_report($report, $mini = false, $report_info = 1) { + + if($report_info == 1){ + html_do_report_info($report); + } foreach ($report['contents'] as $key => $item) { $table = new stdClass(); diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index b88cfe3f89..028d1645cd 100755 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -221,7 +221,7 @@ if ($enable_init_date) { $report = reporting_make_reporting_data(null, $id_report, $date, $time, $period, 'dinamic'); -reporting_html_print_report($report); +reporting_html_print_report($report,false,$config['custom_report_info']); //----------------------------------------------------------------------