diff --git a/etemplate/js/et2_widget_selectAccount.js b/etemplate/js/et2_widget_selectAccount.js index 1ed522fe59..038a1414fa 100644 --- a/etemplate/js/et2_widget_selectAccount.js +++ b/etemplate/js/et2_widget_selectAccount.js @@ -113,7 +113,7 @@ var et2_selectAccount = et2_selectbox.extend( { var button = jQuery(document.createElement("span")) .addClass("et2_clickable") - .click(this, this._open_search) + .click(this, this.options.multiple ? this._open_multi_search : this._open_search) .attr("title", egw.lang("popup with search")) .append(''); @@ -308,10 +308,14 @@ var et2_selectAccount = et2_selectbox.extend( ids.push(id); // Make sure option is there - if(jQuery('input[id$="_opt_'+id+'"]',widget.multiOptions).length == 0) + if(!widget.options.multiple && jQuery('input[id$="_opt_'+id+'"]',widget.multiOptions).length == 0) { widget._appendMultiOption(id,jQuery('label',this).text()); } + else if (widget.options.multiple && jQuery('option[value="'+id+'"]',widget.node).length == 0) + { + widget._appendOptionElement(id,jQuery('label',this).text()); + } }); widget.set_value(ids); @@ -436,6 +440,9 @@ var et2_selectAccount = et2_selectbox.extend( var node = null; var self = this; + + // Make sure value is numeric + if(item.value) item.value = parseInt(item.value); // (containter of) Currently selected users / groups var selected = jQuery('#'+this.getInstanceManager().uniqueId + "_selected", this.dialog);