diff --git a/org.adempiere.base/src/org/compiere/model/MUserQuery.java b/org.adempiere.base/src/org/compiere/model/MUserQuery.java index 9873114a04..be66cd9ba9 100644 --- a/org.adempiere.base/src/org/compiere/model/MUserQuery.java +++ b/org.adempiere.base/src/org/compiere/model/MUserQuery.java @@ -331,7 +331,7 @@ public class MUserQuery extends X_AD_UserQuery } /** - * Returns true if the current user can save the query privately + * Returns true if the current user can save the query privately and is not a SQL Query * @return */ public boolean userCanSave() { @@ -340,12 +340,12 @@ public class MUserQuery extends X_AD_UserQuery get_Value(COLUMNNAME_AD_User_ID) == null) //Cannot save privately (user-specific) an already existing global query return false; - return true; + return !getCode().startsWith("@SQL="); } /** * Returns true if the current users has permission - * to share or modify the query globally + * to share or modify the query globally and is not a SQL Query * @return */ public boolean userCanShare() { @@ -353,7 +353,7 @@ public class MUserQuery extends X_AD_UserQuery getAD_Client_ID() != Env.getAD_Client_ID(Env.getCtx())) //Cannot modify a query from another client (e.g. System) return false; - return true; + return !getCode().startsWith("@SQL="); } /** Set User/Contact. diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 73e50ba888..eefce8da4a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -286,7 +286,7 @@ public class FindWindow extends Window implements EventListener, ValueCha /** IDEMPIERE-2836 User Query Where */ private String m_whereUserQuery; - /** Toolbar for avdance search tab. North of {@link #winAdvanced}. */ + /** Toolbar for advance search tab. North of {@link #winAdvanced}. */ private ToolBar advancedPanelToolBar; /**IDEMPIERE-4085*/ @@ -634,7 +634,6 @@ public class FindWindow extends Window implements EventListener, ValueCha listhead.appendChild(lstHQueryTo); listhead.appendChild(lstHRightBracket); advancedPanel.appendChild(listhead); - ZKUpdateUtil.setVflex(advancedPanel, true); Borderlayout layout = new Borderlayout(); ZKUpdateUtil.setHflex(layout, "1"); @@ -1724,18 +1723,7 @@ public class FindWindow extends Window implements EventListener, ValueCha fQueryName.setReadonly(false); } msgLabel.setText(""); - - if(index == 0) - { // no query - wipe and start over. - List rowList = advancedPanel.getChildren(); - for (int rowIndex = rowList.size() - 1; rowIndex >= 1; rowIndex--) - rowList.remove(rowIndex); - createFields(); - } - else - { - parseUserQuery(userQueries[index-1]); - } + onSelectedQueryChanged(); } else if (event.getTarget() instanceof Combobox) { @@ -3567,6 +3555,7 @@ public class FindWindow extends Window implements EventListener, ValueCha private void showAdvanced() { advancedPanelToolBar.setVisible(true); advancedPanel.setVisible(true); + winAdvanced.invalidate(); } /**