diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index feeba60aa9..7e9f29f2eb 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1357,12 +1357,11 @@ $(document).ready (function () { jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) { tag_name = $(value).html(); if (tag_name != <?php echo "'".__('None')."'"; ?>) { - id_tag = $(value).attr('value'); - $("select[name='id_tag_selected[]']").append($("<option></option>").val(id_tag).html('<i>' + tag_name + '</i>')); + $("select[name='id_tag_selected[]']").append(value); $("#id_tag_available").find("option[value='" + id_tag + "']").remove(); $("#id_tag_selected").find("option[value='']").remove(); if($("#id_tag_available option").length == 0) { - $("select[name='id_tag_available[]']").append($("<option></option>").val('').html('<i><?php echo __('None'); ?></i>')); + $("select[name='id_tag_available[]']").append(value); } } }); @@ -1373,11 +1372,11 @@ $(document).ready (function () { tag_name = $(value).html(); if (tag_name != <?php echo "'".__('None')."'"; ?>) { id_tag = $(value).attr('value'); - $("select[name='id_tag_available[]']").append($("<option>").val(id_tag).html('<i>' + tag_name + '</i>')); + $("select[name='id_tag_available[]']").append(value); $("#id_tag_selected").find("option[value='" + id_tag + "']").remove(); $("#id_tag_available").find("option[value='']").remove(); if($("#id_tag_selected option").length == 0) { - $("select[name='id_tag_selected[]']").append($("<option></option>").val('').html('<i><?php echo __('None'); ?></i>')); + $("select[name='id_tag_selected[]']").append(value); } } }); diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 5a259cd62f..0bce00abfa 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -717,7 +717,8 @@ function html_print_select( $message='', $select_all=false, $simple_multiple_options=false, - $required=false + $required=false, + $truncate_size=false ) { $output = "\n"; @@ -853,6 +854,18 @@ function html_print_select( $output .= ' style="'.$option_style[$value].'"'; } + if ($truncate_size !== false) { + $output .= ' Title="'.$optlabel.'"'; + + $optlabel = ui_print_truncate_text( + $optlabel, + $truncate_size, + false, + true, + false + ); + } + if ($optlabel === '') { $output .= '>None</option>'; } else { @@ -1502,7 +1515,7 @@ function html_print_select_from_sql( $disabled=false, $style=false, $size=false, - $trucate_size=GENERIC_SIZE_TEXT, + $truncate_size=GENERIC_SIZE_TEXT, $class='', $required=false ) { @@ -1517,13 +1530,7 @@ function html_print_select_from_sql( foreach ($result as $row) { $id = array_shift($row); $value = array_shift($row); - $fields[$id] = ui_print_truncate_text( - $value, - $trucate_size, - false, - true, - false - ); + $fields[$id] = $value; } return html_print_select( @@ -1550,7 +1557,8 @@ function html_print_select_from_sql( // Simple_multiple_options. false, // Required. - $required + $required, + $truncate_size ); }