changes visual setup

This commit is contained in:
alejandro-campos 2020-01-07 10:56:37 +01:00
parent 5880bec88a
commit 7c952eaaa8
1 changed files with 95 additions and 58 deletions

View File

@ -632,8 +632,24 @@ $row++;
$table_font->size[0] = '50%';
$table_font->data = [];
$table_font->data[$row][0] = __('Font path');
$fonts = load_fonts();
$table_font->data[$row][0] = __('Graphs font family');
// Load font families.
$fonts = [];
$dirFonts = scandir(_MPDF_TTFONTPATH);
foreach ($dirFonts as $entryDir) {
if (strstr($entryDir, '.ttf') !== false) {
$explode = explode('-', $entryDir);
if (count($explode) === 1) {
$fonts[$entryDir] = substr($entryDir, 0, (strlen($entryDir) - 4));
}
if ($explode[1] === 'Regular.ttf') {
$fonts[$explode[0].'.ttf'] = $explode[0];
}
}
}
$table_font->data[$row][1] = html_print_select(
$fonts,
'fontpath',
@ -646,7 +662,7 @@ $row++;
$row++;
$table_font->data[$row][0] = __('Font size');
$table_font->data[$row][0] = __('Graphs font size');
$font_size_array = [
1 => 1,
@ -882,14 +898,6 @@ $row++;
$table_chars->data[$row][1] = html_print_select($options_zoom_graphs, 'zoom_graph', $config['zoom_graph'], '', '', 0, true, false, false);
$row++;
$table_chars->data[$row][0] = __('Graph image height');
$table_chars->data[$row][0] .= ui_print_help_tip(
__('This is the height in pixels of the module graph or custom graph in the reports (both: HTML and PDF)'),
true
);
$table_chars->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true);
$row++;
/*
$table_font->data[$row][0] = __('Font path');
$fonts = load_fonts();
@ -996,25 +1004,21 @@ $row++;
echo '</fieldset>';
// ----------------------------------------------------------------------
// OTHER CONFIGURATION
// Reports
// ----------------------------------------------------------------------
$table_other = new stdClass();
$table_other->width = '100%';
$table_other->class = 'databox filters';
$table_other->style[0] = 'font-weight: bold;';
$table_other->size[0] = '50%';
$table_other->size[1] = '26%';
$table_other->size[2] = '12%';
$table_other->size[3] = '12%';
$table_report = new stdClass();
$table_report->width = '100%';
$table_report->class = 'databox filters';
$table_report->style[0] = 'font-weight: bold;';
$table_report->size[0] = '50%';
$table_other->data = [];
$table_report->data = [];
// 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(
$table_report->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_switch(
$table_report->data[$row][1] = html_print_checkbox_switch(
'custom_report_info',
1,
$config['custom_report_info'],
@ -1022,13 +1026,11 @@ $row++;
);
$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(
$table_report->data[$row][0] = __('Custom report front page').ui_print_help_tip(
__('Custom report front page. It will be applied to all reports and templates by default.'),
true
);
$table_other->data[$row][1] = html_print_checkbox_switch(
$table_report->data[$row][1] = html_print_checkbox_switch(
'custom_report_front',
1,
$config['custom_report_front'],
@ -1037,8 +1039,29 @@ $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'>";
$table_report->data[$row][0] = __('PDF font size');
$table_report->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++;
$table_report->data[$row][0] = __('Graph image height for HTML reports');
$table_report->data[$row][0] .= ui_print_help_tip(
__('This is the height in pixels of the module graph or custom graph in the reports (only: HTML)'),
true
);
$table_report->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true);
$row++;
$interval_description = [
'large' => 'Long',
'tiny' => 'Short',
];
$table_report->data[$row][0] = __('Interval description');
$table_report->data[$row][0] .= ui_print_help_tip(
__('A long interval description is for example 10 hours, 20 minutes 33 seconds”, a short one is 10h 20m 33s'),
true
);
$table_report->data[$row][1] = html_print_select($interval_description, 'interval_description', $config['interval_description'], '', '', '', true, false, false);
$row++;
@ -1050,18 +1073,10 @@ $row++;
}
}
$_fonts = [];
$dirFonts = scandir(_MPDF_TTFONTPATH);
foreach ($dirFonts as $entryDir) {
if (strstr($entryDir, '.ttf') !== false) {
$_fonts[$entryDir] = $entryDir;
}
}
// Font
$table_other->data['custom_report_front-font'][0] = __('Custom report front').' - '.__('Font family');
$table_other->data['custom_report_front-font'][1] = html_print_select(
$_fonts,
$table_report->data['custom_report_front-font'][0] = __('Custom report front').' - '.__('Font family');
$table_report->data['custom_report_front-font'][1] = html_print_select(
$fonts,
'custom_report_front_font',
$config['custom_report_front_font'],
false,
@ -1071,11 +1086,11 @@ $row++;
);
// Logo
$table_other->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip(
$table_report->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip(
__("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."),
true
);
$table_other->data['custom_report_front-logo'][1] = html_print_select(
$table_report->data['custom_report_front-logo'][1] = html_print_select(
$customLogos,
'custom_report_front_logo',
io_safe_output($config['custom_report_front_logo']),
@ -1085,16 +1100,16 @@ $row++;
true
);
// Preview
$table_other->data['custom_report_front-preview'][0] = __('Custom report front').' - '.'Preview';
$table_report->data['custom_report_front-preview'][0] = __('Custom report front').' - '.'Preview';
if (empty($config['custom_report_front_logo'])) {
$config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg';
}
$table_other->data['custom_report_front-preview'][1] = '<span id="preview_image">'.html_print_image($config['custom_report_front_logo'], true).'</span>';
$table_report->data['custom_report_front-preview'][1] = '<span id="preview_image">'.html_print_image($config['custom_report_front_logo'], true).'</span>';
// Header
$table_other->data['custom_report_front-header'][0] = __('Custom report front').' - '.__('Header');
$table_other->data['custom_report_front-header'][1] = html_print_textarea(
$table_report->data['custom_report_front-header'][0] = __('Custom report front').' - '.__('Header');
$table_report->data['custom_report_front-header'][1] = html_print_textarea(
'custom_report_front_header',
5,
15,
@ -1104,13 +1119,13 @@ $row++;
);
// First page
$table_other->data['custom_report_front-first_page'][0] = __('Custom report front').' - '.__('First page');
$table_report->data['custom_report_front-first_page'][0] = __('Custom report front').' - '.__('First page');
$custom_report_front_firstpage = str_replace(
'(_URLIMAGE_)',
ui_get_full_url(false, true, false, false),
$config['custom_report_front_firstpage']
);
$table_other->data['custom_report_front-first_page'][1] = html_print_textarea(
$table_report->data['custom_report_front-first_page'][1] = html_print_textarea(
'custom_report_front_firstpage',
15,
15,
@ -1120,8 +1135,8 @@ $row++;
);
// Footer
$table_other->data['custom_report_front-footer'][0] = __('Custom report front').' - '.__('Footer');
$table_other->data['custom_report_front-footer'][1] = html_print_textarea(
$table_report->data['custom_report_front-footer'][0] = __('Custom report front').' - '.__('Footer');
$table_report->data['custom_report_front-footer'][1] = html_print_textarea(
'custom_report_front_footer',
5,
15,
@ -1130,8 +1145,24 @@ $row++;
true
);
echo '<fieldset>';
echo '<legend>'.__('Reports configuration').'</legend>';
html_print_table($table_report);
echo '</fieldset>';
// ----------------------------------------------------------------------
// OTHER CONFIGURATION
// ----------------------------------------------------------------------
$table_other = new stdClass();
$table_other->width = '100%';
$table_other->class = 'databox filters';
$table_other->style[0] = 'font-weight: bold;';
$table_other->size[0] = '50%';
$table_other->size[1] = '26%';
$table_other->size[2] = '12%';
$table_other->size[3] = '12%';
$table_other->data = [];
$table_other->data[$row][0] = __('Custom graphviz directory').ui_print_help_tip(__('Custom directory where the graphviz binaries are stored.'), true);
$table_other->data[$row][1] = html_print_input_text(
@ -1156,8 +1187,6 @@ $row++;
);
$row++;
$table_other->data[$row][0] = __('Show only the group name');
$table_other->data[$row][0] .= ui_print_help_tip(
__('Show the group name instead the group icon.'),
@ -1179,16 +1208,23 @@ $row++;
if ($config['prominent_time'] == 'comparation') {
$timestamp = false;
$comparation = true;
$compact = false;
} else if ($config['prominent_time'] == 'timestamp') {
$timestamp = true;
$comparation = false;
$compact = false;
} else if ($config['prominent_time'] == 'compact') {
$timestamp = false;
$comparation = false;
$compact = true;
}
$table_other->data[$row][0] = __('Timestamp or time comparation');
$table_other->data[$row][1] = __('Comparation in rollover').' ';
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', '', $comparation, true);
$table_other->data[$row][1] .= '<br />'.__('Timestamp in rollover').' ';
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', '', $timestamp, true);
$table_other->data[$row][0] = __('Timestamp, time comparison, or compact mode');
$table_other->data[$row][1] = '<div class="switch_radio_button">';
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', __('Comparation in rollover'), $comparation, true);
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', __('Timestamp in rollover'), $timestamp, true);
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'compact', __('Compact mode'), $compact, true);
$table_other->data[$row][1] .= '</div>';
$row++;
@ -1294,6 +1330,7 @@ $row++;
'class="sub cancel"',
true
);
$table_other->data[$row][3] .= html_print_input_hidden(
'custom_module_unit_to_delete',
'',