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.25 -r1.26 --- openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 14 Nov 2006 15:59:25 -0000 1.25 +++ openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 23 Jan 2007 14:43:50 -0000 1.26 @@ -190,6 +190,25 @@ + + + select alam.attribute_id, + alam.required_p, + alam.section_heading, + aa.attribute_name, + aa.pretty_name, + aa.widget, + alam.html_options + from ams_list_attribute_map alam, + ams_attributes aa + where alam.attribute_id = aa.attribute_id + and alam.list_id in ($list_ids) + $orderby_clause + + + + + select aav.*, aa.attribute_name, aa.widget, aa.pretty_name, 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.51 -r1.52 --- openacs-4/packages/ams/tcl/ams-procs.tcl 21 Dec 2006 18:09:25 -0000 1.51 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 23 Jan 2007 14:43:50 -0000 1.52 @@ -302,7 +302,30 @@ -attribute_id:required -array:required } { - Get the info on an ams_attribute + Get the info on an ams_attribute + + @param attribute_id ID of the attribute + @param array Name of the array to store the attribute in + + @return Array with the following variable: } { upvar 1 $array row db_1row select_attribute_info {} -column_array row @@ -531,6 +554,32 @@ } } +ad_proc -public ams::elements { + -list_ids:required + {-orderby_clause ""} +} { + This returns a list of lists with the attribute information + + @param list_ids Lists for which to get the elements + @param orderby_clause Clause for odering the lists. + + @return list of lists where each attribute is made of
    +
  1. attribute_id +
  2. required_p +
  3. section_heading +
  4. attribute_name +
  5. pretty_name +
  6. widget +
  7. html_options
+ +} { + if {$orderby_clause eq ""} { + set orderby_clause [ams::util::orderby_clause -list_ids $list_ids] + } + set list_ids [template::util::tcl_to_sql_list $list_ids] + return [db_list_of_lists select_elements " "] +} + ad_proc -public ams::values { -package_key:required -object_type:required