Add new mail preference in order to be able to select the type info shown on email tags

This commit is contained in:
hadi 2023-06-21 16:45:23 +02:00
parent df1a099078
commit 654a8367b6
6 changed files with 32 additions and 14 deletions

View File

@ -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'),

View File

@ -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__);
}
@ -2339,7 +2341,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);
}

View File

@ -1158,7 +1158,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

View File

@ -78,24 +78,24 @@
<et2-vbox class="addresses">
<et2-hbox disabled="!@from">
<et2-description value="From" class="firstColumnTitle"></et2-description>
<et2-select-email id="from" readonly="true" multiple="true"></et2-select-email>
<et2-select-email id="from" readonly="true" multiple="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"></et2-select-email>
<et2-date-time-today align="right" id="mail_displaydate" readonly="true"></et2-date-time-today>
</et2-hbox>
<et2-hbox disabled="!@sender">
<et2-description value="Sender" class="firstColumnTitle"></et2-description>
<et2-select-email id="sender" readonly="true" rows="1" maxTagsVisible="1" multiple="true"></et2-select-email>
<et2-select-email id="sender" readonly="true" rows="1" maxTagsVisible="1" multiple="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@to">
<et2-description value="To" class="firstColumnTitle"></et2-description>
<et2-select-email id="to" readonly="true" rows="1" maxTagsVisible="1" multiple="true"></et2-select-email>
<et2-select-email id="to" readonly="true" rows="1" maxTagsVisible="1" multiple="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@cc">
<et2-description value="Cc" class="firstColumnTitle"></et2-description>
<et2-select-email id="cc" rows="1" maxTagsVisible="1" readonly="true" multiple="true"></et2-select-email>
<et2-select-email id="cc" rows="1" maxTagsVisible="1" readonly="true" multiple="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@bcc">
<et2-description value="Bcc" class="firstColumnTitle"></et2-description>
<et2-select-email id="bcc" rows="1" maxTagsVisible="1" readonly="true" multiple="true"></et2-select-email>
<et2-select-email id="bcc" rows="1" maxTagsVisible="1" readonly="true" multiple="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"></et2-select-email>
</et2-hbox>
<et2-hbox width="100%" disabled="!@mail_displayattachments">
<et2-description value="Attachments" class="firstColumnTitle"></et2-description>

View File

@ -30,19 +30,21 @@
<et2-vbox class="addresses">
<et2-hbox>
<et2-description value="From" class="firstColumnTitle"></et2-description>
<et2-select-email id="additionalfromaddress" readonly="true" multiple="true" onclick="app.mail.onclickCompose"></et2-select-email>
<et2-select-email id="additionalfromaddress" readonly="true"
fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail" multiple="true"
onclick="app.mail.onclickCompose"></et2-select-email>
<et2-date-time align="right" id="date" readonly="true"></et2-date-time>
</et2-hbox>
<et2-hbox disabled="!@toaddress" width="100%">
<et2-description value="To" class="firstColumnTitle"></et2-description>
<et2-select-email id="additionaltoaddress" readonly="true" multiple="true"
rows="1"
rows="1" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"
onTagClick="app.mail.onclickCompose"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@ccaddress" width="100%">
<et2-description value="Cc" class="firstColumnTitle"></et2-description>
<et2-select-email id="ccaddress" readonly="true" multiple="true"
rows="1"
rows="1" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"
onTagClick="app.mail.onclickCompose"></et2-select-email>
</et2-hbox>
<et2-hbox width="100%" disabled="!@attachmentsBlock">

View File

@ -21,18 +21,18 @@
<et2-vbox>
<et2-hbox>
<et2-details class="details" toggleOnHover="true" hoist="true" toggleAlign="left">
<et2-select-email slot="summary" id="fromaddress" readonly="true"/>
<et2-select-email slot="summary" id="fromaddress" readonly="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"/>
<et2-hbox>
<et2-description value="From" class="firstColumnTitle"></et2-description>
<et2-select-email id="additionalfromaddress" readonly="true"></et2-select-email>
<et2-select-email id="additionalfromaddress" readonly="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@toaddress" width="100%">
<et2-description value="To" class="firstColumnTitle"></et2-description>
<et2-select-email id="additionaltoaddress" readonly="true"></et2-select-email>
<et2-select-email id="additionaltoaddress" readonly="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@ccaddress" width="100%">
<et2-description value="Cc" class="firstColumnTitle"></et2-description>
<et2-select-email id="ccaddress" readonly="true"></et2-select-email>
<et2-select-email id="ccaddress" readonly="true" fullEmail="@emailTag=fullemail" onlyEmail="@emailTag=onlyemail"></et2-select-email>
</et2-hbox>
</et2-details>
<et2-date-time-today align="right" id="date" readonly="true"></et2-date-time-today>