IDEMPIERE-2271:iDempiere is hardcoded EMail to support subject

conducte feedback header from env variable
This commit is contained in:
hieplq 2016-12-12 17:15:19 +07:00
parent ec8c0ea178
commit 060c5a2854
4 changed files with 24 additions and 1 deletions

View File

@ -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
;

View File

@ -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
;

View File

@ -188,6 +188,9 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, 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);

View File

@ -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);