From: Randy J. H. B.Sc. <ra...@ro...> - 2012-03-26 22:49:43
|
in your index function $content['nm'] = array( 'no_cat' => False, // allows the cat selection in your index ...... if ((int)$query['cat_id']) { $query['col_filter'][] = $this->bo->so->_cat_filter($query['cat_id']); unset($query['cat_id']); } where _cat_filter($query['cat_id']); = function _cat_filter($cat_id,$cat_col_name='mat_cat_id') { if (!is_object($GLOBALS['egw']->categories)) { $GLOBALS['egw']->categories = CreateObject('phpgwapi.categories'); } foreach($GLOBALS['egw']->categories->return_all_children((int)$cat_id) as $cat) {//print_r($cat_id);die(); $cat_filter[] = $this->db->concat("','",$cat_col_name,"','")." LIKE '%,$cat,%'"; } return '('.implode(' OR ',$cat_filter).')'; } -- View this message in context: http://egroupware.219119.n3.nabble.com/How-to-filter-the-nextmatch-widget-by-category-tp3859095p3859722.html Sent from the egroupware-developers mailing list archive at Nabble.com. |