Added token in visual styles to change the font size in items of reports - #4670

This commit is contained in:
Tatiana Llorente 2019-10-09 16:24:37 +02:00
parent be2148ff26
commit 18679f90e5
3 changed files with 20 additions and 4 deletions

View File

@ -557,7 +557,7 @@ $row++;
// For 5.1 Autohidden menu feature
$table_styles->data['autohidden'][0] = __('Autohidden menu');
$table_styles->data['autohidden'][0] = __('Automatically hide submenu');
$table_styles->data['autohidden'][1] = html_print_checkbox_switch(
'autohidden_menu',
1,
@ -1032,6 +1032,12 @@ $row++;
);
$row++;
$table_other->data[$row][0] = __('Font size for items reports');
$table_other->data[$row][1] = "<input type ='number' value=".$config['font_size_item_report']." size='1' name='font_size_item_report' min='1' max='9' step='0.1'>";
$row++;
// ----------------------------------------------------------------------
$dirItems = scandir($config['homedir'].'/images/custom_logo');
foreach ($dirItems as $entryDir) {

View File

@ -1269,6 +1269,10 @@ function config_update_config()
}
// Juanma (06/05/2014) New feature: Custom front page for reports.
if (!config_update_value('font_size_item_report', get_parameter('font_size_item_report', 2))) {
$error_update[] = __('Font size for items reports');
}
if (!config_update_value('custom_report_front', get_parameter('custom_report_front'))) {
$error_update[] = __('Custom report front');
}
@ -2793,6 +2797,10 @@ function config_process_config()
config_update_value('custom_report_front', 0);
}
if (!isset($config['font_size_item_report'])) {
config_update_value('font_size_item_report', 2);
}
if (!isset($config['custom_report_front_font'])) {
config_update_value('custom_report_front_font', 'FreeSans.ttf');
}

View File

@ -467,7 +467,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
if ($mini) {
$font_size = '1.5';
} else {
$font_size = '3';
$font_size = $config['font_size_item_report'];
}
$metaconsole_on = is_metaconsole();
@ -2513,7 +2513,7 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
if ($mini) {
$font_size = '1.5';
} else {
$font_size = '3';
$font_size = $config['font_size_item_report'];
}
$table->colspan['module']['cell'] = 3;
@ -2780,10 +2780,12 @@ function reporting_html_min_value(&$table, $item, $mini)
function reporting_html_value(&$table, $item, $mini, $only_value=false, $check_empty=false)
{
global $config;
if ($mini) {
$font_size = '1.5';
} else {
$font_size = '3';
$font_size = $config['font_size_item_report'];
}
if (isset($item['visual_format']) && $item['visual_format'] != 0