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 -N -r1.27 -r1.28 --- openacs-4/packages/ams/tcl/ams-procs.tcl 28 Oct 2005 22:13:37 -0000 1.27 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 31 Oct 2005 07:43:00 -0000 1.28 @@ -354,7 +354,10 @@ } foreach l_name $list_names { - lappend list_ids [ams::list::get_list_id -package_key $package_key -object_type $object_type -list_name $l_name] + set list_id [ams::list::get_list_id -package_key $package_key -object_type $object_type -list_name $l_name] + if {![empty_string_p $list_id]} { + lappend list_ids $list_id + } } # To use in the query @@ -436,7 +439,10 @@ } foreach l_name $list_names { - lappend list_ids [ams::list::get_list_id -package_key $package_key -object_type $object_type -list_name $l_name] + set list_id [ams::list::get_list_id -package_key $package_key -object_type $object_type -list_name $l_name] + if {![empty_string_p $list_id]} { + lappend list_ids $list_id + } } # To use in the query @@ -520,108 +526,3 @@ } } -ad_proc -public ams::attribute::save_text { - -object_id:required - {-attribute_id ""} - {-attribute_name ""} - {-object_type ""} - {-format "text/plain"} - -value -} { - 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 - - @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::text_save \ - -text $value \ - -text_format "text/plain"] - 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 ""} - {-attribute_name ""} - {-object_type ""} - -value - {-format "text/plain"} -} { - Save the value of an AMS multiple choice attribute like "select", - "radio" 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 - - @return - - @error -} { - if {[exists_and_not_null value]} { - # map values if corresponding mapping-function - # exists - - set proc "map_$attribute" - - if {[llength [info procs $proc]] == 1} { - if {[exists_and_not_null value]} { - if {[catch {set value [eval $proc {$value}]} err]} { - append error_string "Contact \#$contact_count ($first_names $last_name): $err
" - } - } - } - } - - 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"] - } - - switch $value { - "TRUE" {set value "t" } - "FALSE" {set value "f" } - default {set value "#acs-translations.organization_[set attribute]_$value#"} - } - set option_id [db_string get_option {select option_id from ams_option_types where attribute_id = :attribute_id and option = :value} \ - -default {}] - - # Create the option if it no already existed. - if {![exists_and_not_null option_id]} { - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option $value] - ns_log notice "...... CREATED OPTION $option_id: $value" - } - - # Save the value using the option_id - set value_id [ams::util::options_save \ - -options $option_id] - ams::attribute::value_save -object_id $object_id -attribute_id $attribute_id -value_id $value_id - } -} \ No newline at end of file