Index: openacs-4/packages/contacts/tcl/contact-extend-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-extend-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/tcl/contact-extend-procs.tcl 8 Sep 2005 18:05:19 -0000 1.1 +++ openacs-4/packages/contacts/tcl/contact-extend-procs.tcl 9 Sep 2005 22:18:49 -0000 1.2 @@ -54,17 +54,20 @@ ad_proc -public contact::extend::get_options { {-ignore_extends ""} + -search_id:required } { Returns a list of the form { pretty_name extend_id } of all available extend options in - contact_extend_options + contact_extend_options, if search_id is passed then ignore the extends in + contact_search_extend_map @param ignore_extends A list of extend_id's to ignore on the result } { - set extra_query "" + set extra_query "where extend_id not in (select extend_id from contact_search_extend_map where search_id = $search_id)" if { ![empty_string_p $ignore_extends] } { set ignore_extends [join $ignore_extends ","] - append extra_query "where extend_id not in ($ignore_extends)" + append extra_query "and extend_id not in ($ignore_extends)" } + return [db_list_of_lists get_options " "] }