Fix "From" field in mail display always get abbreviated

This commit is contained in:
Hadi Nategh 2016-08-18 18:56:52 +02:00
parent 7e14298339
commit 65b331749d
2 changed files with 16 additions and 3 deletions

View File

@ -244,6 +244,12 @@ var et2_url_ro = (function(){ "use strict"; return et2_valueWidget.extend([et2_I
"type": "boolean",
"default": false,
"description": "Allow to add email as contact to addressbook"
},
"full_email": {
"name": "Show full email address",
"type": "boolean",
"default": true,
"description": "Allow to show full email address if ture otherwise show only name"
}
},
@ -315,7 +321,7 @@ var et2_url_ro = (function(){ "use strict"; return et2_valueWidget.extend([et2_I
}
}
// wrap email address if there's a name
if (this.span.text() && this.span.text().split("<"))
if (this.span.text() && this.span.text().split("<") && this.options.full_email)
{
var val = this.span.text().split("<");
val = val[0] != ""? val[0]: val[2];

View File

@ -792,7 +792,14 @@ app.classes.mail = AppJS.extend(
else
{
var value = remembervalue+(remembervalue?',':'')+content[i];
var email = et2_createWidget('url-email',{id:widget.id+'_'+i, value:value,readonly:true, contact_plus:true},widget);
var url_email_options = {
id:widget.id+'_'+i,
value:value,
readonly:true,
contact_plus:true,
full_email:typeof field['full_email'] !='undefined'?field['full_email']:true
};
var email = et2_createWidget('url-email',url_email_options,widget);
email.loadingFinished();
remembervalue = '';
}
@ -830,7 +837,7 @@ app.classes.mail = AppJS.extend(
var dataElem = {data:{FROM:"",SENDER:"",TO:"",CC:"",BCC:""}};
var content = this.et2.getArrayMgr('content').data;
var expand_content = [
{build_children: true, data_one: 'FROM', data: 'FROM', widget: 'FROM', line: 'mailDisplayHeadersFrom'},
{build_children: true, data_one: 'FROM', data: 'FROM', widget: 'FROM', line: 'mailDisplayHeadersFrom', full_email:false},
{build_children: true, data: 'SENDER', widget: 'SENDER', line: 'mailDisplayHeadersSender'},
{build_children: true, data: 'TO', widget: 'TO', line: 'mailDisplayHeadersTo'},
{build_children: true, data: 'CC', widget: 'CC', line: 'mailDisplayHeadersCc'},