mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 16:33:17 +01:00
backport of Nathans r48906: handle multiple comma-separated category IDs
This commit is contained in:
parent
1fcc8cb801
commit
c779625947
@ -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