diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 8c2ced21f3..74ea48754a 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2114,17 +2114,21 @@ $filter['before']= date("d-M-Y", $cutoffdate2); if ($header['disposition-notification-to']) $data['dispositionnotificationto'] = $header['disposition-notification-to']; if (($header['mdnsent']||$header['mdnnotsent']|$header['seen'])&&isset($data['dispositionnotificationto'])) unset($data['dispositionnotificationto']); $data['attachmentsBlock'] = $imageHTMLBlock; - $data['address'] = ($_folderType?$data["toaddress"]:$data["fromaddress"]); - $email = Mail::stripRFC822Addresses(array($data['address'])); + if ($_folderType) + { + $fromcontact = self::getContactFromAddress($data['fromaddress']); + if (!empty($fromcontact)) + { + $data['fromavatar'] = self::getContactFromAddress($data['fromaddress'])[0]['photo']; + } + } + $data['address'] = ($_folderType ? $data["toaddress"] : $data["fromaddress"]); - $contact = $GLOBALS['egw']->contacts->search( - array('contact_email' => $email[0], 'contact_email_home' => $email[0]), - array('contact_id', 'email', 'email_home', 'n_fn'), - '', '', '', false, 'OR', false - ); + $contact = self::getContactFromAddress($data['address']); if (!empty($contact)) { $data['avatar'] = $contact[0]['photo']; + if (!$_folderType) $data['fromavatar'] = $data['avatar']; } if (in_array("bodypreview", $cols)&&$header['bodypreview']) @@ -2329,10 +2333,33 @@ $filter['before']= date("d-M-Y", $cutoffdate2); } // send configured image proxy to client-side $content['image_proxy'] = self::image_proxy(); + $contact = self::getContactFromAddress($content['from'][0]); - $etpl->exec('mail.mail_ui.displayMessage',$content,$sel_options,$readonlys,$preserv,2); + if (!empty($contact)) + { + $content['avatar'] = $contact[0]['photo']; + } + + $etpl->exec('mail.mail_ui.displayMessage', $content, $sel_options, $readonlys, $preserv, 2); } + /** + * Retrive contact info from a given address + * @param $address + * @return mixed + */ + static function getContactFromAddress(string $address) + { + $email = Mail::stripRFC822Addresses([$address]); + + return $GLOBALS['egw']->contacts->search( + array('contact_email' => $email[0], 'contact_email_home' => $email[0]), + array('contact_id', 'email', 'email_home', 'n_fn'), + '', '', '', false, 'OR', false + ); + } + + /** * This is a helper function to trigger Push method * faster than normal 60 sec cycle. diff --git a/mail/templates/default/display.xet b/mail/templates/default/display.xet index 2b61a2963e..4ee943de9a 100644 --- a/mail/templates/default/display.xet +++ b/mail/templates/default/display.xet @@ -20,7 +20,7 @@ - + diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet index 48d9cb2c04..73307e36e4 100644 --- a/mail/templates/default/index.xet +++ b/mail/templates/default/index.xet @@ -36,7 +36,7 @@ - + diff --git a/mail/templates/mobile/app.css b/mail/templates/mobile/app.css index 38dd773a1b..5c694c9822 100644 --- a/mail/templates/mobile/app.css +++ b/mail/templates/mobile/app.css @@ -31,21 +31,21 @@ padding: 1px 8px 0 8px; background: none; } - body #popupMainDiv div.et2_toolbar.et2_head_toolbar { + body #popupMainDiv .et2_toolbar.et2_head_toolbar { padding: 1px 5px 5px 10px !important; } - body #popupMainDiv div.et2_toolbar.et2_head_toolbar button { + body #popupMainDiv .et2_toolbar.et2_head_toolbar et2-button { width: 46px; height: 46px; background-size: 18px 18px; } - body #popupMainDiv div.et2_toolbar.et2_head_toolbar button.et2_toolbar_hasCaption { + body #popupMainDiv .et2_toolbar.et2_head_toolbar .et2_toolbar_hasCaption { width: auto; } - body #popupMainDiv div.et2_toolbar.et2_head_toolbar div.et2_toolbar_actionlist { + body #popupMainDiv .et2_toolbar.et2_head_toolbar .et2_toolbar_actionlist { margin-left: 50px; } - body #popupMainDiv #mail-compose_composeToolbar button#composeToolbar-send { + body #popupMainDiv #mail-compose_composeToolbar #composeToolbar-send { height: 46px; width: auto; margin-top: 0.7px !important; @@ -60,11 +60,11 @@ background-color: #fafafa; color: black; } - body #popupMainDiv #mail-compose_composeToolbar button#composeToolbar-send:hover { + body #popupMainDiv #mail-compose_composeToolbar #composeToolbar-send:hover { box-shadow: none; background-color: none; } - body #popupMainDiv #mail-compose_composeToolbar button#composeToolbar-send:disabled { + body #popupMainDiv #mail-compose_composeToolbar #composeToolbar-send:disabled { background-color: none; } body #popupMainDiv .mail-d-h1 { diff --git a/mail/templates/mobile/app.less b/mail/templates/mobile/app.less index 3c4f64eda8..23b62c6c78 100644 --- a/mail/templates/mobile/app.less +++ b/mail/templates/mobile/app.less @@ -39,24 +39,24 @@ padding: 1px 8px 0 8px; background: none; - div.et2_toolbar.et2_head_toolbar { + .et2_toolbar.et2_head_toolbar { padding: 1px 5px 5px 10px !important; - button { + et2-button { width:46px; height:46px; background-size: 18px 18px; } - button.et2_toolbar_hasCaption { + .et2_toolbar_hasCaption { width:auto; } - div.et2_toolbar_actionlist { + .et2_toolbar_actionlist { margin-left: 50px; } } #mail-compose_composeToolbar{ // Senden Button - button#composeToolbar-send{ + #composeToolbar-send{ height: 46px; width: auto; margin-top: 0.7px !important;