Index: openacs-4/packages/acs-lang/acs-lang.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/acs-lang.info,v
diff -u -r1.28 -r1.29
--- openacs-4/packages/acs-lang/acs-lang.info 12 Sep 2003 14:13:57 -0000 1.28
+++ openacs-4/packages/acs-lang/acs-lang.info 22 Sep 2003 11:56:07 -0000 1.29
@@ -7,7 +7,7 @@
t
t
-
+
Peter Marklund
OpenACS Internationalization Utilities
2003-02-16
@@ -17,7 +17,7 @@
locale-specific formatting functions.
-
+
Index: openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql 18 Aug 2003 10:33:18 -0000 1.9
+++ openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql 22 Sep 2003 11:49:01 -0000 1.10
@@ -50,6 +50,10 @@
upgrade_status varchar2(30)
constraint lang_messages_us_ck
check (upgrade_status in ('no_upgrade', 'added', 'deleted', 'updated')),
+ creation_date date default sysdate not null,
+ creation_user integer
+ constraint lang_messages_create_u_fk
+ references users (user_id),
constraint lang_messages_fk
foreign key (message_key, package_key)
references lang_message_keys(message_key, package_key)
Index: openacs-4/packages/acs-lang/sql/oracle/upgrade/upgrade-5.0d2-5.0d3.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/oracle/upgrade/upgrade-5.0d2-5.0d3.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-lang/sql/oracle/upgrade/upgrade-5.0d2-5.0d3.sql 22 Sep 2003 11:49:01 -0000 1.1
@@ -0,0 +1,4 @@
+alter table lang_messages add creation_date date default sysdate not null;
+alter table lang_messages add creation_user integer
+ constraint lang_messages_create_u_fk
+ references users (user_id);
Index: openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql 28 Aug 2003 08:11:14 -0000 1.12
+++ openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql 22 Sep 2003 11:49:01 -0000 1.13
@@ -51,6 +51,12 @@
upgrade_status varchar(30)
constraint lang_messages_us_ck
check (upgrade_status in ('no_upgrade', 'added', 'deleted', 'updated')),
+ creation_date timestamptz
+ default now()
+ not null,
+ creation_user integer
+ constraint lang_messages_creation_u_fk
+ references users (user_id),
constraint lang_messages_fk
foreign key (message_key, package_key)
references lang_message_keys(message_key, package_key)
Index: openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0d2-5.0d3.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0d2-5.0d3.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0d2-5.0d3.sql 22 Sep 2003 11:49:01 -0000 1.1
@@ -0,0 +1,45 @@
+-- Adding columns creation_user and creation_date to lang_messages
+-- Need to add not-null column so re-creating table
+create table lang_messages_tmp (
+ message_key varchar(200),
+ package_key varchar(100),
+ locale varchar(30),
+ message text,
+ upgrade_status varchar(30)
+);
+
+insert into lang_messages_tmp select message_key, package_key, locale, message, upgrade_status from lang_messages;
+
+drop table lang_messages;
+
+create table lang_messages (
+ message_key varchar(200)
+ constraint lang_messages_message_key_nn
+ not null,
+ package_key varchar(100)
+ constraint lang_messages_package_key_nn
+ not null,
+ locale varchar(30)
+ constraint lang_messages_locale_fk
+ references ad_locales(locale)
+ constraint lang_messages_locale_nn
+ not null,
+ message text,
+ upgrade_status varchar(30)
+ constraint lang_messages_us_ck
+ check (upgrade_status in ('no_upgrade', 'added', 'deleted', 'updated')),
+ creation_date timestamptz
+ default now()
+ not null,
+ creation_user integer
+ constraint lang_messages_creation_u_fk
+ references users (user_id),
+ constraint lang_messages_fk
+ foreign key (message_key, package_key)
+ references lang_message_keys(message_key, package_key)
+ on delete cascade,
+ constraint lang_messages_pk
+ primary key (message_key, package_key, locale)
+);
+
+insert into lang_messages select message_key, package_key, locale, message, upgrade_status, now(), null from lang_messages_tmp;
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.3 -r1.4
--- openacs-4/packages/acs-lang/tcl/lang-audit-procs.tcl 11 Aug 2003 16:16:21 -0000 1.3
+++ openacs-4/packages/acs-lang/tcl/lang-audit-procs.tcl 22 Sep 2003 11:49:01 -0000 1.4
@@ -25,19 +25,4 @@
db_dml lang_message_audit {} -clobs [list $old_message $comment]
}
-
- ad_proc -public created_message {
- package_key
- message_key
- locale
- } {
- Keep track of who added a translation and when
- @author Peter Marklund
- } {
- set user_id [ad_conn user_id]
- db_dml lang_message_audit_create {
- insert into lang_messages_created (package_key, message_key, locale, creation_user)
- values (:package_key, :message_key, :locale, :user_id)
- }
- }
}
Index: openacs-4/packages/acs-lang/tcl/lang-message-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs-oracle.xql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/acs-lang/tcl/lang-message-procs-oracle.xql 18 Aug 2003 08:10:21 -0000 1.6
+++ openacs-4/packages/acs-lang/tcl/lang-message-procs-oracle.xql 22 Sep 2003 11:49:01 -0000 1.7
@@ -16,8 +16,8 @@
- insert into lang_messages (package_key, message_key, locale, message, upgrade_status)
- values (:package_key, :message_key, :locale, empty_clob(), :message_upgrade_status)
+ insert into lang_messages (package_key, message_key, locale, message, upgrade_status, creation_user)
+ values (:package_key, :message_key, :locale, empty_clob(), :message_upgrade_status, :creation_user)
returning message into :1
Index: openacs-4/packages/acs-lang/tcl/lang-message-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs-postgresql.xql,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/acs-lang/tcl/lang-message-procs-postgresql.xql 18 Aug 2003 08:10:21 -0000 1.7
+++ openacs-4/packages/acs-lang/tcl/lang-message-procs-postgresql.xql 22 Sep 2003 11:49:01 -0000 1.8
@@ -5,8 +5,8 @@
- insert into lang_messages (package_key, message_key, locale, message, upgrade_status)
- values (:package_key, :message_key, :locale, :message, :message_upgrade_status)
+ insert into lang_messages (package_key, message_key, locale, message, upgrade_status, creation_user)
+ values (:package_key, :message_key, :locale, :message, :message_upgrade_status, :creation_user)
Index: openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl,v
diff -u -r1.25 -r1.26
--- openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 21 Sep 2003 17:51:20 -0000 1.25
+++ openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 22 Sep 2003 11:49:01 -0000 1.26
@@ -115,6 +115,12 @@
ns_log Notice "lang::message::register - Giving message for key $message_key in locale $locale an upgrade status of $message_upgrade_status"
}
+ if { [ad_conn isconnected] } {
+ set creation_user [ad_conn user_id]
+ } else {
+ set creation_user [db_null]
+ }
+
# avoiding bug#2011927 from Oracle.
if { [empty_string_p [string trim $message]] } {
db_dml lang_message_insert_null_msg {}
@@ -125,8 +131,6 @@
db_dml lang_message_insert {} -clobs [list $message]
}
nsv_set lang_message_$locale $key $message
-
- lang::audit::created_message $package_key $message_key $locale
}
}
}