diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-11-18 19:27:52 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-11-18 19:27:52 +0100 |
commit | 6459d86291d39879316694373e13d9e5e3129f5e (patch) | |
tree | 24e56863456f6f1136c228a8f3bc0eb34e7a4979 /program/steps | |
parent | 6fa61759e2369f4702ecebe584c133f9d79e0d93 (diff) |
Select default_addressbook on the list in Address Book (#1488280)
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/addressbook/func.inc | 18 | ||||
-rw-r--r-- | program/steps/settings/func.inc | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index cefe49e01..e42e26e1e 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -63,12 +63,6 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) { // add list of address sources to client env $js_list = $RCMAIL->get_address_sources(); - $source = get_input_value('_source', RCUBE_INPUT_GPC); - - // use first directory by default - if (!strlen($source) || !isset($js_list[$source])) - $source = $js_list[key($js_list)]['id']; - // count all/writeable sources $writeable = 0; $count = 0; @@ -93,8 +87,16 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) { $_SESSION['addressbooks_count'] = $count; $_SESSION['addressbooks_count_writeable'] = $writeable; - if (!strlen($source)) - $source = strval(key($js_list)); + // select address book + $source = get_input_value('_source', RCUBE_INPUT_GPC); + + // use first directory by default + if (!strlen($source) || !isset($js_list[$source])) { + $source = $RCMAIL->config->get('default_addressbook'); + if (!strlen($source) || !isset($js_list[$source])) { + $source = strval(key($js_list)); + } + } $CONTACTS = rcmail_contact_source($source, true); } diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 876e02761..2c19d88df 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -705,7 +705,7 @@ function rcmail_user_prefs($current=null) } $blocks['main']['options']['default_addressbook'] = array( - 'title' => html::label($field_id, Q(rcube_label('defaultaddressbook'))), + 'title' => html::label($field_id, Q(rcube_label('defaultabook'))), 'content' => $select_abook->show($config['default_addressbook']), ); } |