Merge remote-tracking branch 'origin/develop' into new-vc-line-element

This commit is contained in:
Daniel Barbero 2019-12-13 13:02:04 +01:00
commit 9e01cb097c
5 changed files with 78 additions and 68 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 for HTML reports');
$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 (only: HTML)'),
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,21 +1004,20 @@ $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->data = [];
$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_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'],
@ -1018,13 +1025,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'],
@ -1033,11 +1038,19 @@ $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++;
// ----------------------------------------------------------------------
$dirItems = scandir($config['homedir'].'/images/custom_logo');
foreach ($dirItems as $entryDir) {
@ -1046,25 +1059,10 @@ $row++;
}
}
$_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];
}
}
}
// 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,
@ -1074,11 +1072,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']),
@ -1088,16 +1086,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,
@ -1107,13 +1105,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,
@ -1123,8 +1121,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,
@ -1133,6 +1131,22 @@ $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->data = [];

View File

@ -455,7 +455,7 @@ function __($string /*, variable arguments */)
return $string;
}
return $l10n->translate($string);
return str_replace('\'', '`', $l10n->translate($string));
}
$args = func_get_args();
@ -465,7 +465,7 @@ function __($string /*, variable arguments */)
return vsprintf($string, $args);
}
return vsprintf($l10n->translate($string), $args);
return vsprintf(str_replace('\'', '`', $l10n->translate($string)), $args);
}

View File

@ -1169,7 +1169,7 @@ function createGauges(data, width, height, font_size, no_data_image, font) {
maxinum,
valor;
for (key in data) {
for (var key in data) {
nombre = data[key].gauge;
label = data[key].label;
@ -1189,8 +1189,8 @@ function createGauges(data, width, height, font_size, no_data_image, font) {
mininum = round_with_decimals(parseFloat(data[key].min));
maxinum = round_with_decimals(parseFloat(data[key].max));
critical_inverse = parseInt(data[key].critical_inverse);
warning_inverse = parseInt(data[key].warning_inverse);
var critical_inverse = parseInt(data[key].critical_inverse);
var warning_inverse = parseInt(data[key].warning_inverse);
valor = round_with_decimals(data[key].value);

View File

@ -1763,7 +1763,7 @@ function round_with_decimals(value, multiplier) {
if (typeof multiplier === "undefined") multiplier = 1;
// Return non numeric types without modification
if (typeof value !== "number" || Number.isNaN(value)) {
if (typeof value !== "number" || isNaN(value)) {
return value;
}

View File

@ -20268,7 +20268,7 @@ msgid ""
"The alert would fire when the value matches <span id=\"value\"></span>"
msgstr ""
"سيتم إطلاق التنبيه عندما تتطابق القيمة مع ما يلي <span id=\\\"value\\"
"\"></span"
"\"></span>"
#: ../../include/functions_ui.php:1003 ../../godmode/alerts/alert_view.php:147
msgid ""
@ -20284,9 +20284,7 @@ msgid ""
"The alert would fire when the value is between <span id=\"min\"></span> and "
"<span id=\"max\"></span>"
msgstr ""
"سيتم إطلاق التنبيه عندما تكون القيمة بين <span id=\\\"min\\\"></span> and "
"\"\r\n"
"\"<span id=\\\"max\\\"></span>"
"سيتم إطلاق التنبيه عندما تكون القيمة بين <span id=\\\"min\\\"></span> and <span id=\\\"max\\\"></span>"
#: ../../include/functions_ui.php:1012
#: ../../godmode/alerts/configure_alert_template.php:808
@ -20295,9 +20293,7 @@ msgid ""
"The alert would fire when the value is not between <span id=\"min\"></span> "
"and <span id=\"max\"></span>"
msgstr ""
"\" سيتم إطلاق التنبيه عندما لا تكون القيمة بين <span id=\\\"min\\\"></span> "
"\" \r\n"
"\"and <span id=\\\"max\\\"></span>"
"سيتم إطلاق التنبيه عندما لا تكون القيمة بين <span id=\\\"min\\\"></span> and <span id=\\\"max\\\"></span>"
#: ../../include/functions_ui.php:1016
msgid "The alert would fire when the value is over <span id=\"max\"></span>"