From afca73d7b86dbb89e4d3767790bc409fddafce98 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Tue, 15 Jul 2014 15:10:52 -0500 Subject: [PATCH 1/4] IDEMPIERE-1673 In new state of record. click to print and export throws exception --- .../webui/adwindow/ADWindowToolbar.java | 20 +++++++++++++++++++ .../adwindow/AbstractADWindowContent.java | 19 ++++++++++-------- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java index ea8278f2c8..588dcb64e0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java @@ -523,6 +523,26 @@ public class ADWindowToolbar extends FToolbar implements EventListener { btnCustomize.setDisabled(!enabled); } + + public void enableArchive(boolean enabled) + { + btnArchive.setDisabled(!enabled); + } + + public void enableZoomAcross(boolean enabled) + { + btnZoomAcross.setDisabled(!enabled); + } + + public void enableActiveWorkflows(boolean enabled) + { + btnActiveWorkflows.setDisabled(!enabled); + } + + public void enableRequests(boolean enabled) + { + btnRequests.setDisabled(!enabled); + } public void lock(boolean locked) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index cb8e9d9f1a..dde8406f73 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -1081,7 +1081,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { ADTabpanel adtab = (ADTabpanel) event.getTarget(); if (adtab == adTabbox.getSelectedTabpanel()) { - toolbar.enableProcessButton(adtab.getToolbarButtons().size() > 0); + toolbar.enableProcessButton(adtab.getToolbarButtons().size() > 0 && !adTabbox.getSelectedGridTab().isNew()); toolbar.dynamicDisplay(); } } @@ -1271,7 +1271,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements toolbar.lock(adTabbox.getSelectedGridTab().isLocked()); } - toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted()); + toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !adTabbox.getSelectedGridTab().isNew()); //Deepak-Enabling customize button IDEMPIERE-364 if(!(adTabbox.getSelectedTabpanel() instanceof ADSortTab)) @@ -1596,8 +1596,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements adTabbox.evaluate(e); } - toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !adTabbox.getSelectedGridTab().isNew()); - toolbar.enableReport(true); + boolean isNewRow = adTabbox.getSelectedGridTab().getRowCount() == 0 || adTabbox.getSelectedGridTab().isNew(); + toolbar.enableProcessButton(!isNewRow); + toolbar.enableArchive(!isNewRow); + toolbar.enableZoomAcross(!isNewRow); + toolbar.enableActiveWorkflows(!isNewRow); + toolbar.enableRequests(!isNewRow); + + toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !isNewRow); + toolbar.enableReport(!isNewRow); toolbar.enableExport(!adTabbox.getSelectedGridTab().isSortTab()); toolbar.enableFileImport(!changed && !adTabbox.getSelectedGridTab().isSortTab() && adTabbox.getSelectedGridTab().isInsertRecord()); @@ -1741,8 +1748,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements breadCrumb.enableLastNavigation(adTabbox.getSelectedGridTab().getCurrentRow() + 1 < adTabbox.getSelectedGridTab().getRowCount()); toolbar.enableTabNavigation(breadCrumb.hasParentLink(), adTabbox.getSelectedDetailADTabpanel() != null); toolbar.enableIgnore(true); - toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted()); - toolbar.enableReport(true); if (adTabbox.getSelectedGridTab().isSingleRow()) { if (adTabbox.getSelectedTabpanel().isGridView()) @@ -1789,8 +1794,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements breadCrumb.enableLastNavigation(adTabbox.getSelectedGridTab().getCurrentRow() + 1 < adTabbox.getSelectedGridTab().getRowCount()); toolbar.enableTabNavigation(false); toolbar.enableIgnore(true); - toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted()); - toolbar.enableReport(true); } else { From 579d32869b1dbe4747ca37269c558b01495adb07 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Fri, 11 Jul 2014 12:51:46 +0800 Subject: [PATCH 2/4] IDEMPIERE-724 Ticket #1004142: Null Data error --- .../src/org/adempiere/webui/theme/ThemeManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/theme/ThemeManager.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/theme/ThemeManager.java index 7912eaaa8c..5d601bb591 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/theme/ThemeManager.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/theme/ThemeManager.java @@ -118,8 +118,11 @@ public final class ThemeManager { public static org.zkoss.image.Image getClientWebLogo() throws IOException { MClientInfo cinfo = MClientInfo.get(Env.getCtx()); if (cinfo.getLogoWeb_ID() > 0) { - MImage mImage = MImage.get(Env.getCtx(), cinfo.getLogoWeb_ID()); - return new AImage(mImage.getName(), mImage.getData()); + MImage mImage = MImage.get(Env.getCtx(), cinfo.getLogoWeb_ID()); + if (mImage.getData() != null) + return new AImage(mImage.getName(), mImage.getData()); + else + return null; /* Using different approach: ImageEncoder supports only PNG and JPEG Image image = mImage.getImage(); From 97e5b51a4c3bfd7e52b298586282bda46950bbd0 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 14 Jul 2014 14:00:00 +0800 Subject: [PATCH 3/4] 1004128 IDEMPIERE-775 Documents without C_DocType_ID cannot be distributed directly. Implement suggestion from Carlos - special handling of the 7 tables in the Doc.getC_DocType_ID method. --- .../src/org/compiere/acct/Doc.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc.java b/org.adempiere.base/src/org/compiere/acct/Doc.java index b977607849..17937087a3 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc.java @@ -28,6 +28,13 @@ import java.util.Iterator; import java.util.Properties; import java.util.logging.Level; +import org.compiere.model.I_C_AllocationHdr; +import org.compiere.model.I_C_BankStatement; +import org.compiere.model.I_C_Cash; +import org.compiere.model.I_C_ProjectIssue; +import org.compiere.model.I_M_MatchInv; +import org.compiere.model.I_M_MatchPO; +import org.compiere.model.I_M_Production; import org.compiere.model.MAccount; import org.compiere.model.MAcctSchema; import org.compiere.model.MConversionRate; @@ -122,6 +129,8 @@ public abstract class Doc * M_Requisition POR **************************************************************************/ + private static final String DOC_TYPE_BY_DOC_BASE_TYPE_SQL = "SELECT C_DocType_ID FROM C_DocType WHERE AD_Client_ID=? AND DocBaseType=? AND IsActive='Y'"; + /** AR Invoices - ARI */ public static final String DOCTYPE_ARInvoice = MDocType.DOCBASETYPE_ARInvoice; /** AR Credit Memo */ @@ -1729,6 +1738,58 @@ public abstract class Doc if (ii != null) return ii.intValue(); } + else + { + if (p_po.get_TableName().equals(I_M_MatchPO.Table_Name)) + { + int docTypeId = DB.getSQLValue((String)null, DOC_TYPE_BY_DOC_BASE_TYPE_SQL, + p_po.getAD_Client_ID(), Doc.DOCTYPE_MatMatchPO); + if (docTypeId > 0) + return docTypeId; + } + else if (p_po.get_TableName().equals(I_M_MatchInv.Table_Name)) + { + int docTypeId = DB.getSQLValue((String)null, DOC_TYPE_BY_DOC_BASE_TYPE_SQL, + p_po.getAD_Client_ID(), Doc.DOCTYPE_MatMatchInv); + if (docTypeId > 0) + return docTypeId; + } + else if (p_po.get_TableName().equals(I_C_AllocationHdr.Table_Name)) + { + int docTypeId = DB.getSQLValue((String)null, DOC_TYPE_BY_DOC_BASE_TYPE_SQL, + p_po.getAD_Client_ID(), Doc.DOCTYPE_Allocation); + if (docTypeId > 0) + return docTypeId; + } + else if (p_po.get_TableName().equals(I_C_BankStatement.Table_Name)) + { + int docTypeId = DB.getSQLValue((String)null, DOC_TYPE_BY_DOC_BASE_TYPE_SQL, + p_po.getAD_Client_ID(), Doc.DOCTYPE_BankStatement); + if (docTypeId > 0) + return docTypeId; + } + else if (p_po.get_TableName().equals(I_C_Cash.Table_Name)) + { + int docTypeId = DB.getSQLValue((String)null, DOC_TYPE_BY_DOC_BASE_TYPE_SQL, + p_po.getAD_Client_ID(), Doc.DOCTYPE_CashJournal); + if (docTypeId > 0) + return docTypeId; + } + else if (p_po.get_TableName().equals(I_C_ProjectIssue.Table_Name)) + { + int docTypeId = DB.getSQLValue((String)null, DOC_TYPE_BY_DOC_BASE_TYPE_SQL, + p_po.getAD_Client_ID(), Doc.DOCTYPE_ProjectIssue); + if (docTypeId > 0) + return docTypeId; + } + else if (p_po.get_TableName().equals(I_M_Production.Table_Name)) + { + int docTypeId = DB.getSQLValue((String)null, DOC_TYPE_BY_DOC_BASE_TYPE_SQL, + p_po.getAD_Client_ID(), Doc.DOCTYPE_MatProduction); + if (docTypeId > 0) + return docTypeId; + } + } return 0; } // getC_DocType_ID From d9ae654c16a96cb94b366a2ab9ed396f16bd5568 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 14 Jul 2014 19:09:45 +0800 Subject: [PATCH 4/4] 1004150 Process modal dialog: no scrollbar when content overflow. --- .../src/org/adempiere/webui/apps/ProcessModalDialog.java | 1 + .../src/org/adempiere/webui/apps/ProcessParameterPanel.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java index d6fb4c02af..1481119c83 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java @@ -169,6 +169,7 @@ public class ProcessModalDialog extends Window implements EventListener, dialogContent.setHflex("1"); dialogContent.setVflex("1"); dialogContent.setSclass("dialog-content"); + dialogContent.setStyle("overflow-y: auto;"); dialogBody.appendChild(dialogContent); Div div = new Div(); div.setId("message"); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java index f35e59bffd..7932634e02 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java @@ -731,6 +731,9 @@ public class ProcessParameterPanel extends Panel implements editor.setMandatory(mField.isMandatory(true)); editor.updateLabelStyle(); } + if (getParent() != null) { + getParent().invalidate(); + } } /**