handle problems in email display and processing for further use

This commit is contained in:
Klaus Leithoff 2014-09-05 12:28:43 +00:00
parent 0562c8c0b5
commit fa50e7985a
2 changed files with 14 additions and 4 deletions

View File

@ -661,11 +661,21 @@ app.classes.mail = AppJS.extend(
content = content[0].split(','); content = content[0].split(',');
} }
// Add for current record // Add for current record
var remembervalue = '';
for(var i = 0; i < content.length; i++) for(var i = 0; i < content.length; i++)
{ {
var value = content[i]; // if there is no @ in string, its most likely that we have a comma in the personal name part of the emailaddress
if (content[i].indexOf('@')<0)
{
remembervalue = content[i];
}
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 email = et2_createWidget('url-email',{id:widget.id+'_'+i, value:value,readonly:true, contact_plus:true},widget);
email.loadingFinished(); email.loadingFinished();
remembervalue = '';
}
} }
} }
else else

View File

@ -102,7 +102,7 @@ if (!function_exists('imap_rfc822_parse_adrlist'))
foreach(explode(',', $address) as $part) foreach(explode(',', $address) as $part)
{ {
$trimmed = trim(($pending ? $pending.',' : '').$part); $trimmed = trim(($pending ? $pending.',' : '').$part);
if ($trimmed[0] == '"' && substr($trimmed, -1) != '>') if (($trimmed[0] == '"' && substr($trimmed, -1) != '>')||strpos($part, '@')===false)
{ {
$pending .= ($pending ? $pending.',' : '').$part; $pending .= ($pending ? $pending.',' : '').$part;
continue; continue;