From 0203f16312bc949a5cf46ce90fa43de9119e23a8 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 05 Mar 2012 14:56:17 -0500
Subject: [PATCH] - Fix duplicate names handling in addressbook searches (#1488375)

---
 program/steps/addressbook/export.inc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/program/steps/addressbook/export.inc b/program/steps/addressbook/export.inc
index 0fe193b..c0dbd8b 100644
--- a/program/steps/addressbook/export.inc
+++ b/program/steps/addressbook/export.inc
@@ -27,6 +27,7 @@
 // Use search result
 if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']]))
 {
+    $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name');
     $search  = (array)$_SESSION['search'][$_REQUEST['_search']];
     $records = array();
 
@@ -44,7 +45,7 @@
 
         while ($row = $result->next()) {
             $row['sourceid'] = $s;
-            $key = $row['name'] . ':' . $row['sourceid'];
+            $key = rcmail_contact_key($row, $sort_col);
             $records[$key] = $row;
         }
         unset($result);

--
Gitblit v1.9.1