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.9 -r1.10 --- openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 27 May 2005 09:46:49 -0000 1.9 +++ openacs-4/packages/ams/tcl/ams-procs-postgresql.xql 31 May 2005 16:10:13 -0000 1.10 @@ -1,6 +1,22 @@ + + + select pretty_name + from ams_attributes + where attribute_id = :attribute_id + + + + + + select pretty_pluralo + from ams_attributes + where attribute_id = :attribute_id + + + select acs_attribute__create_attribute ( @@ -30,6 +46,49 @@ + + + select supertype + from acs_object_types + where object_type = :object_type + + + + + + insert into ams_attribute_values + (object_id,attribute_id,value_id) + ( select :to, + attribute_id, + value_id + from ams_attribute_values + where object_id = :from ) + + + + + + delete from ams_attribute_values + where object_id = :object_id + + + + + + select * + from ams_attributes + where attribute_id = :attribute_id + + + + + + select ams_attribute_id + from ams_attributes + where attribute_id = :attribute_id + + + select ams_attribute_value__save ( @@ -40,8 +99,16 @@ - + + select option + from ams_option_types + where option_id = :option_id + + + + + select alam.attribute_id, alam.required_p, alam.section_heading, @@ -56,7 +123,7 @@ - + select alam.attribute_id, alam.required_p, 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.10 -r1.11 --- openacs-4/packages/ams/tcl/ams-procs.tcl 27 May 2005 09:46:49 -0000 1.10 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 31 May 2005 16:10:13 -0000 1.11 @@ -20,15 +20,15 @@ } { get the pretty_name of an attribute } { - return [db_string get_pretty_name { select pretty_name from ams_attributes where attribute_id = :attribute_id } -default {}] + return [db_string get_pretty_name {} -default {}] } ad_proc -public attribute::pretty_plural { {-attribute_id:required} } { get the pretty_plural of an attribute } { - return [db_string get_pretty_name { select pretty_plural from ams_attributes where attribute_id = :attribute_id } -default {}] + return [db_string get_pretty_plural {} -default {}] } ad_proc -public attribute::new { @@ -96,7 +96,7 @@ set object_types [list $object_type] } while { $object_type != "acs_object" } { - set object_type [db_string get_next_object_type { select supertype from acs_object_types where object_type = :object_type }] + set object_type [db_string get_supertype {}] if { $object_type != "acs_object" } { lappend object_types $object_type } @@ -117,15 +117,7 @@ } { } { db_transaction { - db_dml copy_object { - insert into ams_attribute_values - (object_id,attribute_id,value_id) - ( select :to, - attribute_id, - value_id - from ams_attribute_values - where object_id = :object_id ) - } + db_dml copy_object {} } } @@ -134,7 +126,7 @@ } { delete and object that uses ams attributes } { - return [db_dml delete_object { delete from ams_attribute_values where object_id = :object_id }] + return [db_dml delete_object {}] } @@ -145,7 +137,7 @@ Get the info on an ams_attribute } { upvar 1 $array row - db_1row select_attribute_info { select * from ams_attributes where attribute_id = :attribute_id } -column_array row + db_1row select_attribute_info {} -column_array row } ad_proc -public ams::attribute::new { @@ -160,7 +152,7 @@ @see attribute::new } { - set existing_ams_attribute_id [db_string get_it { select ams_attribute_id from ams_attributes where attribute_id = :attribute_id } -default {}] + set existing_ams_attribute_id [db_string get_existing_ams_attribute_id {} -default {}] if { [exists_and_not_null existing_ams_attribute_id] } { return $existing_ams_attribute_id @@ -219,7 +211,7 @@ @param option_id } { - return [db_string get_it { select option from ams_option_types where option_id = :option_id } -default {}] + return [db_string get_option {} -default {}] }