From eaacac1b4059b570a2fb7730550460b1cc19b0b4 Mon Sep 17 00:00:00 2001 From: hadi Date: Wed, 21 Jun 2023 16:45:23 +0200 Subject: [PATCH] Add new mail preference in order to be able to select the type info shown on email tags --- mail/inc/class.mail_hooks.inc.php | 14 ++++++++++++++ mail/inc/class.mail_ui.inc.php | 4 +++- mail/js/app.js | 2 +- mail/templates/default/display.xet | 10 +++++----- mail/templates/default/index.xet | 8 +++++--- mail/templates/mobile/view.xet | 8 ++++---- 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index dc46401bed..fd8a131991 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -361,6 +361,20 @@ class mail_hooks 'admin' => False, 'default'=> 'always', ], + 'emailTag' => [ + 'type' => 'select', + 'label' => 'Information to show on email tag', + 'help' => 'You can select what info to be dispayed on email tag', + 'name' => 'emailTag', + 'values' => [ + 'onlyname' => lang('only name'), + 'fullemail' => lang('name and email'), + 'onlyemail' => lang('only email'), + ], + 'xmlrpc' => True, + 'admin' => False, + 'default'=> 'onlyname', + ], array( 'type' => 'section', 'title' => lang('Configuration settings'), diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 6345b61e6c..07d45da5c3 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -591,6 +591,8 @@ class mail_ui { $content[self::$nm_index]['cat_id']=($content[self::$nm_index]['cat_id']?(!Mail::$supportsORinQuery[$this->mail_bo->profileID]&&($content[self::$nm_index]['cat_id']=='quick'||$content[self::$nm_index]['cat_id']=='quickwithcc')?'subject':$content[self::$nm_index]['cat_id']):(Mail::$supportsORinQuery[$this->mail_bo->profileID]?'quick':'subject')); } + + $content['emailTag'] = $GLOBALS['egw_info']['user']['preferences']['mail']['emailTag'] ?? 'onlyname'; $readonlys = $preserv = array(); if (Mail::$debugTimes) Mail::logRunTimes($starttime,null,'',__METHOD__.__LINE__); } @@ -2347,7 +2349,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2); // send configured image proxy to client-side $content['image_proxy'] = self::image_proxy(); $content['avatar'] = Api\Mail\Avatar::getAvatar($content['from'][0]); - + $content['emailTag'] = $GLOBALS['egw_info']['user']['preferences']['mail']['emailTag'] ?? 'onlyname'; $etpl->exec('mail.mail_ui.displayMessage', $content, $sel_options, $readonlys, $preserv, 2); } diff --git a/mail/js/app.js b/mail/js/app.js index 54fb8fb514..a339af68a3 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -1152,7 +1152,7 @@ app.classes.mail = AppJS.extend( { rowId = this.mail_fetchCurrentlyFocussed(selected); data = egw.dataGetUIDdata(rowId).data; - + data.emailTag = egw.preference('emailTag', 'mail') ?? 'onlyname'; // Try to resolve winmail.data attachment if (data && data.attachmentsBlock[0] && data.attachmentsBlock[0].winmailFlag diff --git a/mail/templates/default/display.xet b/mail/templates/default/display.xet index 3fcda9995b..70ea9eab99 100644 --- a/mail/templates/default/display.xet +++ b/mail/templates/default/display.xet @@ -78,24 +78,24 @@ - + - + - + - + - + diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet index 99bc1193f1..3a50640f54 100644 --- a/mail/templates/default/index.xet +++ b/mail/templates/default/index.xet @@ -30,19 +30,21 @@ - + diff --git a/mail/templates/mobile/view.xet b/mail/templates/mobile/view.xet index b477d3a52f..638a8139c6 100644 --- a/mail/templates/mobile/view.xet +++ b/mail/templates/mobile/view.xet @@ -21,18 +21,18 @@ - + - + - + - +