From 19cfc2d07d081b447bd9820f9f1d96fdacba6570 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud <58596990+nmicoud@users.noreply.github.com> Date: Sun, 11 Jul 2021 07:56:31 +0200 Subject: [PATCH] IDEMPIERE-4874 : Process customization must have effect on Menu and Tab title (#778) --- .../src/org/compiere/model/MTree.java | 16 +++++++-- .../webui/apps/AbstractProcessDialog.java | 33 ++++++++++++------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MTree.java b/org.adempiere.base/src/org/compiere/model/MTree.java index fb56945c4d..4c68c3d5bd 100644 --- a/org.adempiere.base/src/org/compiere/model/MTree.java +++ b/org.adempiere.base/src/org/compiere/model/MTree.java @@ -49,7 +49,7 @@ public class MTree extends MTree_Base /** * */ - private static final long serialVersionUID = -212066085945645584L; + private static final long serialVersionUID = 8572653421094006917L; /** * Default Constructor. @@ -604,8 +604,20 @@ public class MTree extends MTree_Base } } else if (X_AD_Menu.ACTION_Process.equals(actionColor) - || X_AD_Menu.ACTION_Report.equals(actionColor)) + || X_AD_Menu.ACTION_Report.equals(actionColor)) { access = role.getProcessAccess(AD_Process_ID); + + // Get ProcessCustomization + MUserDefProc userDef = null; + userDef = MUserDefProc.getBestMatch(getCtx(), AD_Process_ID); + if (userDef != null) + { + if (userDef.getName() != null) + name = userDef.getName(); + if (userDef.getDescription() != null) + description = userDef.getDescription(); + } + } else if (X_AD_Menu.ACTION_Form.equals(actionColor)) access = role.getFormAccess(AD_Form_ID); else if (X_AD_Menu.ACTION_WorkFlow.equals(actionColor)) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java index 318165fab3..69c89961bc 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java @@ -69,12 +69,13 @@ import org.compiere.model.MPInstance; import org.compiere.model.MPInstanceLog; import org.compiere.model.MPInstancePara; import org.compiere.model.MProcess; +import org.compiere.model.MReportView; import org.compiere.model.MRole; import org.compiere.model.MSysConfig; import org.compiere.model.MUser; +import org.compiere.model.MUserDefProc; import org.compiere.model.Query; import org.compiere.model.SystemIDs; -import org.compiere.model.MReportView; import org.compiere.print.MPrintFormat; import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfoUtil; @@ -108,7 +109,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI /** * */ - private static final long serialVersionUID = -9220870163215609274L; + private static final long serialVersionUID = -7374210834757533221L; private static final String ON_COMPLETE = "onComplete"; private static final String ON_STATUS_UPDATE = "onStatusUpdate"; @@ -128,6 +129,8 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI private BusyDialog progressWindow; private String m_Name = null; + private String m_Description = null; + private String m_Help = null; private String m_ShowHelp = null; // Determine if a Help Process Window is shown private String initialMessage; @@ -189,19 +192,27 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI if (rs.next()) { m_Name = rs.getString(1); + m_Description = rs.getString(2); + m_Help = rs.getString(3); m_ShowHelp = rs.getString(5); - // + + // User Customization + MUserDefProc userDef = MUserDefProc.getBestMatch(ctx, AD_Process_ID); + if (userDef != null) { + if (userDef.getName() != null) + m_Name = userDef.getName(); + if (userDef.getDescription() != null) + m_Description = userDef.getDescription(); + if (userDef.getHelp() != null) + m_Help = userDef.getHelp(); + } + buildMsg.append(""); - String s = rs.getString(2); // Description - if (rs.wasNull()) - buildMsg.append(Msg.getMsg(m_ctx, "StartProcess?")); - else - buildMsg.append(s); + buildMsg.append(Util.isEmpty(m_Description) ? Msg.getMsg(m_ctx, "StartProcess?") : m_Description); buildMsg.append(""); - s = rs.getString(3); // Help - if (!rs.wasNull()) - buildMsg.append("
").append(s).append("
"); + if (!Util.isEmpty(m_Help)) + buildMsg.append("").append(m_Help).append("
"); m_AD_Process_UU = rs.getString(6); }