Make sure there are not empty options on dst select to avoid creating empty user or group. This issue was introduced by b4e9a4da

This commit is contained in:
Renato Botelho 2014-08-05 07:48:29 -03:00
parent 46f6eb7892
commit 4c4c59b94d
2 changed files with 12 additions and 0 deletions

View File

@ -210,6 +210,12 @@ function remove_selected(id) {
function copy_selected(srcid, dstid) {
src_selbox = document.getElementById(srcid);
dst_selbox = document.getElementById(dstid);
count = dst_selbox.options.length;
for (index = count - 1; index >= 0; index--) {
if (dst_selbox.options[index].value == '') {
dst_selbox.remove(index);
}
}
count = src_selbox.options.length;
for (index = 0; index < count; index++) {
if (src_selbox.options[index].selected) {

View File

@ -393,6 +393,12 @@ function remove_selected(id) {
function copy_selected(srcid, dstid) {
src_selbox = document.getElementById(srcid);
dst_selbox = document.getElementById(dstid);
count = dst_selbox.options.length;
for (index = count - 1; index >= 0; index--) {
if (dst_selbox.options[index].value == '') {
dst_selbox.remove(index);
}
}
count = src_selbox.options.length;
for (index = 0; index < count; index++) {
if (src_selbox.options[index].selected) {