From 0203f16312bc949a5cf46ce90fa43de9119e23a8 Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 5 Mar 2012 19:56:17 +0000 Subject: - Fix duplicate names handling in addressbook searches (#1488375) --- program/steps/addressbook/func.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'program/steps/addressbook/func.inc') diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index f261527e4..84796baee 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -729,6 +729,24 @@ function rcmail_format_date_col($val) } +function rcmail_contact_key($row, $sort_col) +{ + $key = $row[$sort_col] . ':' . $row['sourceid']; + + // add email to a key to not skip contacts with the same name (#1488375) + if (!empty($row['email'])) { + if (is_array($row['email'])) { + $key .= ':' . implode(':', $row['email']); + } + else { + $key .= ':' . $row['email']; + } + } + + return $key; +} + + /** * Returns contact ID(s) and source(s) from GET/POST data * -- cgit v1.2.3