summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-01-25 14:15:12 +0100
committerThomas Bruederli <thomas@roundcube.net>2013-01-25 14:36:03 +0100
commitc4a1d3fe5ddfba37d94680c86614e8fc447955a0 (patch)
tree26b31fa43d32d3ca386969d90616fe2cf5f4daa6 /program/lib
parent7f693b65655eb905043d39bb53590b6c92b1f99c (diff)
Move rcmail_contact_key() to rcube_addressbook::compose_contact_key()
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/Roundcube/rcube_addressbook.php16
1 files changed, 16 insertions, 0 deletions
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
@@ -524,6 +524,22 @@ abstract class rcube_addressbook
}
/**
+ * 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
*
* @param string $colname Data name