- Respect force_mailto preference

- If force_mailto is not set, open in a new window instead of current
This commit is contained in:
Nathan Gray 2013-10-07 09:48:17 +00:00
parent ffc506561a
commit 869ebc3ca5

View File

@ -165,14 +165,15 @@ var et2_url = et2_textbox.extend(
} }
break; break;
case "url-email": case "url-email":
if(this.egw().link_registry && this.egw().link_registry.felamimail) if(value.indexOf("mailto:") == -1)
{
return function() {this.egw().open("","felamimail","add","send_to="+jQuery.base64Encode(value));};
}
else if(value.indexOf("mailto:") == -1)
{ {
value = "mailto:"+value; value = "mailto:"+value;
} }
if((this.egw().user('apps').mail || this.egw().user('apps').felamimail) &&
this.egw().preference('force_mailto','addressbook') == '0' )
{
return function() {egw.open_link(value);};
}
break; break;
} }
@ -270,6 +271,10 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],
else else
{ {
this.span.attr("href", link); this.span.attr("href", link);
if(!this.span.attr("target"))
{
this.span.attr("target", "_blank");
}
} }
break; break;
} }