IDEMPIERE-2389:Print format and Report type selection on process dialog

message when finish process is don't change
This commit is contained in:
hieplq 2015-04-10 19:06:31 +07:00
parent 58254de9a4
commit d959dbff8f
2 changed files with 29 additions and 28 deletions

View File

@ -121,7 +121,6 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
private BusyDialog progressWindow; private BusyDialog progressWindow;
private String m_Name = null; private String m_Name = null;
private StringBuffer m_messageText = new StringBuffer();
private String m_ShowHelp = null; // Determine if a Help Process Window is shown private String m_ShowHelp = null; // Determine if a Help Process Window is shown
private String initialMessage; private String initialMessage;
@ -178,23 +177,26 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
if (trl) if (trl)
pstmt.setString(2, Env.getAD_Language(m_ctx)); pstmt.setString(2, Env.getAD_Language(m_ctx));
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
StringBuilder buildMsg = new StringBuilder();
if (rs.next()) if (rs.next())
{ {
m_Name = rs.getString(1); m_Name = rs.getString(1);
m_ShowHelp = rs.getString(5); m_ShowHelp = rs.getString(5);
// //
m_messageText.append("<b>"); buildMsg.append("<b>");
String s = rs.getString(2); // Description String s = rs.getString(2); // Description
if (rs.wasNull()) if (rs.wasNull())
m_messageText.append(Msg.getMsg(m_ctx, "StartProcess?")); buildMsg.append(Msg.getMsg(m_ctx, "StartProcess?"));
else else
m_messageText.append(s); buildMsg.append(s);
m_messageText.append("</b>"); buildMsg.append("</b>");
s = rs.getString(3); // Help s = rs.getString(3); // Help
if (!rs.wasNull()) if (!rs.wasNull())
m_messageText.append("<p>").append(s).append("</p>"); buildMsg.append("<p>").append(s).append("</p>");
} }
initialMessage = buildMsg.toString();
} }
catch (SQLException e) catch (SQLException e)
{ {
@ -210,7 +212,6 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
return false; return false;
// //
this.setTitle(m_Name); this.setTitle(m_Name);
initialMessage = m_messageText.toString();
// Move from APanel.actionButton // Move from APanel.actionButton
if (m_pi == null) if (m_pi == null)
@ -282,7 +283,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
protected void topLayout(HtmlBasedComponent topParameterLayout) { protected void topLayout(HtmlBasedComponent topParameterLayout) {
// message // message
setHeadMessage (topParameterLayout, getMessageText().toString()); setHeadMessage (topParameterLayout, initialMessage);
// input component // input component
HtmlBasedComponent inputParameterLayout = new Div(); HtmlBasedComponent inputParameterLayout = new Div();
@ -301,12 +302,15 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
// header content // header content
HtmlBasedComponent messageDiv = new Div(); HtmlBasedComponent messageDiv = new Div();
Html content = new Html(contentMsg); Html content = new Html();
if (contentMsg != null){
content.setContent(contentMsg);
}
messageDiv.appendChild(content); messageDiv.appendChild(content);
messageDiv.setSclass("message-paramenter"); messageDiv.setSclass("message-paramenter");
messageParameterLayout.appendChild(messageDiv); messageParameterLayout.appendChild(messageDiv);
return messageParameterLayout; return content;
} }
protected void inputParameterLayout (HtmlBasedComponent parent) { protected void inputParameterLayout (HtmlBasedComponent parent) {
@ -1003,16 +1007,6 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
return m_Name; return m_Name;
} }
public StringBuffer getMessageText()
{
return m_messageText;
}
public void setMessageText(StringBuffer messageText)
{
this.m_messageText = messageText;
}
public String getShowHelp() public String getShowHelp()
{ {
return m_ShowHelp; return m_ShowHelp;

View File

@ -256,13 +256,18 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
protected void swithToFinishScreen() { protected void swithToFinishScreen() {
ProcessInfo pi = getProcessInfo(); ProcessInfo pi = getProcessInfo();
ProcessInfoUtil.setLogFromDB(pi); ProcessInfoUtil.setLogFromDB(pi);
getMessageText().append("<p><font color=\"").append(pi.isError() ? "#FF0000" : "#0000FF").append("\">** ")
.append(pi.getSummary())
.append("</font></p>");
layoutResultPanel (topParameterLayout); layoutResultPanel (topParameterLayout);
StringBuilder buildMsg = new StringBuilder(getInitialMessage());
buildMsg.append("<p><font color=\"").append(pi.isError() ? "#FF0000" : "#0000FF").append("\">** ")
.append(pi.getSummary())
.append("</font></p>");
((Html)messageResultContent).setContent (buildMsg.toString());
// Add Log info with zoom on record id // Add Log info with zoom on record id
infoResultContent.getChildren().removeAll(infoResultContent.getChildren());
appendRecordLogInfo(pi.getLogs(), infoResultContent); appendRecordLogInfo(pi.getLogs(), infoResultContent);
bOK.setLabel(Msg.getMsg(Env.getCtx(), "Parameter")); bOK.setLabel(Msg.getMsg(Env.getCtx(), "Parameter"));
@ -287,7 +292,7 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
resultPanelLayout.setSclass("result-parameter-layout"); resultPanelLayout.setSclass("result-parameter-layout");
resultPanelLayout.setVflex("true"); resultPanelLayout.setVflex("true");
// reference for update late // reference for update late
messageResultContent = setHeadMessage(resultPanelLayout, getMessageText().toString()); messageResultContent = setHeadMessage(resultPanelLayout, null);
infoResultContent = new Div(); infoResultContent = new Div();
resultPanelLayout.appendChild(infoResultContent); resultPanelLayout.appendChild(infoResultContent);
@ -448,8 +453,9 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
@Override @Override
public void onCallback(Boolean result) { public void onCallback(Boolean result) {
if (result) { if (result) {
getMessageText().append("<p>").append(Msg.getMsg(Env.getCtx(), "PrintShipments")).append("</p>"); StringBuilder buildMsg = new StringBuilder(((Html)messageResultContent).getContent());
((Html)messageResultContent).setContent(getMessageText().toString()); buildMsg.append("<p>").append(Msg.getMsg(Env.getCtx(), "PrintShipments")).append("</p>");
((Html)messageResultContent).setContent(buildMsg.toString());
showBusyDialog(); showBusyDialog();
Clients.response(new AuEcho(ProcessDialog.this, "onPrintShipments", null)); Clients.response(new AuEcho(ProcessDialog.this, "onPrintShipments", null));
} }
@ -532,8 +538,9 @@ public class ProcessDialog extends AbstractProcessDialog implements EventListene
{ {
if (result) if (result)
{ {
getMessageText().append("<p>").append(Msg.getMsg(Env.getCtx(), "PrintInvoices")).append("</p>"); StringBuilder buildMsg = new StringBuilder(((Html)messageResultContent).getContent());
((Html)messageResultContent).setContent(getMessageText().toString()); buildMsg.append("<p>").append(Msg.getMsg(Env.getCtx(), "PrintInvoices")).append("</p>");
((Html)messageResultContent).setContent(buildMsg.toString());
showBusyDialog(); showBusyDialog();
Clients.response(new AuEcho(ProcessDialog.this, "onPrintInvoices", null)); Clients.response(new AuEcho(ProcessDialog.this, "onPrintInvoices", null));
} }