Merge b2dfae19b6ee

This commit is contained in:
Heng Sin Low 2013-08-29 11:26:58 +08:00
commit eaf65447cf
4 changed files with 45 additions and 8 deletions

View File

@ -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
;

View File

@ -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
;

View File

@ -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<Event>, 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<Event>, 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<Event>, 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<Event>, 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<Integer>() {
@Override
public void onCallback(Integer result) {
Events.echoEvent(new Event(ON_DEFER_LOGOUT, component));
}
});
return;
}
wndLogin.loginCompleted();

View File

@ -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<Event>, ValueCha
editor.setReadWrite(enabled);
editor.setVisible(enabled);
editor.dynamicDisplay();
if (editor instanceof WPaymentEditor) {
((WPaymentEditor)editor).getComponent().setEnabled(true, false);
}
//
return editor.getComponent();