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:
+ - attribute_id
+
- object_type
+
- table_name
+
- attribute_name
+
- pretty_name
+
- pretty_plural
+
- sort_order
+
- datatype
+
- default_value
+
- min_n_values
+
- max_n_values
+
- storage
+
- static_p
+
- column_name
+
- ams_attribute_id
+
- widget
+
- dynamic_p
+
- deprecated_p
} {
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
+ - attribute_id
+
- required_p
+
- section_heading
+
- attribute_name
+
- pretty_name
+
- widget
+
- 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