fix for different format of multiple cats ('1,2' instead of old ',1,2,') in new addressbook

This commit is contained in:
Ralf Becker 2005-11-18 15:22:10 +00:00
parent 05a3768cbd
commit c3a9b1c5e8

View File

@ -305,13 +305,11 @@
$GLOBALS['egw']->categories = CreateObject('phpgwapi.categories'); $GLOBALS['egw']->categories = CreateObject('phpgwapi.categories');
} }
$cats = $GLOBALS['egw']->categories->return_all_children((int)$value); $cats = $GLOBALS['egw']->categories->return_all_children((int)$value);
$cat_filter = "(cat_id IN ('".implode("','",$cats)."')";
foreach($cats as $cat) foreach($cats as $cat)
{ {
$cat_filter .= " OR cat_id LIKE '%,$cat,%'"; $cat_filter[] = $this->db->concat("','",cat_id,"','")." LIKE '%,$cat,%'";
} }
$cat_filter .= ')'; $filterlist[] = '('.implode(' OR ',$cat_filter).')';
$filterlist[] = $cat_filter;
} }
elseif(@is_int($value)) elseif(@is_int($value))
{ {