Index: openacs-4/packages/acs-lang/www/admin/edit-localized-message.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/edit-localized-message.adp,v
diff -u -r1.11 -r1.11.2.1
--- openacs-4/packages/acs-lang/www/admin/edit-localized-message.adp 30 Jan 2004 14:53:06 -0000 1.11
+++ openacs-4/packages/acs-lang/www/admin/edit-localized-message.adp 18 Mar 2004 15:59:36 -0000 1.11.2.1
@@ -8,6 +8,8 @@
Audit Trail
+@first_translated_message;noquote@
+
Files that use this message
Index: openacs-4/packages/acs-lang/www/admin/edit-localized-message.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/edit-localized-message.tcl,v
diff -u -r1.10 -r1.10.4.1
--- openacs-4/packages/acs-lang/www/admin/edit-localized-message.tcl 30 Sep 2003 10:07:23 -0000 1.10
+++ openacs-4/packages/acs-lang/www/admin/edit-localized-message.tcl 18 Mar 2004 15:59:36 -0000 1.10.4.1
@@ -94,13 +94,18 @@
and lm.locale = :default_locale
}
- db_0or1row select_translated_message {
- select message as message
- from lang_messages
- where package_key = :package_key
- and message_key = :message_key
- and locale = :current_locale
- }
+ set translated_p [db_0or1row select_translated_message {
+ select lm.message as message,
+ cu.first_names || ' ' || cu.last_name as creation_user_name,
+ cu.user_id as creation_user_id,
+ to_char(lm.creation_date, 'YYYY-MM-DD') as creation_date
+ from lang_messages lm,
+ cc_users cu
+ where lm.package_key = :package_key
+ and lm.message_key = :message_key
+ and lm.locale = :current_locale
+ and cu.user_id = lm.creation_user
+ }]
set original_message [ad_quotehtml $original_message]
if { [exists_and_not_null message] } {
@@ -112,6 +117,43 @@
} else {
set description "[ad_text_to_html -- $description] [subst { (edit)}]"
}
+
+ # Augment the audit trail with info on who created the first message
+ if { ![string equal $current_locale $default_locale] && $translated_p } {
+ set edited_p [db_string edit_count {
+ select count(*)
+ from lang_messages_audit
+ where package_key = :package_key
+ and message_key = :message_key
+ and locale = :current_locale
+ }]
+
+ if { $edited_p } {
+ # The translation has been edited
+ # Get the creation user of the first revision
+ db_1row select_first_revision {
+ select cu.first_names || ' ' || cu.last_name as creation_user_name,
+ cu.user_id as creation_user_id,
+ to_char(lma.overwrite_date, 'YYYY-MM-DD') as creation_date
+ from lang_messages_audit lma,
+ cc_users cu
+ where lma.package_key = :package_key
+ and lma.message_key = :message_key
+ and lma.locale = :current_locale
+ and cu.user_id = lma.overwrite_user
+ and lma.audit_id = (select min(lm2.audit_id)
+ from lang_messages_audit lm2
+ where lm2.package_key = :package_key
+ and lm2.message_key = :message_key
+ and lm2.locale = :current_locale
+ )
+ }
+ }
+
+ set first_translated_message " - First translated by [acs_community_member_link -user_id $creation_user_id -label $creation_user_name] on $creation_date
"
+ } else {
+ set first_translated_message ""
+ }
} -on_submit {
# Register message via acs-lang
@@ -123,4 +165,3 @@
ad_returnredirect $return_url
ad_script_abort
}
-