From 7433d5213051d271232df242f6c622c9f2d121ff Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 24 Apr 2019 12:32:33 +0200 Subject: [PATCH] change way to print discovery simple multiple inputs Former-commit-id: 845171053b2002d036f0f8992a2aacad4ec0a561 --- .../godmode/wizards/HostDevices.class.php | 17 ++++++----- .../godmode/wizards/Wizard.main.php | 3 +- pandora_console/include/functions_html.php | 30 ++++++++++++++----- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 1c20eb04e3..cba8949ad2 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -677,14 +677,15 @@ class HostDevices extends Wizard $group_select = '
'; $group_select .= $this->printInput([ - 'name' => 'id_group', - 'returnAllGroup' => false, - 'privilege' => 'PM', - 'type' => 'select_groups', - 'selected' => $this->task['id_group'], - 'return' => true, - 'class' => 'discovery_list_input', - 'size' => 9, + 'name' => 'id_group', + 'returnAllGroup' => false, + 'privilege' => 'PM', + 'type' => 'select_groups', + 'selected' => $this->task['id_group'], + 'return' => true, + 'class' => 'discovery_list_input', + 'size' => 9, + 'simple_multiple_options' => true, ]); if (isset($this->task['id_rt']) === true) { diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 011e906cfa..6fcd90bbf3 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -480,7 +480,8 @@ class Wizard ((isset($data['strict_user']) === true) ? $data['strict_user'] : false), ((isset($data['delete_groups']) === true) ? $data['delete_groups'] : false), ((isset($data['include_groups']) === true) ? $data['include_groups'] : false), - ((isset($data['size']) === true) ? $data['size'] : false) + ((isset($data['size']) === true) ? $data['size'] : false), + ((isset($data['simple_multiple_options']) === true) ? $data['simple_multiple_options'] : false) ); case 'submit': diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 8feab63553..4666dd441c 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -437,7 +437,8 @@ function html_print_select_groups( $strict_user=false, $delete_groups=false, $include_groups=false, - $size=false + $size=false, + $simple_multiple_options=false ) { global $config; @@ -483,7 +484,11 @@ function html_print_select_groups( $disabled, $style, $option_style, - $size + $size, + false, + '', + false, + $simple_multiple_options ); if ($return) { @@ -531,7 +536,8 @@ function html_print_select( $size=false, $modal=false, $message='', - $select_all=false + $select_all=false, + $simple_multiple_options=false ) { $output = "\n"; @@ -551,11 +557,21 @@ function html_print_select( $attributes .= ' onchange="'.$script.'"'; } - if ($size !== false) - $attributes .= ' size="'.$size.'"'; + if (!empty($multiple)) { + if ($size !== false) { + $attributes .= ' multiple="multiple" size="'.$size.'"'; + } else { + $attributes .= ' multiple="multiple" size="10"'; + } + } - if (!empty($multiple)) - $attributes .= ' multiple="multiple"'; + if ($simple_multiple_options === true) { + if ($size !== false) { + $attributes .= ' size="'.$size.'"'; + } else { + $attributes .= ' size="10"'; + } + } if (!empty($class)) { $attributes .= ' class="'.$class.'"';