summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/func.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-03-05 19:56:17 +0000
committeralecpl <alec@alec.pl>2012-03-05 19:56:17 +0000
commit0203f16312bc949a5cf46ce90fa43de9119e23a8 (patch)
tree5865daa13dac86d01cf4ff74cdf88cb8d56b08e7 /program/steps/addressbook/func.inc
parent377bc60482628954bcd7bcaca7682ecd9594089c (diff)
- Fix duplicate names handling in addressbook searches (#1488375)
Diffstat (limited to 'program/steps/addressbook/func.inc')
-rw-r--r--program/steps/addressbook/func.inc18
1 files changed, 18 insertions, 0 deletions
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
*