diff --git a/migration/i1.0c-release/oracle/201308211400_IDEMPIERE-1290.sql b/migration/i1.0c-release/oracle/201308211400_IDEMPIERE-1290.sql new file mode 100644 index 0000000000..1a35b21a54 --- /dev/null +++ b/migration/i1.0c-release/oracle/201308211400_IDEMPIERE-1290.sql @@ -0,0 +1,7 @@ +-- Aug 21, 2013 1:44:20 PM COT +-- IDEMPIERE-1290 Can't see/select the Label Printer in the window Print Label +UPDATE AD_Column SET AD_Reference_ID=19,Updated=TO_DATE('2013-08-21 13:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=9875 +; + +SELECT register_migration_script('201308211400_IDEMPIERE-1290.sql') FROM dual +; diff --git a/migration/i1.0c-release/postgresql/201308211400_IDEMPIERE-1290.sql b/migration/i1.0c-release/postgresql/201308211400_IDEMPIERE-1290.sql new file mode 100644 index 0000000000..d123efe99a --- /dev/null +++ b/migration/i1.0c-release/postgresql/201308211400_IDEMPIERE-1290.sql @@ -0,0 +1,7 @@ +-- Aug 21, 2013 1:44:20 PM COT +-- IDEMPIERE-1290 Can't see/select the Label Printer in the window Print Label +UPDATE AD_Column SET AD_Reference_ID=19,Updated=TO_TIMESTAMP('2013-08-21 13:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=9875 +; + +SELECT register_migration_script('201308211400_IDEMPIERE-1290.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/RolePanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/RolePanel.java index aa3740c63d..4518af6ffb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/RolePanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/RolePanel.java @@ -26,6 +26,7 @@ package org.adempiere.webui.panel; import java.sql.Timestamp; import java.util.Properties; +import org.adempiere.util.Callback; import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.component.ComboItem; @@ -38,6 +39,7 @@ import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ITheme; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.util.UserPreference; +import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.LoginWindow; import org.compiere.model.MRole; import org.compiere.model.MSysConfig; @@ -47,6 +49,7 @@ import org.compiere.util.KeyNamePair; import org.compiere.util.Language; import org.compiere.util.Login; import org.compiere.util.Msg; +import org.compiere.util.Util; import org.zkoss.zhtml.Table; import org.zkoss.zhtml.Td; import org.zkoss.zhtml.Tr; @@ -97,7 +100,11 @@ public class RolePanel extends Window implements EventListener, Deferrabl protected boolean m_show = true; - public RolePanel(Properties ctx, LoginWindow loginWindow, String userName, boolean show, KeyNamePair[] clientsKNPairs) { + private RolePanel component; + + private static final String ON_DEFER_LOGOUT = "onDeferLogout"; + + public RolePanel(Properties ctx, LoginWindow loginWindow, String userName, boolean show, KeyNamePair[] clientsKNPairs) { this.wndLogin = loginWindow; m_ctx = ctx; m_userName = userName; @@ -349,6 +356,9 @@ public class RolePanel extends Window implements EventListener, Deferrabl } setUserID(); updateRoleList(); + + this.component = this; + component.addEventListener(ON_DEFER_LOGOUT, this); } private void updateRoleList() @@ -505,6 +515,11 @@ public class RolePanel extends Window implements EventListener, Deferrabl SessionManager.logoutSession(); wndLogin.loginCancelled(); } + else if (ON_DEFER_LOGOUT.equals(event.getName())) + { + SessionManager.logoutSession(); + wndLogin.loginCancelled(); + } } private void setUserID() { @@ -572,16 +587,20 @@ public class RolePanel extends Window implements EventListener, Deferrabl Timestamp date = (Timestamp)lstDate.getValue(); String msg = login.loadPreferences(orgKNPair, warehouseKNPair, date, null); - - if(!(msg == null || msg.length() == 0)) + if (Util.isEmpty(msg)) { - throw new WrongValueException(msg); + msg = login.validateLogin(orgKNPair); } - - msg = login.validateLogin(orgKNPair); - if (msg != null && msg.length() > 0) + if (! Util.isEmpty(msg)) { - throw new WrongValueException(msg); + Env.getCtx().clear(); + FDialog.error(0, this, "Error", msg, new Callback() { + @Override + public void onCallback(Integer result) { + Events.echoEvent(new Event(ON_DEFER_LOGOUT, component)); + } + }); + return; } wndLogin.loginCompleted(); 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 ddc830a773..b6a558974a 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 @@ -61,6 +61,7 @@ import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.Window; import org.adempiere.webui.editor.WEditor; import org.adempiere.webui.editor.WNumberEditor; +import org.adempiere.webui.editor.WPaymentEditor; import org.adempiere.webui.editor.WStringEditor; import org.adempiere.webui.editor.WTableDirEditor; import org.adempiere.webui.editor.WebEditorFactory; @@ -1707,6 +1708,9 @@ public class FindWindow extends Window implements EventListener, ValueCha editor.setReadWrite(enabled); editor.setVisible(enabled); editor.dynamicDisplay(); + if (editor instanceof WPaymentEditor) { + ((WPaymentEditor)editor).getComponent().setEnabled(true, false); + } // return editor.getComponent();