Index: openacs-4/packages/acs-object-management/sql/postgresql/acs-kernel-changes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/sql/postgresql/Attic/acs-kernel-changes-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-object-management/sql/postgresql/acs-kernel-changes-create.sql 13 Dec 2009 21:12:10 -0000 1.5 +++ openacs-4/packages/acs-object-management/sql/postgresql/acs-kernel-changes-create.sql 10 Nov 2010 18:27:20 -0000 1.6 @@ -33,6 +33,10 @@ -- Types probably should have a flag saying whether or not it can be deleted, and -- perhaps attributes, too. Too much change for now. +-- DAVEB since you can just extend it and create a view on that, that should +-- be plenty of customization. You can just ignore the attributes you aren't +-- interested in + --update acs_object_types --set dynamic_p = 't' --where object_type = 'person'; Index: openacs-4/packages/acs-object-management/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/tcl/form-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-object-management/tcl/form-procs.tcl 2 Jan 2010 14:04:00 -0000 1.3 +++ openacs-4/packages/acs-object-management/tcl/form-procs.tcl 10 Nov 2010 18:27:20 -0000 1.4 @@ -47,7 +47,7 @@ if { [llength [info procs ::template::data::to_sql::${attr(datatype)}]] } { set value [template::data::to_sql::${attr(datatype)} $value] } else { - set value "'$value'" + set value "$value" } set local($attr(view_attribute)) $value } Index: openacs-4/packages/acs-object-management/tcl/object-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/tcl/object-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-object-management/tcl/object-procs.tcl 11 Dec 2009 00:19:09 -0000 1.6 +++ openacs-4/packages/acs-object-management/tcl/object-procs.tcl 10 Nov 2010 18:27:20 -0000 1.7 @@ -117,10 +117,15 @@ foreach name [array names our_attributes] { lappend name_list $name set __$name $our_attributes($name) - lappend value_list [set __$name] + if {![string match "to_timestamp(*" [set __$name]]} { + lappend value_list ":__${name}" + } else { + lappend value_list "[set __${name}]" + } } + set SQL [db_map insert_object] - db_dml insert_object {} + db_dml insert_object_q $SQL } else { # error for now as we don't handle generics etc @@ -176,7 +181,7 @@ set attributes_array(object_type) $object_type - object::quote_attribute_values -array attributes_array +# object::quote_attribute_values -array attributes_array db_transaction { set object_id [object::new_inner \ @@ -211,16 +216,17 @@ -object_view $object_view \ -element object_type] - set attributes(creation_user) "'[ad_conn user_id]'" - set attributes(creation_ip) "'[ad_conn peeraddr]'" - set attributes(object_type) "'$object_type'" - + set attributes(creation_user) "[ad_conn user_id]" + set attributes(creation_ip) "[ad_conn peeraddr]" + set attributes(object_type) "$object_type" +# object::quote_attribute_values -array attributes db_transaction { object::new_inner \ -object_type $object_type \ -object_id $object_id \ -attributes [array get attributes] } + return $object_id } ad_proc object::delete { @@ -324,11 +330,17 @@ foreach name [array names our_attributes] { set __$name $our_attributes($name) - lappend name_value_list "$name = [set __$name]" + if {![string match "to_timestamp(*" [set __$name]]} { + lappend name_value_list "$name = :__${name}" + } else { + lappend name_value_list "$name = [set __${name}]" + } + } if { [info exists name_value_list] } { - db_dml update_object {} + set SQL [db_map update_object] + db_dml update_object_q $SQL } } else { @@ -364,7 +376,7 @@ } } - object::quote_attribute_values -array attributes_array +# object::quote_attribute_values -array attributes_array set object_type [object::get_object_type -object_id $object_id] @@ -401,8 +413,8 @@ -object_view $object_view \ -element object_type] - set attributes(modifying_user) "'[ad_conn user_id]'" - set attributes(modifying_ip) "'[ad_conn peeraddr]'" + set attributes(modifying_user) "[ad_conn user_id]" + set attributes(modifying_ip) "[ad_conn peeraddr]" db_transaction { object::update_inner \ Index: openacs-4/packages/acs-object-management/tcl/templating-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/tcl/Attic/templating-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-object-management/tcl/templating-procs.tcl 13 Dec 2009 21:14:26 -0000 1.3 +++ openacs-4/packages/acs-object-management/tcl/templating-procs.tcl 10 Nov 2010 18:27:20 -0000 1.4 @@ -119,10 +119,14 @@ namespace eval template::util::richtext {} ad_proc template::data::to_sql::richtext { value } { - return "'[DoubleApos [list [template::util::richtext::get_property content $value] \ - [template::util::richtext::get_property format $value]]]'" + return "[list [template::util::richtext::get_property content $value] \ + [template::util::richtext::get_property format $value]]" } +ad_proc template::data::from_sql::richtext { value } { + set value +} + ad_proc -public template::data::validate::number { value_ref message_ref