From c3a9b1c5e8033680fa03de36c282a56e4aed3722 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 18 Nov 2005 15:22:10 +0000 Subject: [PATCH] fix for different format of multiple cats ('1,2' instead of old ',1,2,') in new addressbook --- phpgwapi/inc/class.contacts_sql.inc.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.contacts_sql.inc.php b/phpgwapi/inc/class.contacts_sql.inc.php index 2c3e711fd5..83fe272435 100644 --- a/phpgwapi/inc/class.contacts_sql.inc.php +++ b/phpgwapi/inc/class.contacts_sql.inc.php @@ -305,13 +305,11 @@ $GLOBALS['egw']->categories = CreateObject('phpgwapi.categories'); } $cats = $GLOBALS['egw']->categories->return_all_children((int)$value); - $cat_filter = "(cat_id IN ('".implode("','",$cats)."')"; foreach($cats as $cat) { - $cat_filter .= " OR cat_id LIKE '%,$cat,%'"; + $cat_filter[] = $this->db->concat("','",cat_id,"','")." LIKE '%,$cat,%'"; } - $cat_filter .= ')'; - $filterlist[] = $cat_filter; + $filterlist[] = '('.implode(' OR ',$cat_filter).')'; } elseif(@is_int($value)) {