From a837333c9367df25a1a6330bf441988bdfed278f Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Thu, 12 Jul 2012 16:42:05 +0200 Subject: [PATCH] IDEMPIERE-338 Translation of Doc messages --- .../oracle/852_IDEMPIERE-338.sql | 35 +++++++++++++++++++ .../postgresql/852_IDEMPIERE-338.sql | 35 +++++++++++++++++++ .../src/org/compiere/acct/Doc.java | 6 ++-- 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 migration/360lts-release/oracle/852_IDEMPIERE-338.sql create mode 100644 migration/360lts-release/postgresql/852_IDEMPIERE-338.sql diff --git a/migration/360lts-release/oracle/852_IDEMPIERE-338.sql b/migration/360lts-release/oracle/852_IDEMPIERE-338.sql new file mode 100644 index 0000000000..9b4530ba42 --- /dev/null +++ b/migration/360lts-release/oracle/852_IDEMPIERE-338.sql @@ -0,0 +1,35 @@ +-- Jul 12, 2012 4:35:39 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200006,0,TO_DATE('2012-07-12 16:35:37','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Cannot post inactive document','I',TO_DATE('2012-07-12 16:35:37','YYYY-MM-DD HH24:MI:SS'),100,'CannotPostInactiveDocument') +; + +-- Jul 12, 2012 4:35:39 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200006 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Jul 12, 2012 4:35:51 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200007,0,TO_DATE('2012-07-12 16:35:50','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Cannot Lock - ReSubmit','I',TO_DATE('2012-07-12 16:35:50','YYYY-MM-DD HH24:MI:SS'),100,'CannotLockReSubmit') +; + +-- Jul 12, 2012 4:35:51 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200007 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Jul 12, 2012 4:35:59 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200008,0,TO_DATE('2012-07-12 16:35:59','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Cannot Lock - ReSubmit or RePost with Force','I',TO_DATE('2012-07-12 16:35:59','YYYY-MM-DD HH24:MI:SS'),100,'CannotLockReSubmitOrRePostWithForce') +; + +-- Jul 12, 2012 4:35:59 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200008 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +UPDATE AD_System + SET LastMigrationScriptApplied='852_IDEMPIERE-338.sql' +WHERE LastMigrationScriptApplied<'852_IDEMPIERE-338.sql' + OR LastMigrationScriptApplied IS NULL +; \ No newline at end of file diff --git a/migration/360lts-release/postgresql/852_IDEMPIERE-338.sql b/migration/360lts-release/postgresql/852_IDEMPIERE-338.sql new file mode 100644 index 0000000000..c2d6b7bea4 --- /dev/null +++ b/migration/360lts-release/postgresql/852_IDEMPIERE-338.sql @@ -0,0 +1,35 @@ +-- Jul 12, 2012 4:35:39 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200006,0,TO_TIMESTAMP('2012-07-12 16:35:37','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Cannot post inactive document','I',TO_TIMESTAMP('2012-07-12 16:35:37','YYYY-MM-DD HH24:MI:SS'),100,'CannotPostInactiveDocument') +; + +-- Jul 12, 2012 4:35:39 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200006 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Jul 12, 2012 4:35:51 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200007,0,TO_TIMESTAMP('2012-07-12 16:35:50','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Cannot Lock - ReSubmit','I',TO_TIMESTAMP('2012-07-12 16:35:50','YYYY-MM-DD HH24:MI:SS'),100,'CannotLockReSubmit') +; + +-- Jul 12, 2012 4:35:51 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200007 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Jul 12, 2012 4:35:59 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200008,0,TO_TIMESTAMP('2012-07-12 16:35:59','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Cannot Lock - ReSubmit or RePost with Force','I',TO_TIMESTAMP('2012-07-12 16:35:59','YYYY-MM-DD HH24:MI:SS'),100,'CannotLockReSubmitOrRePostWithForce') +; + +-- Jul 12, 2012 4:35:59 PM CEST +-- IDEMPIERE-338 Translation of Doc messages +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200008 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +UPDATE AD_System + SET LastMigrationScriptApplied='852_IDEMPIERE-338.sql' +WHERE LastMigrationScriptApplied<'852_IDEMPIERE-338.sql' + OR LastMigrationScriptApplied IS NULL +; \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/acct/Doc.java b/org.adempiere.base/src/org/compiere/acct/Doc.java index 1f5aed2dcb..fc65bee3d5 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc.java @@ -456,10 +456,10 @@ public abstract class Doc log.log(Level.SEVERE, "Resubmit - Cannot lock " + get_TableName() + "_ID=" + get_ID() + ", Force=" + force + ",RePost=" + repost); if (!p_po.isActive()) - return "Cannot post inactive document"; + return Msg.translate(getCtx(), "CannotPostInactiveDocument"); if (force) - return "Cannot Lock - ReSubmit"; - return "Cannot Lock - ReSubmit or RePost with Force"; + return Msg.translate(getCtx(), "CannotLockReSubmit"); + return Msg.translate(getCtx(), "CannotLockReSubmitOrRePostWithForce"); } p_Error = loadDocumentDetails();