diff --git a/pandora_console/extras/mr/46.sql b/pandora_console/extras/mr/46.sql new file mode 100644 index 0000000000..63e0bf5843 --- /dev/null +++ b/pandora_console/extras/mr/46.sql @@ -0,0 +1,6 @@ +START TRANSACTION; + +ALTER TABLE `tagent_custom_fields` MODIFY COLUMN `combo_values` TEXT NOT NULL DEFAULT ''; + + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index a72fffdc53..7945e60204 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -2519,7 +2519,7 @@ INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Di -- ---------------------------------------------------------------------- -- Add column in table `tagent_custom_fields` -- ---------------------------------------------------------------------- -ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT ''; +ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` TEXT NOT NULL DEFAULT ''; -- ---------------------------------------------------------------------- -- Add column in table `tnetflow_filter` diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 326dde3207..bc8d247994 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -931,24 +931,19 @@ foreach ($fields as $field) { } if ($field['combo_values'] !== '') { - $data_field[1] = html_print_select( - $combo_values, - 'customvalue_'.$field['id_field'], - $custom_value, - '', - __('None'), - '', - true, - false, - false, - '', - false, - false, - false, - false, - false, - '', - false + $data_field[1] = html_print_input( + [ + 'type' => 'select_search', + 'fields' => $combo_values, + 'name' => 'customvalue_'.$field['id_field'], + 'selected' => $custom_value, + 'nothing' => __('None'), + 'nothing_value' => '', + 'return' => true, + 'sort' => false, + 'size' => '400px', + 'dropdownAutoWidth' => true, + ] ); }; diff --git a/pandora_console/godmode/agentes/configure_field.php b/pandora_console/godmode/agentes/configure_field.php index 4a6b086d63..0f7a42820a 100755 --- a/pandora_console/godmode/agentes/configure_field.php +++ b/pandora_console/godmode/agentes/configure_field.php @@ -33,7 +33,7 @@ if ($id_field) { $name = $field['name']; $display_on_front = $field['display_on_front']; $is_password_type = $field['is_password_type']; - $combo_values = $field['combo_values']; + $combo_values = $field['combo_values'] ? $field['combo_values'] : ''; $is_combo_enable = $config['is_combo_enable']; ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, ''); } else { @@ -116,12 +116,12 @@ $table->data[4][0] = __('Combo values').ui_print_help_tip( __('Set values separated by comma'), true ); -$table->data[4][1] = html_print_input_text( +$table->data[4][1] = html_print_textarea( 'combo_values', + 3, + 65, io_safe_output($combo_values), '', - 35, - 200, true ); @@ -144,7 +144,7 @@ echo ''; + +