From 060c5a285492bbf4a198a94bd0b5d5e9935f1736 Mon Sep 17 00:00:00 2001 From: hieplq Date: Mon, 12 Dec 2016 17:15:19 +0700 Subject: [PATCH] IDEMPIERE-2271:iDempiere is hardcoded EMail to support subject conducte feedback header from env variable --- migration/i4.1/oracle/201612121604-IDEMPIERE-2271.sql | 9 +++++++++ .../i4.1/postgresql/201612121604-IDEMPIERE-2271.sql | 6 ++++++ .../WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java | 3 +++ .../adempiere/webui/factory/DefaultFeedbackService.java | 7 ++++++- 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 migration/i4.1/oracle/201612121604-IDEMPIERE-2271.sql create mode 100644 migration/i4.1/postgresql/201612121604-IDEMPIERE-2271.sql diff --git a/migration/i4.1/oracle/201612121604-IDEMPIERE-2271.sql b/migration/i4.1/oracle/201612121604-IDEMPIERE-2271.sql new file mode 100644 index 0000000000..8d4fce6a7a --- /dev/null +++ b/migration/i4.1/oracle/201612121604-IDEMPIERE-2271.sql @@ -0,0 +1,9 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2271 iDempiere is hardcoded EMail to support subject +-- Dec 12, 2016 4:50:36 PM ICT +INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','@#System_Name@ Trace Information',0,0,'Y',TO_DATE('2016-12-12 16:50:35','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2016-12-12 16:50:35','YYYY-MM-DD HH24:MI:SS'),100,200414,'FeedBackHeader','D','1a27d0a9-0832-4e63-b49b-bb26eeceafc4') +; +SELECT register_migration_script('201612121604-IDEMPIERE-2271.sql') FROM dual +; diff --git a/migration/i4.1/postgresql/201612121604-IDEMPIERE-2271.sql b/migration/i4.1/postgresql/201612121604-IDEMPIERE-2271.sql new file mode 100644 index 0000000000..3b23e697e8 --- /dev/null +++ b/migration/i4.1/postgresql/201612121604-IDEMPIERE-2271.sql @@ -0,0 +1,6 @@ +-- IDEMPIERE-2271 iDempiere is hardcoded EMail to support subject +-- Dec 12, 2016 4:50:36 PM ICT +INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','@#System_Name@ Trace Information',0,0,'Y',TO_TIMESTAMP('2016-12-12 16:50:35','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2016-12-12 16:50:35','YYYY-MM-DD HH24:MI:SS'),100,200414,'FeedBackHeader','D','1a27d0a9-0832-4e63-b49b-bb26eeceafc4') +; +SELECT register_migration_script('201612121604-IDEMPIERE-2271.sql') FROM dual +; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index c1b7e3c07a..39e4ed5b03 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -188,6 +188,9 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb Env.setContext(ctx, Env.LANGUAGE, langSession); } + MSystem system = MSystem.get(Env.getCtx()); + Env.setContext(ctx, "#System_Name", system.getName()); + // Validate language Language language = Language.getLanguage(langLogin); String locale = Env.getContext(ctx, AEnv.LOCALE); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultFeedbackService.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultFeedbackService.java index c5da1f38f4..c8f341263a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultFeedbackService.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultFeedbackService.java @@ -96,6 +96,11 @@ public class DefaultFeedbackService implements IFeedbackService { showEmailDialog(imageBytes); } + protected String getFeedbackSubject() { + String feedBackHeader = Msg.getMsg(Env.getCtx(), "FeedBackHeader"); + return Env.parseContext(Env.getCtx(), 0, feedBackHeader, false, false); + } + protected void showEmailDialog(byte[] imageBytes) { DataSource ds = FeedbackManager.getLogAttachment(errorOnly); @@ -103,7 +108,7 @@ public class DefaultFeedbackService implements IFeedbackService { Msg.getMsg(Env.getCtx(), "EMailSupport"), MUser.get(Env.getCtx()), "", // to - MSystem.get(Env.getCtx()).getName() + " " + Msg.getMsg(Env.getCtx(), "TraceInfo"), + getFeedbackSubject(), "", ds); dialog.setAttribute(Window.MODE_KEY, Mode.OVERLAPPED);