Fix contact fulltext indexing with new email subtypes
This commit is contained in:
parent
f994552796
commit
054807c784
1 changed files with 13 additions and 2 deletions
|
@ -31,7 +31,7 @@ class kolab_format_contact extends kolab_format
|
||||||
protected $read_func = 'readContact';
|
protected $read_func = 'readContact';
|
||||||
protected $write_func = 'writeContact';
|
protected $write_func = 'writeContact';
|
||||||
|
|
||||||
public static $fulltext_cols = array('name', 'firstname', 'surname', 'middlename', 'email');
|
public static $fulltext_cols = array('name', 'firstname', 'surname', 'middlename', 'email:address');
|
||||||
|
|
||||||
public $phonetypes = array(
|
public $phonetypes = array(
|
||||||
'home' => Telephone::Home,
|
'home' => Telephone::Home,
|
||||||
|
@ -385,7 +385,18 @@ class kolab_format_contact extends kolab_format
|
||||||
{
|
{
|
||||||
$data = '';
|
$data = '';
|
||||||
foreach (self::$fulltext_cols as $col) {
|
foreach (self::$fulltext_cols as $col) {
|
||||||
$val = is_array($this->data[$col]) ? join(' ', $this->data[$col]) : $this->data[$col];
|
list($col, $field) = explode(':', $colname);
|
||||||
|
|
||||||
|
if ($field) {
|
||||||
|
$a = array();
|
||||||
|
foreach ((array)$this->data[$col] as $attr)
|
||||||
|
$a[] = $attr[$field];
|
||||||
|
$val = join(' ', $a);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$val = is_array($this->data[$col]) ? join(' ', $this->data[$col]) : $this->data[$col];
|
||||||
|
}
|
||||||
|
|
||||||
if (strlen($val))
|
if (strlen($val))
|
||||||
$data .= $val . ' ';
|
$data .= $val . ' ';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue