Index: openacs-4/packages/acs-lang/tcl/lang-audit-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-audit-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-lang/tcl/lang-audit-procs-oracle.xql 3 Dec 2002 17:26:54 -0000 1.1 +++ openacs-4/packages/acs-lang/tcl/lang-audit-procs-oracle.xql 11 Aug 2003 16:16:21 -0000 1.2 @@ -4,9 +4,9 @@ - insert into lang_messages_audit (package_key, message_key, locale, message, overwrite_user) - values (:package_key, :message_key, :locale, empty_clob(), :overwrite_user) - returning message into :1 + insert into lang_messages_audit (package_key, message_key, locale, old_message, comment_text, overwrite_user) + values (:package_key, :message_key, :locale, empty_clob(), empty_clob(), :overwrite_user) + returning old_message, comment_text into :1, :2 Index: openacs-4/packages/acs-lang/tcl/lang-audit-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-audit-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-lang/tcl/lang-audit-procs-postgresql.xql 9 Jan 2003 09:39:56 -0000 1.2 +++ openacs-4/packages/acs-lang/tcl/lang-audit-procs-postgresql.xql 11 Aug 2003 16:16:21 -0000 1.3 @@ -4,8 +4,8 @@ - insert into lang_messages_audit (package_key, message_key, locale, message, overwrite_user) - values (:package_key, :message_key, :locale, :old_message, :overwrite_user) + insert into lang_messages_audit (package_key, message_key, locale, old_message, comment_text, overwrite_user) + values (:package_key, :message_key, :locale, :old_message, :comment, :overwrite_user) Index: openacs-4/packages/acs-lang/tcl/lang-audit-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-audit-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-lang/tcl/lang-audit-procs.tcl 21 Jan 2003 18:46:53 -0000 1.2 +++ openacs-4/packages/acs-lang/tcl/lang-audit-procs.tcl 11 Aug 2003 16:16:21 -0000 1.3 @@ -15,17 +15,15 @@ package_key message_key locale + comment } { Save a message that is overwritten. @author Peter Marklund } { # Save the old message in the audit table set overwrite_user [ad_conn user_id] - db_dml lang_message_audit { - insert into lang_messages_audit (package_key, message_key, locale, message, overwrite_user) - values (:package_key, :message_key, :locale, empty_clob(), :overwrite_user) - returning message into :1 - } -clobs [list $old_message] + + db_dml lang_message_audit {} -clobs [list $old_message $comment] } ad_proc -public created_message { Index: openacs-4/packages/acs-lang/www/admin/audit-include.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/audit-include.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-lang/www/admin/audit-include.adp 3 Dec 2002 17:27:23 -0000 1.1 +++ openacs-4/packages/acs-lang/www/admin/audit-include.adp 11 Aug 2003 16:16:21 -0000 1.2 @@ -1,20 +1,29 @@ - -

-Current translation by @current_message_author@ at @current_message_date@ -

+ +

+ Translation History: +

+
- - -

-Translation History: -

-

-
- - -Original translation: "@original_message@" - Index: openacs-4/packages/acs-lang/www/admin/audit-include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/audit-include.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-lang/www/admin/audit-include.tcl 3 Dec 2002 17:27:23 -0000 1.1 +++ openacs-4/packages/acs-lang/www/admin/audit-include.tcl 11 Aug 2003 16:16:21 -0000 1.2 @@ -1,9 +1,15 @@ set trail_counter 0 -multirow create audit_trail message creation_user creation_date -db_foreach audit_trail_select { - select a.message, - p.first_names || ' ' || p.last_name as overwrite_user, - to_char(a.overwrite_date, 'YYYY-MM-DD HH24:MI:SS') as overwrite_date + +multirow create audit_inv creation_user_id creation_user_name creation_date old_message new_message old_new_message comment_text + +set new_message [lang::message::lookup $current_locale "${package_key}.${message_key}"] + +db_foreach audit_inv_select { + select a.old_message, + p.first_names || ' ' || p.last_name as overwrite_user_name, + a.overwrite_user, + to_char(a.overwrite_date, 'YYYY-MM-DD HH24:MI:SS') as overwrite_date, + a.comment_text from lang_messages_audit a, persons p where locale = :current_locale @@ -12,21 +18,43 @@ and a.overwrite_user = p.person_id order by overwrite_date desc } { + multirow append audit_inv \ + $overwrite_user \ + $overwrite_user_name \ + [lc_time_fmt $overwrite_date "%x %Xb"] \ + $old_message \ + $new_message \ + "$old_message,$new_message" \ + $comment_text + + set new_message $old_message - if { [string equal $trail_counter 0] } { - set current_message_author $overwrite_user - set current_message_date $overwrite_date - - } else { - multirow append audit_trail $previous_message $overwrite_user $overwrite_date - } - - set previous_message $message - set previous_overwrite_user $overwrite_user - set previous_overwrite_date $overwrite_date incr trail_counter } if { $trail_counter > 0 } { - set original_message $previous_message + set original_message $new_message } + +# invert the audit trail + +multirow create audit creation_user_id creation_user_name creation_date old_message new_message old_new_message comment_text + +for { set i [multirow size audit_inv] } { $i > 0 } { incr i -1 } { + multirow get audit_inv $i + + multirow append audit \ + $audit_inv(creation_user_id) \ + $audit_inv(creation_user_name) \ + $audit_inv(creation_date) \ + $audit_inv(old_message) \ + $audit_inv(new_message) \ + $audit_inv(old_new_message) \ + $audit_inv(comment_text) +} + +multirow extend audit creation_user_url + +multirow foreach audit { + set creation_user_url [acs_community_member_url -user_id $creation_user_id] +} 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.7 -r1.8 --- openacs-4/packages/acs-lang/www/admin/edit-localized-message.adp 22 May 2003 14:05:12 -0000 1.7 +++ openacs-4/packages/acs-lang/www/admin/edit-localized-message.adp 11 Aug 2003 16:16:21 -0000 1.8 @@ -22,6 +22,8 @@ - +

+ » Show message key usage +

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.6 -r1.7 --- openacs-4/packages/acs-lang/www/admin/edit-localized-message.tcl 8 Aug 2003 12:21:28 -0000 1.6 +++ openacs-4/packages/acs-lang/www/admin/edit-localized-message.tcl 11 Aug 2003 16:16:21 -0000 1.7 @@ -45,6 +45,9 @@ element create message_editing message -label "Message" \ -datatype text -widget textarea -html { rows 6 cols 40 } +element create message_editing comment -optional -label "Comment" \ + -datatype text -widget textarea -html { rows 6 cols 40 } + # The hidden elements for passing package key, message key and locale element create message_editing message_key -datatype text -widget hidden @@ -133,7 +136,7 @@ form get_values message_editing return_url # Register message via acs-lang - lang::message::register $locale $package_key $message_key $message + lang::message::register $locale $package_key $message_key $message $comment # Even if the country code is 2 chars, we avoid problems... set escaped_locale [ns_urlencode $locale] @@ -143,3 +146,5 @@ error $message } + +set lookups_url "lookups?[export_vars { package_key { message_key_list $message_key } }]"