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.28 -r1.29 --- openacs-4/packages/ams/tcl/ams-procs.tcl 31 Oct 2005 07:43:00 -0000 1.28 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 31 Oct 2005 10:03:22 -0000 1.29 @@ -457,7 +457,9 @@ } if { [exists_and_not_null value] } { lappend values $heading $attribute_name $pretty_name [ams::widget -widget $widget -request "value_${format}" -attribute_name $attribute_name -attribute_id $attribute_id -value $value -locale $locale] + ns_log Notice "$attribute_name ($attribute_id):: $value" } + ns_log Notice "$attribute_name ($attribute_id):: $value" } return $values } else { Index: openacs-4/packages/ams/tcl/ams-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-widget-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/ams/tcl/ams-widget-procs.tcl 31 Oct 2005 07:43:00 -0000 1.12 +++ openacs-4/packages/ams/tcl/ams-widget-procs.tcl 31 Oct 2005 10:03:22 -0000 1.13 @@ -1267,11 +1267,46 @@ -text $value \ -text_format "text/plain"] ams::attribute::value_save -object_id $object_id -attribute_id $attribute_id -value_id $value_id - ns_log Notice "AMS TEXT:: $object_id - $attribute_id - $value_id" } } } +ad_proc -public ams::attribute::save::number { + -object_id:required + {-attribute_id ""} + {-attribute_name ""} + {-object_type ""} + {-format "text/plain"} + -number +} { + Save the value of an AMS text attribute for an object. + + @author Malte Sussdorff (sussdorff@sussdorff.de) + @creation-date 2005-07-22 + + @param object_id The object for which the value is stored + + @param attribute_id The attribute_id of the attribute for which the value is retrieved + + @param attribute_name Alternatively the attribute_name for the attribute + + @param number The number value to save + @return + + @error +} { + if {[exists_and_not_null value]} { + if {[empty_string_p $attribute_id]} { + set attribute_id [attribute::id \ + -object_type "$object_type" -attribute_name "$attribute_name"] + } + if {[exists_and_not_null attribute_id]} { + set value_id [ams::util::number_save -number $number] + ams::attribute::value_save -object_id $object_id -attribute_id $attribute_id -value_id $value_id + } + } +} + ad_proc -public ams::attribute::save::timestamp { -object_id:required {-attribute_id ""} @@ -1312,7 +1347,6 @@ if {[exists_and_not_null attribute_id]} { set value_id [ams::util::time_save -time "$month-$day-$year $hour:$minute"] ams::attribute::value_save -object_id $object_id -attribute_id $attribute_id -value_id $value_id - ns_log Notice "AMS TIMESTAMP:: $object_id - $attribute_id - $value_id" } } @@ -1367,10 +1401,47 @@ -additional_text $additional_text \ -postal_type $postal_type] ams::attribute::value_save -object_id $object_id -attribute_id $attribute_id -value_id $value_id - ns_log Notice "AMS POSTAL:: $object_id - $attribute_id - $value_id" } } + +ad_proc -public ams::attribute::save::simple_phone_number { + -object_id:required + {-attribute_id ""} + {-attribute_name ""} + {-object_type ""} + -phone_number:required +} { + Save the value of an AMS timestamp attribute for an object. + + @author Malte Sussdorff (sussdorff@sussdorff.de) + @creation-date 2005-07-22 + + @param object_id The object for which the value is stored + + @param attribute_id The attribute_id of the attribute for which the value is retrieved + + @param attribute_name Alternatively the attribute_name for the attribute + + @param phone_number The simple phone number without any extras + + @return + + @error +} { + + if {[empty_string_p $attribute_id]} { + set attribute_id [attribute::id \ + -object_type "$object_type" -attribute_name "$attribute_name"] + } + if {[exists_and_not_null attribute_id]} { + + set value_id [ams::util::telecom_number_save -subscriber_number $phone_number] + ams::attribute::value_save -object_id $object_id -attribute_id $attribute_id -value_id $value_id + } +} + + ad_proc -public ams::attribute::save::mc { -object_id:required {-attribute_id ""}