From f69166bd53a2d657382392a6411d0b617cd9a670 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Mon, 28 Sep 2020 18:04:46 +0200
Subject: [PATCH] Updates style width group selector

---
 pandora_console/extensions/agents_modules.php   |  4 ++--
 .../godmode/alerts/alert_special_days.php       |  2 ++
 .../godmode/alerts/configure_alert_action.php   |  4 ++--
 .../godmode/alerts/configure_alert_command.php  |  4 ++--
 .../godmode/alerts/configure_alert_template.php |  4 ++--
 .../godmode/events/event_edit_filter.php        |  8 ++++----
 .../godmode/reporting/map_builder.php           |  3 ++-
 .../reporting/visual_console_builder.data.php   |  4 ++--
 pandora_console/godmode/setup/news.php          |  2 ++
 .../godmode/snmpconsole/snmp_alert.php          |  2 ++
 pandora_console/include/styles/pandora.css      | 16 +++++++++++-----
 .../operation/agentes/exportdata.php            |  4 ++--
 .../agentes/pandora_networkmap.editor.php       | 17 +++++++++++++----
 .../operation/messages/message_edit.php         |  4 ++--
 14 files changed, 50 insertions(+), 28 deletions(-)

diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php
index 7d5cbc0c99..46df512577 100644
--- a/pandora_console/extensions/agents_modules.php
+++ b/pandora_console/extensions/agents_modules.php
@@ -389,8 +389,8 @@ function mainAgentsModules()
     $filter_groups_label = '<b>'.__('Group').'</b>';
     $filter_groups = html_print_select_groups(false, 'AR', true, 'group_id', $group_id, '', '', '', true, false, true, '', false, 'width: auto;');
 
-    $filter_recursion_label = '<b>'.__('Recursion').'</b>';
-    $filter_recursion = html_print_checkbox('recursion', 1, 0, true);
+    $filter_recursion_label = '</td><td><b>'.__('Recursion').'</b>';
+    $filter_recursion = html_print_checkbox('recursion', 1, 0, true).'</td>';
     // Groups module.
     $filter_module_groups_label = '<b>'.__('Module group').'</b>';
     $filter_module_groups = html_print_select_from_sql(
diff --git a/pandora_console/godmode/alerts/alert_special_days.php b/pandora_console/godmode/alerts/alert_special_days.php
index d1a91eb645..23a4768510 100644
--- a/pandora_console/godmode/alerts/alert_special_days.php
+++ b/pandora_console/godmode/alerts/alert_special_days.php
@@ -296,7 +296,9 @@ if (!users_can_manage_group_all('LM')) {
     $can_manage_group_all = true;
 }
 
+echo '<div class="inline w250px">';
 html_print_select_groups(false, 'LM', $can_manage_group_all, 'id_group', $id_group, false, '', 0, false, false, true, '', false, 'width:100px;');
+echo '</div>';
 echo '</td><td>';
 echo __('Overwrite');
 ui_print_help_tip(__('Check this box, if you want to overwrite existing same days.'), false);
diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php
index 1b57c53780..2bc922b598 100644
--- a/pandora_console/godmode/alerts/configure_alert_action.php
+++ b/pandora_console/godmode/alerts/configure_alert_action.php
@@ -168,7 +168,7 @@ $table->data[1][0] = __('Group');
 
 $own_info = get_user_info($config['id_user']);
 
-$table->data[1][1] = html_print_select_groups(
+$table->data[1][1] = '<div class="w250px inline">'.html_print_select_groups(
     false,
     'LW',
     true,
@@ -182,7 +182,7 @@ $table->data[1][1] = html_print_select_groups(
     true,
     '',
     $is_central_policies_on_node
-);
+).'</div>';
 $table->colspan[1][1] = 2;
 
 $table->data[2][0] = __('Command');
diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php
index 9300dc038b..99b676ccd7 100644
--- a/pandora_console/godmode/alerts/configure_alert_command.php
+++ b/pandora_console/godmode/alerts/configure_alert_command.php
@@ -218,7 +218,7 @@ $table->data['command'][1] = html_print_textarea(
 
 $table->colspan['group'][1] = 3;
 $table->data['group'][0] = __('Group');
-$table->data['group'][1] = html_print_select_groups(
+$table->data['group'][1] = '<div class="w250px inline">'.html_print_select_groups(
     false,
     'LM',
     true,
@@ -232,7 +232,7 @@ $table->data['group'][1] = html_print_select_groups(
     true,
     '',
     $is_central_policies_on_node
-);
+).'</div>';
 
 $table->colspan['description'][1] = 3;
 $table->data['description'][0] = __('Description');
diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php
index 9333664477..7c3e026e18 100644
--- a/pandora_console/godmode/alerts/configure_alert_template.php
+++ b/pandora_console/godmode/alerts/configure_alert_template.php
@@ -1096,7 +1096,7 @@ if ($step == 2) {
     }
 
     $table->data[0][1] .= '&nbsp;';
-    $table->data[0][1] .= html_print_select_groups(
+    $table->data[0][1] .= '<div class="w250px inline">'.html_print_select_groups(
         false,
         'AR',
         $display_all_group,
@@ -1110,7 +1110,7 @@ if ($step == 2) {
         true,
         '',
         $is_central_policies_on_node
-    );
+    ).'</div>';
 
 
     $table->data[1][0] = __('Description');
diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php
index a677c6f801..ac1d67a4c1 100644
--- a/pandora_console/godmode/events/event_edit_filter.php
+++ b/pandora_console/godmode/events/event_edit_filter.php
@@ -241,7 +241,7 @@ if ($returnAllGroup === false && $id_group_filter == 0) {
     $returnAllGroup = true;
 }
 
-$table->data[1][1] = html_print_select_groups(
+$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
     $config['id_user'],
     $access,
     $returnAllGroup,
@@ -260,11 +260,11 @@ $table->data[1][1] = html_print_select_groups(
     false,
     'id_grupo',
     $strict_user
-);
+).'</div>';
 
 $table->data[2][0] = '<b>'.__('Group').'</b>';
 $display_all_group = (users_is_admin() || users_can_manage_group_all('AR'));
-$table->data[2][1] = html_print_select_groups(
+$table->data[2][1] = '<div class="w250px">'.html_print_select_groups(
     $config['id_user'],
     'AR',
     $display_all_group,
@@ -274,7 +274,7 @@ $table->data[2][1] = html_print_select_groups(
     '',
     '',
     true
-);
+).'</div>';
 
 $types = get_event_types();
 // Expand standard array to add not_normal (not exist in the array, used only for searches)
diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php
index 75aaa35d2d..9f8b8f0162 100644
--- a/pandora_console/godmode/reporting/map_builder.php
+++ b/pandora_console/godmode/reporting/map_builder.php
@@ -307,8 +307,9 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'VR')) {
     $return_all_group = true;
 }
 
+echo '<div class="w250px inline">';
 html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false);
-
+echo '</div>';
 echo "<td style='width:25%;'>";
 echo __('Group Recursion').'&nbsp;';
 html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()');
diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php
index 0b765debad..5a0d4fb0f5 100644
--- a/pandora_console/godmode/reporting/visual_console_builder.data.php
+++ b/pandora_console/godmode/reporting/visual_console_builder.data.php
@@ -136,7 +136,7 @@ if ($action == 'new') {
 $table->data[1][0] = __('Group:');
 
 
-$table->data[1][1] = html_print_select_groups(
+$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
     $config['id_user'],
     'RW',
     true,
@@ -146,7 +146,7 @@ $table->data[1][1] = html_print_select_groups(
     '',
     '',
     true
-);
+).'</div>';
 $backgrounds_list = list_files(
     $config['homedir'].'/images/console/background/',
     'jpg',
diff --git a/pandora_console/godmode/setup/news.php b/pandora_console/godmode/setup/news.php
index 61491496f5..ba74414a7e 100644
--- a/pandora_console/godmode/setup/news.php
+++ b/pandora_console/godmode/setup/news.php
@@ -176,7 +176,9 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
     $data[0] .= '<input type="text" name="subject" size="35" value="'.$subject.'">';
 
     $data[1] = __('Group').'<br>';
+    $data[1] .= '<div class="w250px">';
     $data[1] .= html_print_select_groups($config['id_user'], 'ER', users_can_manage_group_all(), 'id_group', $id_group, '', '', 0, true, false, false, '');
+    $data[1] .= '</div>';
 
     $data[2] = __('Modal screen').'<br>';
     $data[2] .= html_print_checkbox_extended('modal', 1, $modal, false, '', 'style="margin-top: 5px;margin-bottom: 7px;"', true);
diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php
index 7728668454..13d22aca69 100755
--- a/pandora_console/godmode/snmpconsole/snmp_alert.php
+++ b/pandora_console/godmode/snmpconsole/snmp_alert.php
@@ -776,6 +776,7 @@ if ($create_alert || $update_alert) {
 
     // Group
     echo '<tr id="tr-group"><td class="datos2">'.__('Group').'</td><td class="datos2">';
+    echo '<div class="w250px">';
     html_print_select_groups(
         $config['id_user'],
         'AR',
@@ -796,6 +797,7 @@ if ($create_alert || $update_alert) {
         'id_grupo',
         false
     );
+    echo '</div>';
     echo '</td></tr>';
 
     // Trap type
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index cabdd59ee4..29fbe3341f 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -453,6 +453,14 @@ select:-internal-list-box {
   width: 120px;
   max-width: 120px;
 }
+.w240px {
+  width: 240px;
+  max-width: 240px;
+}
+.w250px {
+  width: 250px;
+  max-width: 250px;
+}
 .mw120px {
   min-width: 120px;
 }
@@ -477,6 +485,9 @@ select:-internal-list-box {
 .nowrap {
   white-space: nowrap;
 }
+.inline {
+  display: inline-block;
+}
 .w10p {
   width: 10%;
 }
@@ -593,11 +604,6 @@ select:-internal-list-box {
 .flex-start {
   justify-content: flex-start;
 }
-
-.nowrap {
-  flex-wrap: nowrap;
-}
-
 .padding-2 {
   padding: 2em;
 }
diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php
index 5743084f6a..402b409e42 100644
--- a/pandora_console/operation/agentes/exportdata.php
+++ b/pandora_console/operation/agentes/exportdata.php
@@ -227,7 +227,7 @@ if (empty($export_btn) || $show_form) {
 
     $groups = users_get_groups($config['id_user'], 'RR', users_can_manage_group_all());
 
-    $table->data[0][1] = html_print_select_groups(
+    $table->data[0][1] = '<div class="w250px">'.html_print_select_groups(
         $config['id_user'],
         'RR',
         true,
@@ -241,7 +241,7 @@ if (empty($export_btn) || $show_form) {
         true,
         '',
         false
-    );
+    ).'</div>';
 
     // Agent selector.
     $table->data[1][0] = '<b>'.__('Source agent').'</b>';
diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php
index 16a26257ac..a16874705c 100644
--- a/pandora_console/operation/agentes/pandora_networkmap.editor.php
+++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php
@@ -266,17 +266,26 @@ if ($not_found) {
     );
 
     $table->data[1][0] = __('Group');
-    $table->data[1][1] = html_print_select_groups(
+    $table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
+        // Id_user.
         $config['id_user'],
+        // Privilege.
         'AR',
+        // ReturnAllGroup.
         true,
+        // Name.
         'id_group_map',
+        // Selected.
         $id_group_map,
+        // Script.
         '',
+        // Nothing.
         '',
+        // Nothing_value.
         '',
+        // Return.
         true
-    );
+    ).'</div>';
 
     $table->data[2][0] = __('Node radius');
     $table->data[2][1] = html_print_input_text(
@@ -333,7 +342,7 @@ if ($not_found) {
     $table->data['source_data_ip_mask'][1] = html_print_input_text('ip_mask', $ip_mask, '', 20, 255, true, $disabled_source);
 
     $table->data['source_data_group'][0] = __('Source group');
-    $table->data['source_data_group'][1] = html_print_select_groups(
+    $table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups(
         $config['id_user'],
         'AR',
         true,
@@ -343,7 +352,7 @@ if ($not_found) {
         '',
         '',
         true
-    );
+    ).'</div>';
     $table->data['source_data_group'][1] .= html_print_image(
         'images/error.png',
         true,
diff --git a/pandora_console/operation/messages/message_edit.php b/pandora_console/operation/messages/message_edit.php
index 732dd9aeb1..3e6bbf412b 100644
--- a/pandora_console/operation/messages/message_edit.php
+++ b/pandora_console/operation/messages/message_edit.php
@@ -306,7 +306,7 @@ $table->data[1][1] = html_print_select(
     false
 );
 $table->data[1][1] .= '&nbsp;&nbsp;'.__('OR').'&nbsp;&nbsp;';
-$table->data[1][1] .= html_print_select_groups(
+$table->data[1][1] .= '<div class="w250px">'.html_print_select_groups(
     $config['id_user'],
     'AR',
     $return_all_groups,
@@ -316,7 +316,7 @@ $table->data[1][1] .= html_print_select_groups(
     __('Select group'),
     '',
     true
-);
+).'</div>';
 
 $table->data[2][0] = __('Subject');
 $table->data[2][1] = html_print_input_text(