Hi Roundcube-Devs
I have created a patch for trac-ticket #1488732 and testet it successfully
on my instance roundcube.git.
Could you please take a look at this new feature, provide suggestions if
needed or include it into your maintree?
Kind regards
Jan
Signed-off-by: Jan Fader <jan.fader(a)web.de>
---
CHANGELOG | 1 +
program/localization/en_GB/labels.inc | 1 +
program/steps/mail/func.inc | 15 ++++++++++++++-
program/steps/settings/func.inc | 11 +++++++++++
program/steps/settings/save_prefs.inc | 1 +
5 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 6fef2d0..729510a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- show full email along with display name (#1488732)
- Fix HTML part detection for some specific message structures (#1488992)
- Don't show fake address - phishing prevention (#1488981)
- Fix forward as attachment bug with editormode != 1 (#1488991)
diff --git a/program/localization/en_GB/labels.inc b/program/localization/en_GB/labels.inc
index fb9ebe3..c7bdd09 100644
--- a/program/localization/en_GB/labels.inc
+++ b/program/localization/en_GB/labels.inc
@@ -393,6 +393,7 @@ $labels['pagesize'] = 'Rows per page';
$labels['signature'] = 'Signature';
$labels['dstactive'] = 'Summer time';
$labels['showinextwin'] = 'Open message in a new window';
+$labels['show_fullemail'] = 'Show full email along with display name';
$labels['composeextwin'] = 'Compose in a new window';
$labels['htmleditor'] = 'Compose HTML messages';
$labels['htmlonreply'] = 'on reply to HTML message only';
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 137e87d..7d821fe 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1463,13 +1463,26 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
}
else if (check_email($part['mailto'], false)) {
if ($linked) {
- $address = html::a(array(
+ $user_prefs=$RCMAIL->user->get_prefs();
+ if ($user_prefs['message_show_fullemail']) {
+ $address = html::a(array(
+ 'href' => 'mailto:'.$mailto,
+ 'onclick' => sprintf("return %s.command('compose','%s',this)", JS_OBJECT_NAME, JQ($mailto)),
+ 'title' => $mailto,
+ 'class' => "rcmContactAddress",
+ ),
+
+ Q($name? sprintf('"%s" %s',$name,$mailto): $mailto));
+ }
+ else {
+ $address = html::a(array(
'href' => 'mailto:'.$mailto,
'onclick' => sprintf("return %s.command('compose','%s',this)", JS_OBJECT_NAME, JQ($mailto)),
'title' => $mailto,
'class' => "rcmContactAddress",
),
Q($name ? $name : $mailto));
+ }
}
else {
$address = html::span(array('title' => $mailto, 'class' => "rcmContactAddress"),
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 2f726c7..59104a3 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -418,6 +418,17 @@ function rcmail_user_prefs($current=null)
);
}
+ // show checkbox to show full email instead of name
+ if (!isset($no_override['message_show_fullemail'])) {
+ $field_id = 'rcmfd_message_show_fullemail';
+ $input_msgshowfullemail = new html_checkbox(array('name' => '_message_show_fullemail', 'id' => $field_id, 'value' => 1));
+
+ $blocks['main']['options']['message_show_fullemail'] = array(
+ 'title' => html::label($field_id, Q(rcube_label('show_fullemail'))),
+ 'content' => $input_msgshowfullemail->show($config['message_show_fullemail']?1:0),
+ );
+ }
+
// show checkbox for HTML/plaintext messages
if (!isset($no_override['prefer_html'])) {
$field_id = 'rcmfd_htmlmsg';
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index 5daab0d..765c2f5 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -60,6 +60,7 @@ switch ($CURR_SECTION)
case 'mailview':
$a_user_prefs = array(
'message_extwin' => intval($_POST['_message_extwin']),
+ 'message_show_fullemail' => isset($_POST['_message_show_fullemail']) ? TRUE : FALSE,
'prefer_html' => isset($_POST['_prefer_html']) ? TRUE : FALSE,
'inline_images' => isset($_POST['_inline_images']) ? TRUE : FALSE,
'show_images' => isset($_POST['_show_images']) ? intval($_POST['_show_images']) : 0,
--
1.6.0.2