From: Jan Schneider Date: Mon, 5 Jul 2010 10:20:20 +0000 (+0200) Subject: Have a fixed name format, only with the name parts we actually use for X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=972c9cde16a2aed699ecaf71fa2da946fe49f475;p=horde.git Have a fixed name format, only with the name parts we actually use for duplicate matching. --- diff --git a/turba/lib/Driver/Sql.php b/turba/lib/Driver/Sql.php index cefaac820..94e5c5107 100644 --- a/turba/lib/Driver/Sql.php +++ b/turba/lib/Driver/Sql.php @@ -278,6 +278,10 @@ class Turba_Driver_Sql extends Turba_Driver if (isset($this->map['email'])) { $fields[] = $this->map['email']; } + $nameFormat = $GLOBALS['prefs']->getValue('name_format');; + if ($nameFormat != 'first_last' && $nameFormat != 'last_first') { + $nameFormat = 'first_last'; + } $order = $this->_buildFields($fields); $joins = $this->_buildJoin($fields); @@ -316,6 +320,9 @@ class Turba_Driver_Sql extends Turba_Driver foreach ($ids as $id) { $contact = $this->getObject($id); $value = $contact->getValue($field); + if ($field == 'name') { + $value = Turba::formatName($contact, $nameFormat); + } /* HACK! */ if ($field == 'email') { $value = Horde_String::lower($value);