Index: openacs-4/packages/categories/tcl/categories-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/categories-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/categories/tcl/categories-procs.tcl 19 Apr 2004 16:24:22 -0000 1.17 +++ openacs-4/packages/categories/tcl/categories-procs.tcl 27 Jan 2005 21:37:42 -0000 1.18 @@ -195,14 +195,22 @@ } } -ad_proc -public category::get_mapped_categories { object_id } { - Gets the list of categories mapped to an object. +ad_proc -public category::get_mapped_categories { + {-tree_id {}} + object_id +} { + Gets the list of categories mapped to an object. If tree_id is provided + return only the categories mapped from the given tree. @param object_id object of which we want to know the mapped categories. @return tcl-list of category_ids @author Timo Hentschel (timo@timohentschel.de) } { - set result [db_list get_mapped_categories ""] + if { ![empty_string_p $tree_id] } { + set result [db_list get_filtered ""] + } else { + set result [db_list get_mapped_categories ""] + } return $result } Index: openacs-4/packages/categories/tcl/categories-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/Attic/categories-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/categories/tcl/categories-procs.xql 18 Feb 2004 18:40:08 -0000 1.4 +++ openacs-4/packages/categories/tcl/categories-procs.xql 27 Jan 2005 21:37:42 -0000 1.5 @@ -60,7 +60,16 @@ - + + + SELECT category_object_map.category_id + FROM category_object_map, categories + WHERE object_id = :object_id + AND tree_id = :tree_id + AND category_object_map.category_id = categories.category_id + + +