IDEMPIERE-842 The How-To help widget is partly language dependent / Thanks to Naim Berisha (nberisha)

This commit is contained in:
Carlos Ruiz 2013-07-15 19:57:51 -05:00
parent 97135e403e
commit 6ade4c42ca
1 changed files with 110 additions and 43 deletions

View File

@ -322,48 +322,114 @@ public class HelpController
}
}
}
else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Workflow))
{
MWorkflow workflow = new MWorkflow(Env.getCtx(), recordId, null);
if (workflow != null && workflow.getName() != null && workflow.getName().length() != 0)
{
sb.append("<br><br>\n<b>" + workflow.getName() + "</b>");
else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Workflow)) {
MWorkflow workflow = new MWorkflow(Env.getCtx(), recordId, null);
if (workflow.getDescription() != null && workflow.getDescription().length() != 0)
sb.append("<br><br>\n<i>" + workflow.getDescription() + "</i>");
if (!Env.getLoginLanguage(Env.getCtx()).isBaseLanguage()) {
if (workflow.getHelp() != null && workflow.getHelp().length() != 0)
sb.append("<br><br>\n" + workflow.getHelp());
}
}
else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Task))
{
MTask task = new MTask(Env.getCtx(), recordId, null);
if (task != null && task.getName() != null && task.getName().length() != 0)
{
sb.append("<br><br>\n<b>" + task.getName() + "</b>");
nameMsg = workflow.get_Translation("Name");
if (task.getDescription() != null && task.getDescription().length() != 0)
sb.append("<br><br>\n<i>" + task.getDescription() + "</i>");
if (workflow != null && nameMsg != null
&& nameMsg.length() != 0) {
sb.append("<br><br>\n<b>" + nameMsg + "</b>");
if (task.getHelp() != null && task.getHelp().length() != 0)
sb.append("<br><br>\n" + task.getHelp());
}
}
else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Node))
{
MWFNode node = new MWFNode(Env.getCtx(), recordId, null);
if (node != null && node.getName() != null && node.getName().length() != 0)
{
sb.append("<br><br>\n<b>" + node.getName() + "</b>");
descMsg = workflow.get_Translation("Description");
if (descMsg != null && descMsg.length() != 0)
sb.append("<br><br>\n<i>" + descMsg + "</i>");
if (node.getDescription() != null && node.getDescription().length() != 0)
sb.append("<br><br>\n<i>" + node.getDescription() + "</i>");
helpMsg = workflow.get_Translation("Help");
if (helpMsg != null && helpMsg.length() != 0)
sb.append("<br><br>\n" + helpMsg);
}
} else {
if (node.getHelp() != null && node.getHelp().length() != 0)
sb.append("<br><br>\n" + node.getHelp());
}
}
if (workflow != null && workflow.getName() != null
&& workflow.getName().length() != 0) {
sb.append("<br><br>\n<b>" + workflow.getName() + "</b>");
if (workflow.getDescription() != null
&& workflow.getDescription().length() != 0)
sb.append("<br><br>\n<i>"
+ workflow.getDescription() + "</i>");
if (workflow.getHelp() != null
&& workflow.getHelp().length() != 0)
sb.append("<br><br>\n" + workflow.getHelp());
}
}
} else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Task)) {
MTask task = new MTask(Env.getCtx(), recordId, null);
if (!Env.getLoginLanguage(Env.getCtx()).isBaseLanguage()) {
nameMsg = task.get_Translation("Name");
if (task != null && nameMsg != null
&& nameMsg.length() != 0) {
sb.append("<br><br>\n<b>" + nameMsg + "</b>");
descMsg = task.get_Translation("Description");
if (descMsg != null && descMsg.length() != 0)
sb.append("<br><br>\n<i>" + descMsg + "</i>");
helpMsg = task.get_Translation("Help");
if (helpMsg != null && helpMsg.length() != 0)
sb.append("<br><br>\n" + helpMsg);
}
} else {
if (task != null && task.getName() != null
&& task.getName().length() != 0) {
sb.append("<br><br>\n<b>" + task.getName() + "</b>");
if (task.getDescription() != null
&& task.getDescription().length() != 0)
sb.append("<br><br>\n<i>" + task.getDescription()
+ "</i>");
if (task.getHelp() != null
&& task.getHelp().length() != 0)
sb.append("<br><br>\n" + task.getHelp());
}
}
} else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Node)) {
MWFNode node = new MWFNode(Env.getCtx(), recordId, null);
if (!Env.getLoginLanguage(Env.getCtx()).isBaseLanguage()) {
nameMsg = node.get_Translation("Name");
if (node != null && nameMsg != null
&& nameMsg.length() != 0) {
sb.append("<br><br>\n<b>" + nameMsg + "</b>");
descMsg = node.get_Translation("Description");
if (descMsg != null && descMsg.length() != 0)
sb.append("<br><br>\n<i>" + descMsg + "</i>");
helpMsg = node.get_Translation("Help");
if (helpMsg != null && helpMsg.length() != 0)
sb.append("<br><br>\n" + helpMsg);
}
} else {
if (node != null && node.getName() != null
&& node.getName().length() != 0) {
sb.append("<br><br>\n<b>" + node.getName() + "</b>");
if (node.getDescription() != null
&& node.getDescription().length() != 0)
sb.append("<br><br>\n<i>" + node.getDescription()
+ "</i>");
if (node.getHelp() != null
&& node.getHelp().length() != 0)
sb.append("<br><br>\n" + node.getHelp());
}
}
}
}
sb.append("</div>\n</body>\n</html>");
@ -519,6 +585,7 @@ public class HelpController
finally
{
DB.close(rs, pstmt);
rs=null; pstmt=null;
}
}