Index: openacs-4/packages/ams/tcl/ams-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-init.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/ams/tcl/ams-init.tcl 9 Jun 2005 20:19:41 -0000 1.3 +++ openacs-4/packages/ams/tcl/ams-init.tcl 9 Sep 2005 17:08:30 -0000 1.4 @@ -39,8 +39,9 @@ if {[exists_and_not_null locale]} { lang::message::register $locale $package_key $message_key $text } - + return "\#${package_key}.${message_key}\#" } } + Index: openacs-4/packages/ams/tcl/ams-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-install-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ams/tcl/ams-install-procs.tcl 9 Sep 2005 17:08:30 -0000 1.1 @@ -0,0 +1,35 @@ +# packages/ams/tcl/ams-install-provs.tcl + +ad_library { + + install procs for AMS + + @author Malte Sussdorff (sussdorff@sussdorff.de) + @creation-date 2005-09-09 + @arch-tag: 329a828d-99b0-41cf-89f4-2f8f6b4cfaf5 + @cvs-id $Id: ams-install-procs.tcl,v 1.1 2005/09/09 17:08:30 maltes Exp $ +} + +namespace eval ams::install {} + +ad_proc -public ams::install::after_upgrade { + {-from_version_name:required} + {-to_version_name:required} +} { + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 1.1d2 1.1d3 { + db_transaction { + db_foreach select_option_name {select option_id, option from ams_option_types} { + set pretty_name [lang::util::convert_to_i18n -message_key "ams_option_$option_id" -text "$option"] + ns_log Notice "prettry.::: $pretty_name" + db_dml update_pretty_name "update acs_objects set title = :pretty_name where object_id = :option_id" + } + } + } + } +} + + 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.21 -r1.22 --- openacs-4/packages/ams/tcl/ams-procs.tcl 9 Sep 2005 14:06:12 -0000 1.21 +++ openacs-4/packages/ams/tcl/ams-procs.tcl 9 Sep 2005 17:08:30 -0000 1.22 @@ -67,10 +67,10 @@ @see ams::attribute::new } { - set pretty_name [lang::util::convert_to_i18n -message_key "ams_attribute.${object_type}.${attribute_name}.pretty_name" -text "$pretty_name"] - set pretty_plural [lang::util::convert_to_i18n -message_key "ams_attribute.${object_type}.${attribute_name}.pretty_plural" -text "$pretty_plural"] + set pretty_name [lang::util::convert_to_i18n -message_key "ams_attribute_${object_type}_${attribute_name}_pretty_name" -text "$pretty_name"] + set pretty_plural [lang::util::convert_to_i18n -message_key "ams_attribute_${object_type}_${attribute_name}_pretty_plural" -text "$pretty_plural"] -if { $if_does_not_exist_p } { + if { $if_does_not_exist_p } { set attribute_id [attribute::id -object_type $object_type -attribute_name $attribute_name] if { [string is false [exists_and_not_null attribute_id]] } { set attribute_id [db_string create_attribute {}] @@ -264,14 +264,13 @@ } { Create a new ams option for an attribute } { - db_1row get_object_data { select object_type, attribute_name from ams_attributes where attribute_id = :attribute_id } set option_id [db_string get_option_id { select option_id from ams_option_types where option = :option and attribute_id = :attribute_id } -default {}] if { $option_id == "" } { set option_id [db_nextval acs_object_id_seq] - set pretty_name [lang::util::convert_to_i18n -message_key "${attribute_name}_$option_id" -text "$option"] + set pretty_name [lang::util::convert_to_i18n -message_key "ams_option_${option_id}" -text "$option"] set extra_vars [ns_set create] oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {option_id attribute_id option sort_order deprecated_p pretty_name} set option_id [package_instantiate_object -extra_vars $extra_vars ams_option]