mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
Handle multiple comma-separated category IDs
This commit is contained in:
parent
06369b922a
commit
8d3025ffc6
@ -444,13 +444,13 @@ class addressbook_sql extends so_sql_cf
|
||||
* fix cat_id criteria to search in comma-separated multiple cats
|
||||
*
|
||||
* @internal
|
||||
* @param int/array $cats
|
||||
* @param int|array|string $cats
|
||||
* @return array of sql-strings to be OR'ed or AND'ed together
|
||||
*/
|
||||
function _cat_search($cats)
|
||||
{
|
||||
$cat_filter = array();
|
||||
foreach(is_array($cats) ? $cats : array($cats) as $cat)
|
||||
foreach(is_array($cats) ? $cats : (is_numeric($cats) ? array($cats) : explode(',',$cats)) as $cat)
|
||||
{
|
||||
if (is_numeric($cat)) $cat_filter[] = $this->db->concat("','",cat_id,"','")." LIKE '%,$cat,%'";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user