mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
"Patch for negate the seaching in custom fields, starting with \"!\" "
This commit is contained in:
parent
4dfa864be1
commit
40c143c843
@ -287,17 +287,14 @@ class addressbook_sql extends so_sql
|
|||||||
} else {
|
} else {
|
||||||
$valarray[]=$val;
|
$valarray[]=$val;
|
||||||
}
|
}
|
||||||
|
$negate = false; //negate the search funktion
|
||||||
|
if ($criteria[$col][0] == '!') $negate = True;
|
||||||
unset($criteria[$col]);
|
unset($criteria[$col]);
|
||||||
foreach ($valarray as $vkey => $part)
|
foreach ($valarray as $vkey => $part)
|
||||||
{
|
{
|
||||||
if ($op=='AND') {
|
$criteria[] =$this->table_name.'.contact_id'.($negate ? ' not ' :'').' in (select '.$this->extra_table.'.contact_id from '.$this->extra_table.' where '.
|
||||||
$criteria[] =$this->extra_table.'.contact_id in (select '.$this->extra_table.'.contact_id from '.$this->extra_table.' where '.
|
"(".$this->extra_table.".contact_name='".substr($col,1)."' AND ".$this->extra_table.".contact_value".(!$wildcard?' = ':' LIKE ')."'".$wildcard.($negate?substr($part,1):$part).$wildcard."'"."))";
|
||||||
"(".$this->extra_table.".contact_name='".substr($col,1)."' AND ".$this->extra_table.".contact_value".($wildcard?' LIKE ':'=')."'".$wildcard.$part.$wildcard."'))";
|
|
||||||
} else {
|
|
||||||
$criteria[] = $this->db->expression($this->extra_table,'(',array(
|
|
||||||
$this->extra_table.'.contact_name='."'".substr($col,1)."'",
|
|
||||||
$this->extra_table.'.contact_value'.($wildcard?' LIKE ':'=')."'".$wildcard.$part.$wildcard."'"),')');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$search_customfields = true;
|
$search_customfields = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user