Mail - display multiple From addresses

This commit is contained in:
nathangray 2019-01-22 10:48:39 -07:00
parent f255a80f52
commit 4008f82be3
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

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

View File

@ -2013,6 +2013,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

@ -1021,7 +1021,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'
};
@ -1066,6 +1065,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"/>