Index: openacs-4/packages/contacts/tcl/attribute-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/attribute-procs-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/contacts/tcl/attribute-procs-postgresql.xql 18 May 2005 16:45:49 -0000 1.4 +++ openacs-4/packages/contacts/tcl/attribute-procs-postgresql.xql 29 Aug 2005 22:49:50 -0000 1.5 @@ -117,5 +117,19 @@ + + + select + distinct + a.pretty_name, + ot.attribute_id + from + ams_option_types ot, + ams_attributes a + where + ot.attribute_id = a.attribute_id + order by a.pretty_name asc + + Index: openacs-4/packages/contacts/tcl/attribute-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/attribute-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/contacts/tcl/attribute-procs.tcl 4 Jun 2005 12:36:45 -0000 1.4 +++ openacs-4/packages/contacts/tcl/attribute-procs.tcl 29 Aug 2005 22:49:50 -0000 1.5 @@ -57,9 +57,14 @@ } + ad_proc -public options_attribute { + } { + Returns a list of only the attributes that have + multiple choices of the format {pretty_name attribute_id} + } { + return [db_list_of_lists get_option_attributes { }] + } - - } Index: openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl 26 Aug 2005 14:38:04 -0000 1.7 +++ openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl 29 Aug 2005 22:49:50 -0000 1.8 @@ -88,8 +88,11 @@ {-object_type ""} {-prefix ""} {-without_arrow_p "f"} + {-only_multiple_p "f"} } { Return all widget procs. Each list element is a list of the first then pretty_name then the widget + @param without_arrow_p Show the elementes in the select menu without the "->" + @param only_multiple_p Only show those elements that have multiple choices } { switch $request { ad_form_widgets { @@ -216,13 +219,16 @@ set form_elements [list] - - set attribute_options [db_list_of_lists get_attributes { - select pretty_name, attribute_id - from ams_attributes - where object_type in ('organization','party','person','user') - and ams_attribute_id is not null - }] + if { !$only_multiple_p } { + set attribute_options [db_list_of_lists get_attributes { + select pretty_name, attribute_id + from ams_attributes + where object_type in ('organization','party','person','user') + and ams_attribute_id is not null + }] + } else { + set attribute_options [contacts::attribute::options_attribute] + } set sorted_options [ams::util::localize_and_sort_list_of_lists -list $attribute_options] set attribute_options [list [list "- - - -" ""]] foreach op $sorted_options {