mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-23 11:21:42 +02:00
Use so_sql::search2criteria() to generate search criteria
This commit is contained in:
parent
3d8fca332b
commit
f1646e34df
@ -635,16 +635,34 @@ class addressbook_so
|
|||||||
{
|
{
|
||||||
$cols = $this->account_cols_to_search;
|
$cols = $this->account_cols_to_search;
|
||||||
}
|
}
|
||||||
// search the customfields only if some exist, but only for sql!
|
if($backend instanceof addressbook_sql)
|
||||||
if (get_class($backend) == 'addressbook_sql' && $this->customfields)
|
|
||||||
{
|
{
|
||||||
$cols[] = $this->extra_value;
|
foreach($cols as $key => &$col)
|
||||||
|
{
|
||||||
|
if(!array_key_exists($col, $backend->db_cols))
|
||||||
|
{
|
||||||
|
if(!($col = array_search($col, $backend->db_cols)))
|
||||||
|
{
|
||||||
|
// Can't search this column, it will error if we try
|
||||||
|
unset($cols[$key]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$criteria = so_sql::search2criteria($search, $wildcard, $op, null, $cols);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
foreach($cols as $col)
|
foreach($cols as $col)
|
||||||
{
|
{
|
||||||
$criteria[$col] = $search;
|
$criteria[$col] = $search;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// search the customfields only if some exist, but only for sql!
|
||||||
|
if (get_class($backend) == 'addressbook_sql' && $this->customfields)
|
||||||
|
{
|
||||||
|
$criteria[$this->extra_value] = $search;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (is_array($criteria) && count($criteria))
|
if (is_array($criteria) && count($criteria))
|
||||||
{
|
{
|
||||||
$criteria = $this->data2db($criteria);
|
$criteria = $this->data2db($criteria);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user