Mail - display multiple From addresses

This commit is contained in:
nathangray 2019-01-22 10:48:39 -07:00
parent 4381af2839
commit b9292aad18
6 changed files with 21 additions and 3 deletions

View File

@ -1777,6 +1777,16 @@ class Mail
//error_log(__METHOD__.' ('.__LINE__.') '.$headerObject['SUBJECT'].'->'.array2string($_headerObject->getEnvelope()->__get('from')));
if(is_array($headerObject['FROM']) && $headerObject['FROM'][0]) {
$retValue['header'][$sortOrder[$uid]]['sender_address'] = self::decode_header($headerObject['FROM'][0],true);
if (count($headerObject['FROM'])>1)
{
$ki=0;
foreach($headerObject['FROM'] as $k => $add)
{
if ($k==0) continue;
$retValue['header'][$sortOrder[$uid]]['additional_from_addresses'][$ki] = self::decode_header($add,true);
$ki++;
}
}
}
if(is_array($headerObject['REPLY-TO']) && $headerObject['REPLY-TO'][0]) {
$retValue['header'][$sortOrder[$uid]]['reply_to_address'] = self::decode_header($headerObject['REPLY-TO'][0],true);

View File

@ -207,6 +207,9 @@ a.et2_url.url {
.et2_email > span.email {
display: none;
}
.et2_email a:not(:first-child) {
margin-left: 1em;
}
/**
* Button widget - text only, and icon
*/

View File

@ -2003,6 +2003,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
{
$data["fromaddress"] = $header['sender_address'];
}
$data['additionalfromaddress'] = $header['additional_from_addresses'];
if (in_array("ccaddress", $cols))
{
$data['ccaddress'] = $header['cc_addresses'];

View File

@ -1006,7 +1006,6 @@ app.classes.mail = AppJS.extend(
// Widget ID:data key map of widgets we can directly set from cached data
var data_widgets = {
'previewFromAddress': 'fromaddress',
'previewDate': 'date',
'previewSubject': 'subject'
};
@ -1051,6 +1050,7 @@ app.classes.mail = AppJS.extend(
// TO addresses have the first one split out, not all together
// list of keys:
var expand_content = [
{build_children: true, data_one: 'fromaddress', data: 'additionalfromaddress', widget: 'additionalFromAddress', line: 'mailPreviewHeadersFrom'},
{build_children: true, data_one: 'toaddress', data: 'additionaltoaddress', widget: 'additionalToAddress', line: 'mailPreviewHeadersTo'},
{build_children: true, data: 'ccaddress', widget: 'additionalCCAddress', line: 'mailPreviewHeadersCC'},
{build_children: false, data: 'attachmentsBlock', widget:'previewAttachmentArea', line: 'mailPreviewHeadersAttachments'}

View File

@ -12,7 +12,9 @@
<hbox>
<hbox class="mailDisplayHeaders" id="mailDisplayHeadersFrom" disabled="!@FROM" width="70%">
<description value="From"/>
<url-email id="FROM" readonly="true"/>
<hbox id="FROM" class="mail_extraEmails">
</hbox>
<buttononly class="et2_button ui-button" label="Show all Addresses" image="foldertree_nolines_plus" onclick="app.mail.showAllHeader"/>
</hbox>
<hbox class="mailDisplayHeaders" align="right" width="30%">
<description value="Date"/>

View File

@ -13,7 +13,9 @@
</box>
<hbox width="100%" id="mailPreviewHeadersFrom" class="mailPreviewHeaders">
<description value="From"/>
<url-email id="previewFromAddress" contact_plus = "true" readonly="true"/>
<hbox id="additionalFromAddress" class="mail_extraEmails">
</hbox>
<buttononly class="et2_button ui-button" label="Show all Addresses" image="foldertree_nolines_plus" onclick="app.mail.showAllHeader"/>
</hbox>
<hbox id="mailPreviewHeadersSubject" class="mailPreviewHeaders">
<description value="Subject"/>