From cdf6c3972edf3732a9c9aa79d49326b550f78d40 Mon Sep 17 00:00:00 2001 From: Calvo Date: Wed, 7 Jul 2021 12:09:47 +0200 Subject: [PATCH] Fix widgets style bugs --- pandora_console/include/functions_html.php | 8 ++++++-- pandora_console/include/functions_ui.php | 2 +- .../include/lib/Dashboard/Widgets/custom_graph.php | 1 + .../lib/Dashboard/Widgets/graph_module_histogram.php | 2 ++ .../include/lib/Dashboard/Widgets/single_graph.php | 1 + .../include/lib/Dashboard/Widgets/sla_percent.php | 1 + pandora_console/include/lib/Dashboard/Widgets/top_n.php | 1 + 7 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 6eabde142f..5892a3fece 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1926,7 +1926,7 @@ function html_print_extended_select_for_time( ob_start(); // Use the no_meta parameter because this image is only in the base console. - echo '
'; + echo '
'; html_print_select( $fields, $uniq_name.'_select', @@ -4803,7 +4803,11 @@ function html_print_input($data, $wrapper='div', $input_only=false) ((isset($data['size']) === true) ? $data['size'] : false), ((isset($data['return']) === true) ? $data['return'] : false), ((isset($data['style']) === true) ? $data['selected'] : false), - ((isset($data['unique']) === true) ? $data['unique'] : false) + ((isset($data['unique']) === true) ? $data['unique'] : false), + ((isset($data['class']) === true) ? $data['class'] : ''), + ((isset($data['readonly']) === true) ? $data['readonly'] : false), + ((isset($data['custom_fields']) === true) ? $data['custom_fields'] : false), + ((isset($data['style_icon']) === true) ? $data['style_icon'] : '') ); break; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ecd985d5c3..3d473f3fca 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -5669,7 +5669,7 @@ function ui_print_agent_autocomplete_input($parameters) } $attrs = []; - $attrs['style'] = 'background: url('.$icon_image.') no-repeat right; '.$text_color.''; + $attrs['style'] = 'padding-right: 20px; background: url('.$icon_image.') no-repeat right; '.$text_color.''; if (!$disabled_javascript_on_blur_function) { $attrs['onblur'] = $javascript_on_blur_function_name.'()'; diff --git a/pandora_console/include/lib/Dashboard/Widgets/custom_graph.php b/pandora_console/include/lib/Dashboard/Widgets/custom_graph.php index ea07f711dd..c2515d1088 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/custom_graph.php +++ b/pandora_console/include/lib/Dashboard/Widgets/custom_graph.php @@ -354,6 +354,7 @@ class CustomGraphWidget extends Widget 'value' => $values['period'], 'nothing' => __('None'), 'nothing_value' => 0, + 'style_icon' => 'flex-grow: 0', ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php b/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php index 30c512a98b..32ca90c3cb 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php +++ b/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php @@ -325,6 +325,8 @@ class GraphModuleHistogramWidget extends Widget 'value' => $values['period'], 'nothing' => __('None'), 'nothing_value' => 0, + 'style_icon' => 'flex-grow: 0', + ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/single_graph.php b/pandora_console/include/lib/Dashboard/Widgets/single_graph.php index fe3e0a0c15..bc92ade1f8 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/single_graph.php +++ b/pandora_console/include/lib/Dashboard/Widgets/single_graph.php @@ -310,6 +310,7 @@ class SingleGraphWidget extends Widget 'value' => $values['period'], 'nothing' => __('None'), 'nothing_value' => 0, + 'style_icon' => 'flex-grow: 0', ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/sla_percent.php b/pandora_console/include/lib/Dashboard/Widgets/sla_percent.php index 0f422420f1..ae1434891e 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/sla_percent.php +++ b/pandora_console/include/lib/Dashboard/Widgets/sla_percent.php @@ -335,6 +335,7 @@ class SLAPercentWidget extends Widget 'value' => $values['period'], 'nothing' => __('None'), 'nothing_value' => 0, + 'style_icon' => 'flex-grow: 0', ], ]; diff --git a/pandora_console/include/lib/Dashboard/Widgets/top_n.php b/pandora_console/include/lib/Dashboard/Widgets/top_n.php index 599bef0b0b..fd28ef8014 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/top_n.php +++ b/pandora_console/include/lib/Dashboard/Widgets/top_n.php @@ -240,6 +240,7 @@ class TopNWidget extends Widget 'value' => $values['period'], 'nothing' => __('None'), 'nothing_value' => 0, + 'style_icon' => 'flex-grow: 0', ], ];