diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HelpController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HelpController.java index f0bb4c7c5e..1de491c144 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HelpController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HelpController.java @@ -171,6 +171,8 @@ public class HelpController sb.append("\n\n
\n"); String ctxHelpMsg = getCtxHelpMsgList(ctxType, recordId); + String helpMsg, nameMsg, descMsg; + if (ctxHelpMsg.length() > 0) sb.append(stripHtml(ctxHelpMsg, false) + "
\n"); else @@ -180,58 +182,145 @@ public class HelpController if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Tab)) { MTab tab = new MTab(Env.getCtx(), recordId, null); - if (tab != null && tab.getName() != null && tab.getName().length() != 0) - { - sb.append("

\n" + tab.getName() + ""); - - if (tab.getDescription() != null && tab.getDescription().length() != 0) - sb.append("

\n" + tab.getDescription() + ""); - - if (tab.getHelp() != null && tab.getHelp().length() != 0) - sb.append("

\n" + tab.getHelp()); - } + if (!Env.isBaseLanguage(Env.getCtx(), "AD_Tab")) { + + nameMsg = tab.get_Translation("Name"); + if (tab != null && nameMsg != null && nameMsg.length() != 0) + sb.append("

\n" + nameMsg + ""); + + descMsg = tab.get_Translation("Description"); + if (descMsg != null && descMsg.length() != 0) + sb.append("

\n" + descMsg + ""); + + helpMsg = tab.get_Translation("Help"); + if (helpMsg != null && helpMsg.length() != 0) + sb.append("

\n" + helpMsg); + + } + + else { + if (tab != null && tab.getName() != null + && tab.getName().length() != 0) { + sb.append("

\n" + tab.getName() + ""); + + if (tab.getDescription() != null + && tab.getDescription().length() != 0) + sb.append("

\n" + tab.getDescription() + + ""); + + if (tab.getHelp() != null + && tab.getHelp().length() != 0) + sb.append("

\n" + tab.getHelp()); + } + } } else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Process)) { MProcess process = new MProcess(Env.getCtx(), recordId, null); - if (process != null && process.getName() != null && process.getName().length() != 0) - { - sb.append("

\n" + process.getName() + ""); - - if (process.getDescription() != null && process.getDescription().length() != 0) - sb.append("

\n" + process.getDescription() + ""); - - if (process.getHelp() != null && process.getHelp().length() != 0) - sb.append("

\n" + process.getHelp()); - } + if (!Env.isBaseLanguage(Env.getCtx(), "AD_Process")) { + + nameMsg = process.get_Translation("Name"); + if (process != null && nameMsg != null + && nameMsg.length() != 0) + sb.append("

\n" + nameMsg + ""); + + descMsg = process.get_Translation("Description"); + if (descMsg != null && descMsg.length() != 0) + sb.append("

\n" + descMsg + ""); + + helpMsg = process.get_Translation("Help"); + if (helpMsg != null && helpMsg.length() != 0) + sb.append("

\n" + helpMsg); + + } else { + + if (process != null && process.getName() != null + && process.getName().length() != 0) + sb.append("

\n" + process.getName() + ""); + + if (process.getDescription() != null + && process.getDescription().length() != 0) + sb.append("

\n" + process.getDescription() + + ""); + + if (process.getHelp() != null + && process.getHelp().length() != 0) + sb.append("

\n" + process.getHelp()); + + } + } else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Form)) { MForm form = new MForm(Env.getCtx(), recordId, null); - if (form != null && form.getName() != null && form.getName().length() != 0) - { - sb.append("

\n" + form.getName() + ""); - - if (form.getDescription() != null && form.getDescription().length() != 0) - sb.append("

\n" + form.getDescription() + ""); - - if (form.getHelp() != null && form.getHelp().length() != 0) - sb.append("

\n" + form.getHelp()); - } + if (!Env.isBaseLanguage(Env.getCtx(), "AD_Form")) { + + nameMsg = form.get_Translation("Name"); + + if (form != null && nameMsg != null + && nameMsg.length() != 0) + sb.append("

\n" + nameMsg + ""); + + descMsg = form.get_Translation("Description"); + if (descMsg != null && descMsg.length() != 0) + sb.append("

\n" + descMsg + ""); + + helpMsg = form.get_Translation("Help"); + if (helpMsg != null && helpMsg.length() != 0) + sb.append("

\n" + helpMsg); + + } else { + + if (form != null && form.getName() != null + && form.getName().length() != 0) { + sb.append("

\n" + form.getName() + ""); + + if (form.getDescription() != null + && form.getDescription().length() != 0) + sb.append("

\n" + form.getDescription() + + ""); + + if (form.getHelp() != null + && form.getHelp().length() != 0) + sb.append("

\n" + form.getHelp()); + } + + } } else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Info)) { MInfoWindow info = new MInfoWindow(Env.getCtx(), recordId, null); - if (info != null && info.getName() != null && info.getName().length() != 0) - { - sb.append("

\n" + info.getName() + ""); - - if (info.getDescription() != null && info.getDescription().length() != 0) - sb.append("

\n" + info.getDescription() + ""); - - if (info.getHelp() != null && info.getHelp().length() != 0) - sb.append("

\n" + info.getHelp()); - } + if (!Env.getLoginLanguage(Env.getCtx()).isBaseLanguage()) { + + nameMsg = info.get_Translation("Name"); + if (info != null && nameMsg != null + && nameMsg.length() != 0) { + sb.append("

\n" + nameMsg + ""); + + descMsg = info.get_Translation("Description"); + if (descMsg != null && descMsg.length() != 0) + sb.append("

\n" + descMsg + ""); + + helpMsg = info.get_Translation("Help"); + if (helpMsg != null && helpMsg.length() != 0) + sb.append("

\n" + helpMsg); + + } else { + if (info != null && info.getName() != null + && info.getName().length() != 0) + sb.append("

\n" + info.getName() + ""); + + if (info.getDescription() != null + && info.getDescription().length() != 0) + sb.append("

\n" + info.getDescription() + + ""); + + if (info.getHelp() != null + && info.getHelp().length() != 0) + sb.append("

\n" + info.getHelp()); + + } + } } else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Workflow)) {