Remove "prefered email address" from addressbook preferences. Additionally, add an exclusive user preference for business and private mail action checkboxes

This commit is contained in:
Hadi Nategh 2014-01-15 11:22:37 +00:00
parent 99589acae2
commit a1d3c7f161
3 changed files with 20 additions and 15 deletions

View File

@ -126,19 +126,6 @@ class addressbook_hooks
'default'=> 3, 'default'=> 3,
); );
} }
$settings['distributionListPreferredMail'] = array(
'type' => 'select',
'label' => 'Preferred email address to use in distribution lists',
'name' => 'distributionListPreferredMail',
'values' => array(
'email' => lang("Work email if given, else home email"),
'email_home' => lang("Home email if given, else work email"),
),
'help' => 'Defines which email address (business or home) to use as the preferred one for distribution lists in mail.',
'xmlrpc' => True,
'admin' => False,
'forced'=> 'email',
);
if ($GLOBALS['egw_info']['server']['contact_repository'] != 'ldap') if ($GLOBALS['egw_info']['server']['contact_repository'] != 'ldap')
{ {
$settings['private_addressbook'] = array( $settings['private_addressbook'] = array(

View File

@ -580,18 +580,22 @@ class addressbook_ui extends addressbook_bo
'no_lang' => true, 'no_lang' => true,
'checkbox' => true, 'checkbox' => true,
'group' => $group, 'group' => $group,
'onExecute' => 'javaScript:app.addressbook.mailCheckMenu', 'onExecute' => 'javaScript:app.addressbook.mailCheckbox',
'checked' => $this->prefs['preferredMail']['business'],
), ),
'email_home' => array( 'email_home' => array(
'caption' => lang('Add %1',lang('home email')), 'caption' => lang('Add %1',lang('home email')),
'no_lang' => true, 'no_lang' => true,
'checkbox' => true, 'checkbox' => true,
'group' => $group, 'group' => $group,
'onExecute' => 'javaScript:app.addressbook.mailCheckMenu', 'onExecute' => 'javaScript:app.addressbook.mailCheckbox',
'checked' => $this->prefs['preferredMail']['private'],
), ),
), ),
); );
if (!$this->prefs['preferredMail'])
$actions['email']['children']['email_business']['checked'] = true;
if ($GLOBALS['egw_info']['user']['apps']['filemanager']) if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
{ {

View File

@ -416,6 +416,20 @@ app.classes.addressbook = AppJS.extend(
return false; return false;
}, },
/**
* Action function to set business or private mail checkboxes to user preferences
*
* @param {egwAction} action Action user selected.
*/
mailCheckbox: function(action)
{
var preferences = {
business:(action.getManager().getActionById('email_business').checked?true:false),
private:(action.getManager().getActionById('email_home').checked?true:false),
}
this.egw.set_preference('addressbook','preferredMail', preferences)
},
/** /**
* Action function to add the email address (business or home) of the selected * Action function to add the email address (business or home) of the selected
* contacts to a compose email popup window. * contacts to a compose email popup window.