Merge 5274282ae85c

This commit is contained in:
Heng Sin Low 2013-02-14 00:10:56 +08:00
commit 5c1765a76f
5 changed files with 30 additions and 23 deletions

View File

@ -99,7 +99,7 @@ public class LoginPanel extends Window implements EventListener<Event>
/** /**
* *
*/ */
private static final long serialVersionUID = -3181808670168474967L; private static final long serialVersionUID = -9091534075824025355L;
private static LogAuthFailure logAuthFailure = new LogAuthFailure(); private static LogAuthFailure logAuthFailure = new LogAuthFailure();
@ -117,6 +117,7 @@ public class LoginPanel extends Window implements EventListener<Event>
private Checkbox chkRememberMe; private Checkbox chkRememberMe;
private Checkbox chkSelectRole; private Checkbox chkSelectRole;
private ToolBarButton btnResetPassword; private ToolBarButton btnResetPassword;
private ConfirmPanel pnlButtons;
boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false); boolean email_login = MSysConfig.getBooleanValue(MSysConfig.USE_EMAIL_FOR_LOGIN, false);
public LoginPanel(Properties ctx, LoginWindow loginWindow) public LoginPanel(Properties ctx, LoginWindow loginWindow)
@ -241,7 +242,7 @@ public class LoginPanel extends Window implements EventListener<Event>
div = new Div(); div = new Div();
div.setSclass(ITheme.LOGIN_BOX_FOOTER_CLASS); div.setSclass(ITheme.LOGIN_BOX_FOOTER_CLASS);
ConfirmPanel pnlButtons = new ConfirmPanel(false, false, false, false, false, false, true); pnlButtons = new ConfirmPanel(false, false, false, false, false, false, true);
pnlButtons.addActionListener(this); pnlButtons.addActionListener(this);
Button okBtn = pnlButtons.getButton(ConfirmPanel.A_OK); Button okBtn = pnlButtons.getButton(ConfirmPanel.A_OK);
okBtn.setWidgetListener("onClick", "zAu.cmd0.showBusy(null)"); okBtn.setWidgetListener("onClick", "zAu.cmd0.showBusy(null)");
@ -303,6 +304,19 @@ public class LoginPanel extends Window implements EventListener<Event>
} }
} }
}); });
// Make the default language the language of client System
String defaultLanguage = MClient.get(ctx, 0).getAD_Language();
for(int i = 0; i < lstLanguage.getItemCount(); i++)
{
Comboitem li = lstLanguage.getItemAtIndex(i);
if (li.getValue().equals(defaultLanguage))
{
lstLanguage.setSelectedIndex(i);
languageChanged(li.getLabel());
break;
}
}
} }
private void initComponents() private void initComponents()
@ -362,19 +376,6 @@ public class LoginPanel extends Window implements EventListener<Event>
btnResetPassword = new ToolBarButton(Msg.getMsg(Language.getBaseAD_Language(), "ForgotMyPassword")); btnResetPassword = new ToolBarButton(Msg.getMsg(Language.getBaseAD_Language(), "ForgotMyPassword"));
btnResetPassword.setId("btnResetPassword"); btnResetPassword.setId("btnResetPassword");
// Make the default language the language of client System
String defaultLanguage = MClient.get(ctx, 0).getAD_Language();
for(int i = 0; i < lstLanguage.getItemCount(); i++)
{
Comboitem li = lstLanguage.getItemAtIndex(i);
if (li.getValue().equals(defaultLanguage))
{
lstLanguage.setSelectedIndex(i);
languageChanged(li.getLabel());
break;
}
}
} }
public void onEvent(Event event) public void onEvent(Event event)
@ -423,7 +424,11 @@ public class LoginPanel extends Window implements EventListener<Event>
} }
private void openLoginHelp() { private void openLoginHelp() {
String helpURL = MSysConfig.getValue("LOGIN_HELP_URL", "http://wiki.idempiere.org/wiki/Login_Help"); String langName = (String) lstLanguage.getSelectedItem().getValue();
langName = langName.substring(0, 2);
String helpURL = MSysConfig.getValue("LOGIN_HELP_URL", "http://wiki.idempiere.org/{lang}/Login_Help");
if (helpURL.contains("{lang}"))
helpURL = Util.replace(helpURL, "{lang}", langName);
try { try {
Executions.getCurrent().sendRedirect(helpURL, "_blank"); Executions.getCurrent().sendRedirect(helpURL, "_blank");
} }
@ -484,6 +489,8 @@ public class LoginPanel extends Window implements EventListener<Event>
chkRememberMe.setLabel(Msg.getMsg(language, "RememberMe")); chkRememberMe.setLabel(Msg.getMsg(language, "RememberMe"));
chkSelectRole.setLabel(Msg.getMsg(language, "SelectRole")); chkSelectRole.setLabel(Msg.getMsg(language, "SelectRole"));
btnResetPassword.setLabel(Msg.getMsg(language, "ForgotMyPassword")); btnResetPassword.setLabel(Msg.getMsg(language, "ForgotMyPassword"));
pnlButtons.getButton(ConfirmPanel.A_OK).setLabel(Util.cleanAmp(Msg.getMsg(language, ConfirmPanel.A_OK)));
pnlButtons.getButton(ConfirmPanel.A_HELP).setLabel(Util.cleanAmp(Msg.getMsg(language, ConfirmPanel.A_HELP)));
} }
private Language findLanguage(String langName) { private Language findLanguage(String langName) {

View File

@ -9,7 +9,7 @@ Copyright (C) 2009 Idalica Corporation
<?component name="loginLinks" inline="true" macroURI="login-links.zul"?> <?component name="loginLinks" inline="true" macroURI="login-links.zul"?>
<div> <div>
<vendorLogo/> <vendorLogo/>
<loginInfo if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.localName.startsWith(&quot;demo.&quot;)}"/> <loginInfo if="${desktop.execution.serverName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.serverName.startsWith(&quot;demo.&quot;)}"/>
<versionInfo/> <versionInfo/>
<loginLinks/> <loginLinks/>
</div> </div>

View File

@ -15,7 +15,7 @@ Copyright (C) 2009 Idalica Corporation
} }
</style> </style>
<div class="loginLinksBox" if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.localName.startsWith(&quot;demo.&quot;)}" <div class="loginLinksBox" if="${desktop.execution.serverName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.serverName.startsWith(&quot;demo.&quot;)}"
style="position: absolute; bottom: 5px;"> style="position: absolute; bottom: 5px;">
<toolbarbutton href="http://www.zkoss.org" image="http://www.zkoss.org/img/zkpowered_s.png" <toolbarbutton href="http://www.zkoss.org" image="http://www.zkoss.org/img/zkpowered_s.png"
@ -29,7 +29,7 @@ Copyright (C) 2009 Idalica Corporation
tooltiptext="iDempiere Community" style="height:32px; width:32px" target="_blank"/> tooltiptext="iDempiere Community" style="height:32px; width:32px" target="_blank"/>
</div> </div>
<zscript if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.localName.startsWith(&quot;demo.&quot;)}"> <zscript if="${desktop.execution.serverName == &quot;ip-10-8-0-1.ec2.internal&quot; or desktop.execution.serverName.startsWith(&quot;demo.&quot;)}">
<![CDATA[ <![CDATA[
getFirefox.setHref("http://www.mozilla.com/?from=sfx&uid=0&t=306"); getFirefox.setHref("http://www.mozilla.com/?from=sfx&uid=0&t=306");
]]> ]]>

View File

@ -6,7 +6,7 @@ Copyright (C) 2009 Idalica Corporation
<zk> <zk>
<div style="background-color: #E5E5E5; margin: 5px;" <div style="background-color: #E5E5E5; margin: 5px;"
if="${desktop.execution.localName == &quot;ip-10-8-0-1.ec2.internal&quot;}"> if="${desktop.execution.serverName == &quot;ip-10-8-0-1.ec2.internal&quot;}">
<hbox align="center"> <hbox align="center">
<toolbarbutton <toolbarbutton
href="http://www.idalica.com" image="http://www.testadempiere.com/images/Idalica_Logo-grey-sm.png" target="_blank"/> href="http://www.idalica.com" image="http://www.testadempiere.com/images/Idalica_Logo-grey-sm.png" target="_blank"/>
@ -15,7 +15,7 @@ Copyright (C) 2009 Idalica Corporation
</hbox> </hbox>
</div> </div>
<div style="background-color: #E5E5E5; margin: 5px;" <div style="background-color: #E5E5E5; margin: 5px;"
if="${desktop.execution.localName.startsWith(&quot;demo.&quot;)}"> if="${desktop.execution.serverName.startsWith(&quot;demo.&quot;)}">
<hbox align="center"> <hbox align="center">
<toolbarbutton <toolbarbutton
href="http://www.idempiere.org" image="http://www.idempiere.org/_/rsrc/1341897488671/config/customLogo.gif?revision=2" target="_blank"/> href="http://www.idempiere.org" image="http://www.idempiere.org/_/rsrc/1341897488671/config/customLogo.gif?revision=2" target="_blank"/>
@ -23,7 +23,7 @@ Copyright (C) 2009 Idalica Corporation
style="font-family:Arial,sans-serif; color:#578BB8; font-size:1.5em; font-weight: bold;" /> style="font-family:Arial,sans-serif; color:#578BB8; font-size:1.5em; font-weight: bold;" />
</hbox> </hbox>
</div> </div>
<div style="height: 90px" if="${desktop.execution.localName != &quot;ip-10-8-0-1.ec2.internal&quot; and ! desktop.execution.localName.startsWith(&quot;demo.&quot;)}"> <div style="height: 90px" if="${desktop.execution.serverName != &quot;ip-10-8-0-1.ec2.internal&quot; and ! desktop.execution.serverName.startsWith(&quot;demo.&quot;)}">
<space/> <space/>
</div> </div>

View File

@ -55,7 +55,7 @@ Copyright (C) 2009 Idalica Corporation
<tr> <tr>
<td align="right">Host</td> <td align="right">Host</td>
<td>:</td> <td>:</td>
<td aligh="left">${desktop.execution.localName}</td> <td aligh="left">${desktop.execution.serverName}</td>
</tr> </tr>
</table> </table>
</div> </div>