Append aliases to mail vacation addresses insted of replacing them with existing one

This commit is contained in:
Hadi Nategh 2014-08-21 15:08:15 +00:00
parent d0411750fc
commit 8399373f35

View File

@ -3071,12 +3071,23 @@ app.classes.mail = AppJS.extend(
sieve_vac_all_aliases: function() sieve_vac_all_aliases: function()
{ {
var aliases = []; var aliases = [];
var tmp = [];
var addr = this.et2.getWidgetById('addresses'); var addr = this.et2.getWidgetById('addresses');
var addresses = this.et2.getArrayMgr('sel_options').data.addresses; var addresses = this.et2.getArrayMgr('sel_options').data.addresses;
for(var id in addresses) aliases.push(id); for(var id in addresses) aliases.push(id);
if (addr)
addr.set_value(aliases); {
tmp = aliases.concat(addr.get_value());
// returns de-duplicate items of an array
var deDuplicator = function (item,pos){
return tmp.indexOf(item) == pos
};
aliases = tmp.filter(deDuplicator);
addr.set_value(aliases);
}
}, },
/** /**