Index: openacs-4/packages/ams/tcl/ams-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-procs-postgresql.xql,v diff -u -r1.14 -r1.15 --- openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 28 Oct 2005 21:02:46 -0000 1.14 +++ openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 28 Oct 2005 22:13:38 -0000 1.15 @@ -166,6 +166,15 @@ + select + distinct + attribute_id, + section_heading, + attribute_name, + pretty_name, + widget, + value + from ( select alam.attribute_id, alam.section_heading, aa.attribute_name, @@ -179,8 +188,8 @@ from ams_attribute_values where ams_attribute_values.object_id = :object_id ) av on ( aa.attribute_id = av.attribute_id ) where alam.attribute_id = aa.attribute_id - and alam.list_id = :list_id - order by alam.sort_order + and alam.list_id in ($list_ids) + order by alam.sort_order) attribute Index: openacs-4/packages/ams/tcl/ams-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-procs.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/ams/tcl/ams-procs.tcl 28 Oct 2005 21:02:46 -0000 1.26 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 28 Oct 2005 22:13:37 -0000 1.27 @@ -345,7 +345,7 @@ } { set list_ids [list] if { [empty_string_p $list_names] && [empty_string_p $list_name] } { - ad_return_complaint 1 "[_ ams.you_must_provide_list_name]" You must provide either list_name or list_names" + ad_return_complaint 1 "[_ ams.you_must_provide_list_name]" ad_script_abort } @@ -392,7 +392,8 @@ ad_proc -public ams::values { -package_key:required -object_type:required - -list_name:required + {-list_name ""} + {-list_names ""} -object_id:required {-format "text"} {-locale ""} @@ -404,6 +405,7 @@ -package_key $package_key \ -object_type $object_type \ -list_name $list_name \ + -list_names $list_names \ -object_id $object_id \ -format $format \ -locale $locale]] @@ -413,7 +415,8 @@ ad_proc -public ams::values_not_cached { -package_key:required -object_type:required - -list_name:required + {-list_name ""} + {-list_names ""} -object_id:required {-format "text"} {-locale ""} @@ -423,11 +426,26 @@ if { $format != "html" } { set format "text" } - set list_id [ams::list::get_list_id -package_key $package_key -object_type $object_type -list_name $list_name] - if { [exists_and_not_null list_id] } { + if { [empty_string_p $list_names] && [empty_string_p $list_name] } { + ad_return_complaint 1 "[_ ams.you_must_provide_list_name]" + ad_script_abort + } + + if { [empty_string_p $list_names] && ![empty_string_p $list_name] } { + set list_names $list_name + } + + foreach l_name $list_names { + lappend list_ids [ams::list::get_list_id -package_key $package_key -object_type $object_type -list_name $l_name] + } + + # To use in the query + set list_ids [template::util::tcl_to_sql_list $list_ids] + + if { [exists_and_not_null list_ids] } { set values [list] set heading "" - db_foreach select_values {} { + db_foreach select_values " " { if { [exists_and_not_null section_heading] } { set heading $section_heading }