diff options
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/addressbook/list.inc | 3 | ||||
-rw-r--r-- | program/steps/settings/func.inc | 14 | ||||
-rw-r--r-- | program/steps/settings/save_prefs.inc | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/program/steps/addressbook/list.inc b/program/steps/addressbook/list.inc index b4b7306a6..71196b4bb 100644 --- a/program/steps/addressbook/list.inc +++ b/program/steps/addressbook/list.inc @@ -31,6 +31,7 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search $page = isset($_SESSION['page']) ? $_SESSION['page'] : 1; $_SESSION['page'] = $page; + $sort_col = $this->config->get('addressbook_sort_col', 'name'); // Get records from all sources foreach ($search as $s => $set) { @@ -46,7 +47,7 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search while ($row = $result->next()) { $row['sourceid'] = $s; - $key = $row['name'] . ':' . $row['sourceid']; + $key = $row[$sort_col] . ':' . $row['sourceid']; $records[$key] = $row; } unset($result); diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index fdb65ade9..a529b3b12 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -660,6 +660,20 @@ function rcmail_user_prefs($current=null) ); } + // show addressbook sort column + if (!isset($no_override['addressbook_sort_col'])) { + $field_id = 'rcmfd_addressbook_sort_col'; + $select_sort = new html_select(array('name' => '_addressbook_sort_col', 'id' => $field_id)); + $select_sort->add(rcube_label('name'), 'name'); + $select_sort->add(rcube_label('firstname'), 'firstname'); + $select_sort->add(rcube_label('surname'), 'surname'); + + $blocks['main']['options']['sort_col'] = array( + 'title' => html::label($field_id, Q(rcube_label('listsorting'))), + 'content' => $select_sort->show($config['addressbook_sort_col']), + ); + } + if (!isset($no_override['autocomplete_single'])) { $field_id = 'rcmfd_autocomplete_single'; $checkbox = new html_checkbox(array('name' => '_autocomplete_single', 'id' => $field_id, 'value' => 1)); diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index f5f3e36d3..0808c72bb 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -93,6 +93,7 @@ switch ($CURR_SECTION) case 'addressbook': $a_user_prefs = array( 'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true), + 'addressbook_sort_col' => get_input_value('_addressbook_sort_col', RCUBE_INPUT_POST), 'autocomplete_single' => isset($_POST['_autocomplete_single']) ? TRUE : FALSE, ); |