From 13dc9f2c862668554d87dcbf95f2f7bbaf221bf3 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 25 Jan 2013 14:15:12 +0100 Subject: Move rcmail_contact_key() to rcube_addressbook::compose_contact_key() --- program/lib/Roundcube/rcube_addressbook.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'program/lib/Roundcube/rcube_addressbook.php') diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php index 421062772..cbc3c6773 100644 --- a/program/lib/Roundcube/rcube_addressbook.php +++ b/program/lib/Roundcube/rcube_addressbook.php @@ -523,6 +523,22 @@ abstract class rcube_addressbook return $fn; } + /** + * Create a unique key for sorting contacts + */ + public static function compose_contact_key($contact, $sort_col) + { + $key = $contact[$sort_col] . ':' . $row['sourceid']; + + // add email to a key to not skip contacts with the same name (#1488375) + if (!empty($contact['email'])) { + $key .= ':' . implode(':', (array)$contact['email']); + } + + return $key; + } + + /** * Compare search value with contact data * -- cgit v1.2.3