From 0026d830535eef2e6243bd589225c78499b8261c Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 27 Jul 2021 12:38:37 +0200 Subject: [PATCH] Fix default value for mail's contact label preference --- mail/inc/class.mail_hooks.inc.php | 39 ++++++++++++++++--------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index 1ab0d1fb09..add5ec6761 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -176,6 +176,24 @@ class mail_hooks 'always_display' => lang('always show html emails'), ); + $contactLabelOptions = array ( + 'n_prefix' => array ( + 'id' => 'n_prefix', + 'label' => lang('Prefix'), + ), + 'n_given' => array ( + 'id' => 'n_given', + 'label' => lang('First name') + ), + 'n_family' => array( + 'id' => 'n_family', + 'label' => lang('Last name') + ), + 'org_name' => array( + 'id' => 'org_name', + 'label' => lang('Organisation') + ) + ); // otherwise we get warnings during setup if (!is_array($folderList)) $folderList = array(); @@ -457,29 +475,12 @@ class mail_hooks 'label' => 'Contact label', 'help' => 'Defines what to show as contact label for added contact into To/Cc/Bcc when composing an email. Default is firstname lastname and empty means include eveything available.', 'name' => 'contactLabel', - 'values' => '', + 'values' => $contactLabelOptions, 'attributes' => array( 'allowFreeEntries' => false, 'editModeEnabled' => false, 'autocomplete_url' => ' ', - 'select_options' => array ( - 'n_prefix' => array ( - 'id' => 'n_prefix', - 'label' => lang('Prefix'), - ), - 'n_given' => array ( - 'id' => 'n_given', - 'label' => lang('First name') - ), - 'n_family' => array( - 'id' => 'n_family', - 'label' => lang('Last name') - ), - 'org_name' => array( - 'id' => 'org_name', - 'label' => lang('Organisation') - ) - ) + 'select_options' => $contactLabelOptions ), 'default' => ['n_given','n_family'] )