From 1237e22db71caaf34539bb5d211c1a1ebc79b5f6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 24 Oct 2017 20:46:26 +0200 Subject: [PATCH] IDEMPIERE-2334 (Allow zoom from URL) colliding with IDEMPIERE-3000 (Automatic opening of menu entries at login) - automatic opening must not happen when the URL is an Action URL --- .../webui/desktop/DefaultDesktop.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java index 98fe8529b7..2559ee5c0e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java @@ -24,6 +24,8 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import org.adempiere.base.event.EventManager; import org.adempiere.base.event.IEventManager; @@ -925,6 +927,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria return AD_Tree_ID; } private void automaticOpen(Properties ctx) { + if (isActionURL()) // IDEMPIERE-2334 vs IDEMPIERE-3000 - do not open windows when coming from an action URL + return; StringBuilder sql = new StringBuilder("SELECT m.Action, COALESCE(m.AD_Window_ID, m.AD_Process_ID, m.AD_Form_ID, m.AD_Workflow_ID, m.AD_Task_ID, AD_InfoWindow_ID) ") .append(" FROM AD_TreeBar tb") @@ -973,5 +977,17 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria } } } - } + } + + private boolean isActionURL() { + ConcurrentMap parameters = new ConcurrentHashMap(Executions.getCurrent().getParameterMap()); + String action = ""; + if (parameters != null) { + String[] strs = parameters.get("Action"); + if (strs != null && strs.length == 1 && strs[0] != null) + action = strs[0]; + } + return ! Util.isEmpty(action); + } + }