From fe3769cceb22dc5b017adc8711dd134b16b031e8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 22 Nov 2014 12:35:47 -0500 Subject: [PATCH 01/20] IDEMPIERE-2331 Add getGridWindow to GridTab --- org.adempiere.base/src/org/compiere/model/GridTab.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 6c7c5f846e..74ac2160b8 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -113,7 +113,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * */ - private static final long serialVersionUID = 1377113168185797983L; + private static final long serialVersionUID = 1151723870943569774L; public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate"; @@ -157,6 +157,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable // The window of this tab private GridWindow m_window; + public GridWindow getGridWindow() { + return m_window; + } + /** The Table Model for Query */ private GridTable m_mTable = null; From 50f5041015c701709395959fe7b32318ff8a084f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 24 Nov 2014 16:14:23 -0500 Subject: [PATCH 02/20] IDEMPIERE-2305 Cash/Check Payment button is ignoring amount entered / fix issue reversing a payment (and in general setting wrongly the docstatus when the document save fails) --- org.adempiere.base/src/org/compiere/model/MPayment.java | 2 -- org.adempiere.base/src/org/compiere/wf/MWFActivity.java | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index 7d7158835a..eaa222be18 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -660,8 +660,6 @@ public class MPayment extends X_C_Payment || is_ValueChanged(COLUMNNAME_C_Charge_ID) || is_ValueChanged(COLUMNNAME_C_Currency_ID) || is_ValueChanged(COLUMNNAME_C_DocType_ID) - || is_ValueChanged(COLUMNNAME_C_Invoice_ID) - || is_ValueChanged(COLUMNNAME_C_Order_ID) || is_ValueChanged(COLUMNNAME_DateAcct) || is_ValueChanged(COLUMNNAME_DateTrx) || is_ValueChanged(COLUMNNAME_DiscountAmt) diff --git a/org.adempiere.base/src/org/compiere/wf/MWFActivity.java b/org.adempiere.base/src/org/compiere/wf/MWFActivity.java index d38fc37c96..d6185dcac8 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFActivity.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFActivity.java @@ -1011,6 +1011,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable if (!m_po.save()) { success = false; + m_docStatus = null; processMsg = "SaveError"; } if (!success) From dbf4fe9fb88fe7df1fe67357ed778ed6be658fe5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 24 Nov 2014 22:36:58 -0500 Subject: [PATCH 03/20] IDEMPIERE-2334 Allow zoom from URL --- .../org/adempiere/webui/AdempiereWebUI.java | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 82bab4149d..c520599cdf 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -43,11 +43,13 @@ import org.compiere.model.MRole; import org.compiere.model.MSession; import org.compiere.model.MSysConfig; import org.compiere.model.MSystem; +import org.compiere.model.MTable; import org.compiere.model.MUser; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.Language; import org.compiere.util.Msg; +import org.compiere.util.Util; import org.zkforge.keylistener.Keylistener; import org.zkoss.web.Attributes; import org.zkoss.web.servlet.Servlets; @@ -77,7 +79,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb /** * */ - private static final long serialVersionUID = 5875869799688466929L; + private static final long serialVersionUID = -225993322049019137L; private static final String SAVED_CONTEXT = "saved.context"; @@ -275,9 +277,45 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb } Env.setContext(ctx, "#LocalHttpAddr", localHttpAddr.toString()); Clients.response(new AuScript("zAu.cmd0.clearBusy()")); + + processParameters(); } - /** + private void processParameters() { + String action = Executions.getCurrent().getParameter("Action"); + if (action != null && "Zoom".equalsIgnoreCase(action)) { + int tableID = 0; + try { + String prm = Executions.getCurrent().getParameter("AD_Table_ID"); + if (!Util.isEmpty(prm)) + tableID = Integer.parseInt(prm); + } catch (NumberFormatException e) { + // ignore + } + if (tableID == 0) { + String tableName = Executions.getCurrent().getParameter("TableName"); + if (!Util.isEmpty(tableName)) { + MTable table = MTable.get(Env.getCtx(), tableName); + if (table != null) { + tableID = table.getAD_Table_ID(); + } + } + } + int recordID = 0; + try { + String prm = Executions.getCurrent().getParameter("AD_Table_ID"); + if (!Util.isEmpty(prm)) + recordID = Integer.parseInt(prm); + } catch (NumberFormatException e) { + // ignore + } + if (tableID > 0) { + AEnv.zoom(tableID, recordID); + } + } + } + + /** * @return key listener */ @Override From dc6a84bd1f264e442571957bac2568d94a366dd7 Mon Sep 17 00:00:00 2001 From: Diego Ruiz Date: Mon, 24 Nov 2014 22:44:26 -0500 Subject: [PATCH 04/20] IDEMPIERE-2335 Popup a menu when a tab is right clicked with the options close, close all, and close others. --- .../adempiere/webui/part/WindowContainer.java | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/part/WindowContainer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/part/WindowContainer.java index e9d0ef2d0b..3c011dfbb1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/part/WindowContainer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/part/WindowContainer.java @@ -13,6 +13,9 @@ package org.adempiere.webui.part; +import java.util.List; + +import org.adempiere.webui.component.Menupopup; import org.adempiere.webui.component.Tab; import org.adempiere.webui.component.Tabbox; import org.adempiere.webui.component.Tabpanel; @@ -21,11 +24,14 @@ import org.adempiere.webui.component.Tabs; import org.adempiere.webui.panel.IHelpContext; import org.adempiere.webui.session.SessionManager; import org.compiere.model.X_AD_CtxHelp; +import org.compiere.util.Env; +import org.compiere.util.Msg; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.SwipeEvent; +import org.zkoss.zul.Menuitem; /** * @@ -128,7 +134,7 @@ public class WindowContainer extends AbstractUIPart */ public Tab insertBefore(Tab refTab, Component comp, String title, boolean closeable, boolean enable) { - Tab tab = new Tab(); + final Tab tab = new Tab(); if (title != null) { setTabTitle(title, tab); @@ -199,6 +205,63 @@ public class WindowContainer extends AbstractUIPart setSelectedTab(tab); } + Menupopup popupClose = new Menupopup(); + Menuitem mi; + if(tab.getIndex()!=0){ + mi = new Menuitem(Msg.getMsg(Env.getCtx(), "Close")); + popupClose.appendChild(mi); + mi.addEventListener(Events.ON_CLICK, new EventListener() { + public void onEvent(Event event) throws Exception { + int currentTabIndex = tab.getIndex(); + int tabsSizeBeforeClose = tabbox.getTabs().getChildren().size(); + + if ( tabsSizeBeforeClose == currentTabIndex + 1 ) { + currentTabIndex--; + } + if ( tab.getPreviousSibling() != null ) { + tab.onClose(); + // Update the current tab index. + if ( tabsSizeBeforeClose != tabbox.getTabs().getChildren().size() ) + tabbox.setSelectedIndex( currentTabIndex ); + } + } + }); + + mi = new Menuitem(Msg.getMsg(Env.getCtx(), "CloseOtherWindows")); + popupClose.appendChild(mi); + mi.addEventListener(Events.ON_CLICK, new EventListener() { + public void onEvent(Event event) throws Exception { + int focusTabIndex = 1; + List tabs = tabbox.getTabs().getChildren(); + for ( int i = tabs.size() - 1; i > 0; i-- ) { + if(!((Tab)tabs.get( i )).equals(tab)){ + ((Tab)tabs.get( i )).setSelected(false); + + ((Tab)tabs.get( i )).onClose(); + } + } + tabbox.setSelectedIndex(focusTabIndex); + } + }); + } + + mi = new Menuitem(Msg.getMsg(Env.getCtx(), "CloseAllWindows")); + mi.addEventListener(Events.ON_CLICK, new EventListener() { + public void onEvent(Event event) throws Exception { + int focusTabIndex = 0; + List tabs = tabbox.getTabs().getChildren(); + for ( int i = tabs.size() - 1; i > 0; i-- ) { + ((Tab)tabs.get( i )).setSelected(false); + ((Tab)tabs.get( i )).onClose(); + } + tabbox.setSelectedIndex( focusTabIndex ); + } + }); + popupClose.appendChild(mi); + popupClose.setWidth("auto"); + popupClose.setPage(tab.getPage()); + tab.setContext(popupClose); + return tab; } From ffee60df18ca0b6e57809ea3183dfebeaef44f2c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Nov 2014 11:11:43 -0500 Subject: [PATCH 05/20] IDEMPIERE-2334 Allow zoom from URL --- .../org/adempiere/webui/AdempiereWebUI.java | 57 ++++++++++++------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index c520599cdf..8f87fb91b3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -22,6 +22,8 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; @@ -79,7 +81,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb /** * */ - private static final long serialVersionUID = -225993322049019137L; + private static final long serialVersionUID = 8229814619282121621L; private static final String SAVED_CONTEXT = "saved.context"; @@ -109,12 +111,16 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb private static boolean eventThreadEnabled = false; + private static ConcurrentMap m_URLParameters; + public AdempiereWebUI() { this.addEventListener(Events.ON_CLIENT_INFO, this); this.setVisible(false); userPreference = new UserPreference(); + // preserve the original URL parameters as is destroyed later on loging + m_URLParameters = new ConcurrentHashMap(Executions.getCurrent().getParameterMap()); } public void onCreate() @@ -280,20 +286,13 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb processParameters(); } - + private void processParameters() { - String action = Executions.getCurrent().getParameter("Action"); - if (action != null && "Zoom".equalsIgnoreCase(action)) { - int tableID = 0; - try { - String prm = Executions.getCurrent().getParameter("AD_Table_ID"); - if (!Util.isEmpty(prm)) - tableID = Integer.parseInt(prm); - } catch (NumberFormatException e) { - // ignore - } + String action = getPrmString("Action"); + if ("Zoom".equalsIgnoreCase(action)) { + int tableID = getPrmInt("AD_Table_ID"); if (tableID == 0) { - String tableName = Executions.getCurrent().getParameter("TableName"); + String tableName = getPrmString("TableName"); if (!Util.isEmpty(tableName)) { MTable table = MTable.get(Env.getCtx(), tableName); if (table != null) { @@ -301,19 +300,33 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb } } } - int recordID = 0; - try { - String prm = Executions.getCurrent().getParameter("AD_Table_ID"); - if (!Util.isEmpty(prm)) - recordID = Integer.parseInt(prm); - } catch (NumberFormatException e) { - // ignore - } + int recordID = getPrmInt("Record_ID"); if (tableID > 0) { AEnv.zoom(tableID, recordID); } } - } + m_URLParameters = null; + } + + private String getPrmString(String prm) { + String retValue = ""; + String[] strs = m_URLParameters.get(prm); + if (strs != null && strs.length == 1 && strs[0] != null) + retValue = strs[0]; + return retValue; + } + + private int getPrmInt(String prm) { + int retValue = 0; + String str = getPrmString(prm); + try { + if (!Util.isEmpty(str)) + retValue = Integer.parseInt(str); + } catch (NumberFormatException e) { + // ignore + } + return retValue; + } /** * @return key listener From ff3366bea90e4b8f658054715a63fb78488a4793 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Nov 2014 11:19:18 -0500 Subject: [PATCH 06/20] IDEMPIERE-2318 Null pointer exception when Product has not Attribute set configured and costing level is batch / fix MovementLine cannot be saved --- .../src/org/compiere/model/MMovementLine.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MMovementLine.java b/org.adempiere.base/src/org/compiere/model/MMovementLine.java index fc6af5ec14..118dac29b3 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovementLine.java +++ b/org.adempiere.base/src/org/compiere/model/MMovementLine.java @@ -211,11 +211,11 @@ public class MMovementLine extends X_M_MovementLine // Mandatory Instance MProduct product = getProduct(); if (getM_AttributeSetInstance_ID() == 0) { - if (product != null && product.getAttributeSet()==null) { - log.saveError("NoAttributeSet", product.getValue()); - return false; - } if (product != null && product.isASIMandatory(true)) { + if (product.getAttributeSet()==null) { + log.saveError("NoAttributeSet", product.getValue()); + return false; + } if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, true /*outgoing*/)) { log.saveError("FillMandatory", Msg.getElement(getCtx(), COLUMNNAME_M_AttributeSetInstance_ID)); return false; @@ -231,12 +231,12 @@ public class MMovementLine extends X_M_MovementLine setM_AttributeSetInstanceTo_ID(getM_AttributeSetInstance_ID()); } - if (product != null && product.getAttributeSet()==null) { - log.saveError("NoAttributeSet", product.getValue()); - return false; - } if (product != null && product.isASIMandatory(false) && getM_AttributeSetInstanceTo_ID() == 0) { + if (product.getAttributeSet()==null) { + log.saveError("NoAttributeSet", product.getValue()); + return false; + } if (! product.getAttributeSet().excludeTableEntry(MMovementLine.Table_ID, false /*incoming*/)) { log.saveError("FillMandatory", Msg.getElement(getCtx(), COLUMNNAME_M_AttributeSetInstanceTo_ID)); return false; From 1e010fd93695ea52901333c85ccb9ca96081f110 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Nov 2014 11:46:16 -0500 Subject: [PATCH 07/20] IDEMPIERE-2340 zk - Exporting reports as SSV generates CSV --- .../report/jasper/ReportStarter.java | 7 +++++- .../webui/apps/form/WReportCustomization.java | 8 +++++- .../webui/panel/action/ReportAction.java | 8 +++++- .../adempiere/webui/window/ZkJRViewer.java | 25 ++++++++++++++++++- .../webui/window/ZkReportViewer.java | 8 +++++- 5 files changed, 51 insertions(+), 5 deletions(-) diff --git a/org.adempiere.report.jasper/src/org/adempiere/report/jasper/ReportStarter.java b/org.adempiere.report.jasper/src/org/adempiere/report/jasper/ReportStarter.java index d704ea1cde..0e3cd5f497 100644 --- a/org.adempiere.report.jasper/src/org/adempiere/report/jasper/ReportStarter.java +++ b/org.adempiere.report.jasper/src/org/adempiere/report/jasper/ReportStarter.java @@ -60,6 +60,7 @@ import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.design.JRDesignQuery; import net.sf.jasperreports.engine.design.JasperDesign; import net.sf.jasperreports.engine.export.JRCsvExporter; +import net.sf.jasperreports.engine.export.JRCsvExporterParameter; import net.sf.jasperreports.engine.export.JRHtmlExporter; import net.sf.jasperreports.engine.export.JRPdfExporter; import net.sf.jasperreports.engine.export.JRPrintServiceExporter; @@ -714,8 +715,12 @@ public class ReportStarter implements ProcessCall, ClientProcess exporter = new JRPrintServiceExporter(ljrContext); else if (ext.equals("xml")) exporter = new JRXmlExporter(ljrContext); - else if (ext.equals("csv") || ext.equals("ssv")) + else if (ext.equals("csv")) exporter = new JRCsvExporter(ljrContext); + else if (ext.equals("ssv")) { + exporter = new JRCsvExporter(ljrContext); + exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, ";"); + } else if (ext.equals("txt")) exporter = new JRTextExporter(ljrContext); else if (ext.equals("html") || ext.equals("htm")) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WReportCustomization.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WReportCustomization.java index d4f08a49ed..cf28bd4715 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WReportCustomization.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WReportCustomization.java @@ -468,12 +468,18 @@ public class WReportCustomization implements IFormController,EventListener re.createXML(sw); data = sw.getBuffer().toString().getBytes(); } - else if (ext.equals("csv") || ext.equals("ssv")) + else if (ext.equals("csv")) { StringWriter sw = new StringWriter(); re.createCSV(sw, ',', re.getPrintFormat().getLanguage()); data = sw.getBuffer().toString().getBytes(); } + else if (ext.equals("ssv")) + { + StringWriter sw = new StringWriter(); + re.createCSV(sw, ';', re.getPrintFormat().getLanguage()); + data = sw.getBuffer().toString().getBytes(); + } else if (ext.equals("txt")) { StringWriter sw = new StringWriter(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java index 95ac9db5e8..11bfd89bf2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkJRViewer.java @@ -14,6 +14,7 @@ import net.sf.jasperreports.engine.JRExporterParameter; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.export.JRCsvExporter; +import net.sf.jasperreports.engine.export.JRCsvExporterParameter; import net.sf.jasperreports.engine.export.JRHtmlExporter; import net.sf.jasperreports.engine.export.JRHtmlExporterParameter; import net.sf.jasperreports.engine.export.JRPdfExporter; @@ -57,7 +58,7 @@ public class ZkJRViewer extends Window implements EventListener, ITabOnCl /** * */ - private static final long serialVersionUID = -8378226782387071338L; + private static final long serialVersionUID = -1250003381099609830L; private JasperPrint jasperPrint; private Listbox previewType = new Listbox(); @@ -103,6 +104,7 @@ public class ZkJRViewer extends Window implements EventListener, ITabOnCl previewType.appendItem("HTML", "HTML"); previewType.appendItem("Excel", "XLS"); previewType.appendItem("CSV", "CSV"); + previewType.appendItem("SSV", "SSV"); if ("PDF".equals(defaultType)) { previewType.setSelectedIndex(0); } else if ("HTML".equals(defaultType)) { @@ -111,6 +113,8 @@ public class ZkJRViewer extends Window implements EventListener, ITabOnCl previewType.setSelectedIndex(2); } else if ("CSV".equals(defaultType)) { previewType.setSelectedIndex(3); + } else if ("SSV".equals(defaultType)) { + previewType.setSelectedIndex(4); } else { previewType.setSelectedIndex(0); log.info("Format not Valid: "+defaultType); @@ -126,6 +130,8 @@ public class ZkJRViewer extends Window implements EventListener, ITabOnCl previewType.setSelectedIndex(0); // default to PDF if cannot export } else if ("CSV".equals(defaultType)) { previewType.setSelectedIndex(0); // default to PDF if cannot export + } else if ("SSV".equals(defaultType)) { + previewType.setSelectedIndex(0); // default to PDF if cannot export } else { previewType.setSelectedIndex(0); log.info("Format not Valid: "+defaultType); @@ -292,6 +298,23 @@ public class ZkJRViewer extends Window implements EventListener, ITabOnCl exporter.exportReport(); media = new AMedia(m_title, "csv", "application/csv", file, true); + + }else if ("SSV".equals(reportType)) { + String path = System.getProperty("java.io.tmpdir"); + String prefix = makePrefix(jasperPrint.getName()); + if (log.isLoggable(Level.FINE)) + { + log.log(Level.FINE, "Path="+path + " Prefix="+prefix); + } + File file = File.createTempFile(prefix, ".ssv", new File(path)); + FileOutputStream fos = new FileOutputStream(file); + JRCsvExporter exporter= new JRCsvExporter(); + exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, ";"); + exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); + exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, fos); + exporter.exportReport(); + + media = new AMedia(m_title, "ssv", "application/ssv", file, true); } } finally { Thread.currentThread().setContextClassLoader(cl); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java index b2cbd67eb7..2d0a8ee37a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java @@ -948,12 +948,18 @@ public class ZkReportViewer extends Window implements EventListener, ITab m_reportEngine.createXML(sw); data = sw.getBuffer().toString().getBytes(); } - else if (ext.equals("csv") || ext.equals("ssv")) + else if (ext.equals("csv")) { StringWriter sw = new StringWriter(); m_reportEngine.createCSV(sw, ',', m_reportEngine.getPrintFormat().getLanguage()); data = sw.getBuffer().toString().getBytes(); } + else if (ext.equals("ssv")) + { + StringWriter sw = new StringWriter(); + m_reportEngine.createCSV(sw, ';', m_reportEngine.getPrintFormat().getLanguage()); + data = sw.getBuffer().toString().getBytes(); + } else if (ext.equals("txt")) { StringWriter sw = new StringWriter(); From a99bdc15d6e331f68293768b979627f64d148fc4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Nov 2014 13:49:39 -0500 Subject: [PATCH 08/20] IDEMPIERE-2334 Allow zoom from URL / fix NPE --- .../WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 8f87fb91b3..3cfdaee3bb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -310,9 +310,11 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb private String getPrmString(String prm) { String retValue = ""; - String[] strs = m_URLParameters.get(prm); - if (strs != null && strs.length == 1 && strs[0] != null) - retValue = strs[0]; + if (m_URLParameters != null) { + String[] strs = m_URLParameters.get(prm); + if (strs != null && strs.length == 1 && strs[0] != null) + retValue = strs[0]; + } return retValue; } From 597eb1ce3265beaa5b901c90407e68a28609f8e2 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 25 Nov 2014 14:11:23 -0500 Subject: [PATCH 09/20] IDEMPIERE-2334 Allow zoom from URL / fix concurrency --- .../WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 3cfdaee3bb..00d476554e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -81,7 +81,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb /** * */ - private static final long serialVersionUID = 8229814619282121621L; + private static final long serialVersionUID = 2030098494203345181L; private static final String SAVED_CONTEXT = "saved.context"; @@ -111,7 +111,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb private static boolean eventThreadEnabled = false; - private static ConcurrentMap m_URLParameters; + private ConcurrentMap m_URLParameters; public AdempiereWebUI() { From aebb3fe2b8b0c1dec9f01d1630d496d76aac0b62 Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Tue, 25 Nov 2014 17:22:56 +0530 Subject: [PATCH 10/20] IDEMPIERE-2336 : Modify Access Modifiers of Info Classes's properties and Methods. --- .../webui/info/InfoProductWindow.java | 44 +++++++++---------- .../org/adempiere/webui/info/InfoWindow.java | 22 +++++----- .../webui/info/WInfoPAttributeEditor.java | 2 +- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java index d9d9dd62e9..19c6c32330 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java @@ -53,32 +53,32 @@ public class InfoProductWindow extends InfoWindow { */ private static final long serialVersionUID = -1343685368452976048L; - private Tabbox tabbedPane; - private WListbox warehouseTbl; - private String m_sqlWarehouse; - private WListbox substituteTbl; - private String m_sqlSubstitute; - private WListbox relatedTbl; - private String m_sqlRelated; + protected Tabbox tabbedPane; + protected WListbox warehouseTbl; + protected String m_sqlWarehouse; + protected WListbox substituteTbl; + protected String m_sqlSubstitute; + protected WListbox relatedTbl; + protected String m_sqlRelated; //Available to Promise Tab - private WListbox m_tableAtp; + protected WListbox m_tableAtp; // Group atp by warehouse or non - private Checkbox chbShowDetailAtp; + protected Checkbox chbShowDetailAtp; //IDEMPIERE-337 - private WListbox productpriceTbl; - private String m_sqlProductprice; + protected WListbox productpriceTbl; + protected String m_sqlProductprice; - private Textbox fieldDescription; + protected Textbox fieldDescription; /** ASI */ - protected int m_M_AttributeSetInstance_ID; + protected int m_M_AttributeSetInstance_ID; - private Borderlayout contentBorderLayout; + protected Borderlayout contentBorderLayout; /** Instance Button */ - private Button m_PAttributeButton; + protected Button m_PAttributeButton; protected int m_M_Locator_ID; @@ -369,7 +369,7 @@ public class InfoProductWindow extends InfoWindow { }); } - private void onPAttributeClick() { + protected void onPAttributeClick() { Integer productInteger = getSelectedRowKey(); if (productInteger == null) { m_PAttributeButton.setEnabled(false); @@ -397,7 +397,7 @@ public class InfoProductWindow extends InfoWindow { }); } - private String getSelectedWarehouseLabel() { + protected String getSelectedWarehouseLabel() { for(WEditor editor : editors) { if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("M_Warehouse_ID")) { Number value = (Number) editor.getValue(); @@ -461,7 +461,7 @@ public class InfoProductWindow extends InfoWindow { * @param M_PriceList_ID price list * @return M_PriceList_Version_ID price list version */ - private int findPLV (int M_PriceList_ID) + protected int findPLV (int M_PriceList_ID) { Timestamp priceDate = null; // Sales Order Date @@ -518,7 +518,7 @@ public class InfoProductWindow extends InfoWindow { * * @param M_Warehouse_ID warehouse */ - private void setWarehouse(int M_Warehouse_ID) + protected void setWarehouse(int M_Warehouse_ID) { for(WEditor editor : editors) { if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("M_Warehouse_ID")) { @@ -535,7 +535,7 @@ public class InfoProductWindow extends InfoWindow { * * @param M_PriceList_Version_ID price list */ - private void setPriceListVersion(int M_PriceList_Version_ID) + protected void setPriceListVersion(int M_PriceList_Version_ID) { if (log.isLoggable(Level.CONFIG)) log.config("M_PriceList_Version_ID=" + M_PriceList_Version_ID); @@ -555,7 +555,7 @@ public class InfoProductWindow extends InfoWindow { /** * Refresh Query */ - private void refresh(int M_Warehouse_ID, int M_PriceList_Version_ID) + protected void refresh(int M_Warehouse_ID, int M_PriceList_Version_ID) { int m_M_Product_ID = getSelectedRowKey(); String sql = m_sqlWarehouse; @@ -641,7 +641,7 @@ public class InfoProductWindow extends InfoWindow { * @param m_M_Warehouse_ID * @param m_M_Product_ID */ - private void initAtpTab (int m_M_Warehouse_ID, int m_M_Product_ID) + protected void initAtpTab (int m_M_Warehouse_ID, int m_M_Product_ID) { // Header Vector columnNames = new Vector(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index 62e54d548e..bd78d07953 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -399,7 +399,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL btMenuProcess.setVisible(ipMenu.getChildren().size() > 0); } - private void processQueryValue() { + protected void processQueryValue() { isQueryByUser = true; for (int i = 0; i < identifiers.size(); i++) { WEditor editor = identifiers.get(i); @@ -434,7 +434,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL isQueryByUser = false; } - private boolean loadInfoDefinition() { + protected boolean loadInfoDefinition() { String tableName = null; if (AD_InfoWindow_ID > 0) { infoWindow = new MInfoWindow(Env.getCtx(), AD_InfoWindow_ID, null); @@ -514,7 +514,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL } //private MInfoColumn[] topinfoColumns;//infoWindow.getInfoColumns(tableInfos); - private boolean loadInfoRelatedTabs() { + protected boolean loadInfoRelatedTabs() { if (infoWindow == null) return false; @@ -654,7 +654,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL prepareTable(columnInfos, infoWindow.getFromClause(), p_whereClause, infoWindow.getOrderByClause()); } - private ColumnInfo createLookupColumnInfo(TableInfo[] tableInfos, + protected ColumnInfo createLookupColumnInfo(TableInfo[] tableInfos, GridField gridField, MInfoColumn infoColumn) { String columnName = gridField.getColumnName(); String validationCode = ""; @@ -801,7 +801,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL return sql; } - private MInfoColumn findInfoColumn(GridField gridField) { + protected MInfoColumn findInfoColumn(GridField gridField) { for(int i = 0; i < gridFields.size(); i++) { if (gridFields.get(i) == gridField) { return infoColumns[i]; @@ -1138,7 +1138,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL dynamicDisplay(null); } - private void evalDisplayLogic() { + protected void evalDisplayLogic() { for(WEditor editor : editors) { if (editor.getGridField() != null && !editor.getGridField().isDisplayed(true)) { editor.getComponent().setVisible(false); @@ -1256,7 +1256,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL panel.appendChild(fieldEditor); } - private void createAndCheckbox() { + protected void createAndCheckbox() { checkAND = new Checkbox(); checkAND.setLabel(Msg.getMsg(Env.getCtx(), "SearchAND", true)); String tips = Msg.getMsg(Env.getCtx(), "SearchAND", false); @@ -1502,7 +1502,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL * Test Row Count * @return true if display */ - private boolean testCount(boolean promptError) + protected boolean testCount(boolean promptError) { long start = System.currentTimeMillis(); String dynWhere = getSQLWhere(); @@ -1640,7 +1640,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL * @author xolali IDEMPIERE-1045 * refresh(Object obj, EmbedWinInfo relatedInfo) */ - private void refresh(Object obj, EmbedWinInfo relatedInfo) + protected void refresh(Object obj, EmbedWinInfo relatedInfo) { StringBuilder sql = new StringBuilder(); sql.append(relatedInfo.getInfoSql()); // delete get sql method from MInfoWindow @@ -1703,7 +1703,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL * @author xolali IDEMPIERE-1045 * GridField getGridField(MInfoColumn infoColumn) */ - private GridField getGridField(MInfoColumn infoColumn){ + protected GridField getGridField(MInfoColumn infoColumn){ String columnName = infoColumn.getColumnName(); GridFieldVO vo = GridFieldVO.createParameter(infoContext, p_WindowNo, 0, columnName, infoColumn.get_Translation("Name"), infoColumn.getAD_Reference_ID(), @@ -1725,7 +1725,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL return gridField; } - private ArrayList readData(ResultSet rs, ColumnInfo[] p_layout) throws SQLException { + protected ArrayList readData(ResultSet rs, ColumnInfo[] p_layout) throws SQLException { int colOffset = 1; // columns start with 1 ArrayList data = new ArrayList(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/WInfoPAttributeEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/WInfoPAttributeEditor.java index c1f8e5f6de..7bfac16ad6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/WInfoPAttributeEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/WInfoPAttributeEditor.java @@ -123,7 +123,7 @@ public class WInfoPAttributeEditor extends WEditor implements IWhereClauseEditor * M_AttributeSet pa * */ - private void cmd_InfoPAttribute() + protected void cmd_InfoPAttribute() { int attributeSetId = Env.getContextAsInt(ctx, windowNo, Env.TAB_INFO, "M_AttributeSet_ID"); final InfoPAttributePanel ia = new InfoPAttributePanel(attributeSetId); From 7d8537cc07d98adf128c24f9178dc67518ff3491 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Nov 2014 11:02:03 -0500 Subject: [PATCH 11/20] IDEMPIERE-2336 : Modify Access Modifiers of Info Classes's properties and Methods. / minor - regenerate serialVersionUID --- .../WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java | 2 +- .../WEB-INF/src/org/adempiere/webui/info/InfoWindow.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java index 19c6c32330..fd3b92b102 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java @@ -51,7 +51,7 @@ public class InfoProductWindow extends InfoWindow { /** * */ - private static final long serialVersionUID = -1343685368452976048L; + private static final long serialVersionUID = -7892916038089331016L; protected Tabbox tabbedPane; protected WListbox warehouseTbl; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index bd78d07953..4ae7e562d6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -96,7 +96,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL /** * */ - private static final long serialVersionUID = 6606023722122538154L; + private static final long serialVersionUID = -2192106603768665006L; protected Grid parameterGrid; private Borderlayout layout; From 3ef895aa919692fa5e8fc293af75cf41f8b55400 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 26 Nov 2014 11:06:10 -0500 Subject: [PATCH 12/20] IDEMPIERE-2325 Env.parseVariable(String, PO, String, boolean) displays 'null' instead of '' --- org.adempiere.base/src/org/compiere/util/Env.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/util/Env.java b/org.adempiere.base/src/org/compiere/util/Env.java index 7d74195772..b62e2ca110 100644 --- a/org.adempiere.base/src/org/compiere/util/Env.java +++ b/org.adempiere.base/src/org/compiere/util/Env.java @@ -1509,8 +1509,9 @@ public final class Env if (column.isSecure()) { outStr.append("********"); } else { - outStr.append(DB.getSQLValueString(trxName, - "SELECT " + columnName + " FROM " + tableName + " WHERE " + tableName + "_ID = ?", (Integer)v)); + String value = DB.getSQLValueString(trxName,"SELECT " + columnName + " FROM " + tableName + " WHERE " + tableName + "_ID = ?", (Integer)v); + if (value != null) + outStr.append(value); } } } From 36ce8de266ec23acb430b0f82cdaaaa7dd2e0161 Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 26 Nov 2014 13:23:32 -0500 Subject: [PATCH 13/20] IDEMPIERE-2049:Incorrectly is sent the email in russian language --- org.adempiere.base/src/org/compiere/util/EMail.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/util/EMail.java b/org.adempiere.base/src/org/compiere/util/EMail.java index 70f25d0844..76a57fb02f 100644 --- a/org.adempiere.base/src/org/compiere/util/EMail.java +++ b/org.adempiere.base/src/org/compiere/util/EMail.java @@ -338,7 +338,7 @@ public final class EMail implements Serializable m_msg.setHeader("Comments", "iDempiereMail"); // m_msg.setDescription("Description"); // SMTP specifics - m_msg.setAllow8bitMIME(true); + //m_msg.setAllow8bitMIME(true); // Send notification on Failure & Success - no way to set envid in Java yet // m_msg.setNotifyOptions (SMTPMessage.NOTIFY_FAILURE | SMTPMessage.NOTIFY_SUCCESS); // Bounce only header From 05f9f72aac5b25ed11865cb6e1a981ccd0da3874 Mon Sep 17 00:00:00 2001 From: hieplq Date: Tue, 25 Nov 2014 22:33:31 +0800 Subject: [PATCH 14/20] IDEMPIERE-2132:mails from iDempiere can not be forwarded --- .../src/org/compiere/util/EMail.java | 43 +++++++++++++------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/util/EMail.java b/org.adempiere.base/src/org/compiere/util/EMail.java index 76a57fb02f..b0241e12ef 100644 --- a/org.adempiere.base/src/org/compiere/util/EMail.java +++ b/org.adempiere.base/src/org/compiere/util/EMail.java @@ -48,7 +48,6 @@ import javax.mail.internet.MimeMultipart; import org.compiere.model.MClient; import org.compiere.model.MSysConfig; - import com.sun.mail.smtp.SMTPMessage; /** @@ -974,18 +973,34 @@ public final class EMail implements Serializable else // Multi part message *************************************** { // First Part - Message - MimeBodyPart mbp_1 = new MimeBodyPart(); - mbp_1.setText(""); - if (m_messageHTML == null || m_messageHTML.length () == 0) - mbp_1.setText (getMessageCRLF(), charSetName); - else - mbp_1.setDataHandler (new DataHandler - (new ByteArrayDataSource (m_messageHTML, charSetName, "text/html"))); + MimeBodyPart htmlPart= null; + MimeBodyPart planPart = new MimeBodyPart(); + //TODO: get plan text form html, i see getMessageCRLF just return empty string + planPart.setText (getMessageCRLF(), charSetName); + htmlPart = new MimeBodyPart(); + if (m_messageHTML == null){ + m_messageHTML = "" + getMessageCRLF() + ""; + } + htmlPart.setDataHandler (new DataHandler + (new ByteArrayDataSource (m_messageHTML, charSetName, "text/html"))); + // Create Multipart and its parts to it - Multipart mp = new MimeMultipart("related"); - mp.addBodyPart(mbp_1); - if (log.isLoggable(Level.FINE)) log.fine("(multi) " + getSubject() + " - " + mbp_1); + Multipart mainPart = new MimeMultipart("mixed"); + + Multipart viewContentPart = new MimeMultipart("related"); + MimeBodyPart viewBodyPart = new MimeBodyPart(); + viewBodyPart.setContent(viewContentPart); + mainPart.addBodyPart(viewBodyPart); + + Multipart textAlternativePart = new MimeMultipart("alternative"); + //textAlternativePart.addBodyPart(planPart); + textAlternativePart.addBodyPart(htmlPart); + MimeBodyPart alternativeBodyPart = new MimeBodyPart(); + alternativeBodyPart.setContent(textAlternativePart); + viewContentPart.addBodyPart(alternativeBodyPart); + + if (log.isLoggable(Level.FINE)) log.fine("(multi) " + getSubject() + " - " + htmlPart); // for all attachments for (int i = 0; i < m_attachments.size(); i++) @@ -1024,12 +1039,14 @@ public final class EMail implements Serializable if (m_messageHTML != null && m_messageHTML.contains("cid:"+ds.getName())) { mbp_2.setContentID("<" + ds.getName() + ">"); mbp_2.setDisposition(MimeBodyPart.INLINE); + viewContentPart.addBodyPart(mbp_2); + }else{ + mainPart.addBodyPart(mbp_2); } - mp.addBodyPart(mbp_2); } // Add to Message - m_msg.setContent(mp); + m_msg.setContent(mainPart); } // multi=part } // setContent From 9adaa4be7e0f8bcaa8b4c08bf026b7f71b20664c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Nov 2014 17:03:53 -0500 Subject: [PATCH 15/20] IDEMPIERE-2297 Use browser default language instead of Client System's / fix potential NPE --- .../WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java index 609cedd36a..01da1dedd1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java @@ -664,6 +664,9 @@ public class LoginPanel extends Window implements EventListener /** get default languages from the browser */ private List browserLanguages(String header) { List arrstr = new ArrayList(); + if (header == null) + return arrstr; + for (String str : header.split(",")){ String[] arr = str.trim().replace("-", "_").split(";"); From 1898b69191b8a49bb77c859b33e9b41a5aa90b3e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Nov 2014 17:42:27 -0500 Subject: [PATCH 16/20] IDEMPIERE-2346 Error CSV Exporting Broadcast Message --- .../org/adempiere/webui/adwindow/AbstractADWindowContent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 0d9ea60ad5..fd8fd2a64c 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 @@ -1622,8 +1622,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !isNewRow); toolbar.enableReport(!isNewRow); - toolbar.enableExport(!adTabbox.getSelectedGridTab().isSortTab()); - toolbar.enableFileImport(!changed && !adTabbox.getSelectedGridTab().isSortTab() && adTabbox.getSelectedGridTab().isInsertRecord()); + toolbar.enableExport(!isNewRow && !adTabbox.getSelectedGridTab().isSortTab()); + toolbar.enableFileImport(!isNewRow && !changed && !adTabbox.getSelectedGridTab().isSortTab() && adTabbox.getSelectedGridTab().isInsertRecord()); toolbar.enableTabNavigation(breadCrumb.hasParentLink(), adTabbox.getSelectedDetailADTabpanel() != null); From 44e85e6999387b1b568026606b73b01fd051a8ed Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Nov 2014 18:09:03 -0500 Subject: [PATCH 17/20] IDEMPIERE-2273 CSV Import fail on evaluate column mandatory logic / based on patch from Claudemir Todo Bom (allgood) --- .../src/org/adempiere/impexp/GridTabCSVImporter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java b/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java index 47277056a3..79acfcdad8 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java @@ -765,7 +765,7 @@ public class GridTabCSVImporter implements IGridTabImporter return new StringBuilder(Msg.getMsg(Env.getCtx(), "FieldNotDisplayed",new Object[] {header.get(i)})); MColumn column = MColumn.get(Env.getCtx(), field.getAD_Column_ID()); - if((field.isMandatory(true) || column.isMandatory()) && value == null && field.getDefault()==null){ + if((field.isMandatory(false) || column.isMandatory()) && value == null && field.getDefault()==null){ mandatoryColumns.append(" / "); mandatoryColumns.append(header.get(i)); } From 6a74532d1ba8c552502dbf93297c0f80d5a5482d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 28 Nov 2014 18:44:53 -0500 Subject: [PATCH 18/20] IDEMPIERE-1753 Allow field createBy updateBy load data / thanks to Armen Rizal (armenrz) --- .../src/org/compiere/model/GridField.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 2fa008600e..354e2ca333 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -180,13 +180,6 @@ public class GridField log.log(Level.SEVERE, "(" + m_vo.ColumnName + ") - No LookupInfo"); return; } - // Prevent loading of CreatedBy/UpdatedBy - if (m_vo.displayType == DisplayType.Table - && (m_vo.ColumnName.equals("CreatedBy") || m_vo.ColumnName.equals("UpdatedBy")) ) - { - m_vo.lookupInfo.IsCreadedUpdatedBy = true; - m_vo.lookupInfo.DisplayType = DisplayType.Search; - } // loadLookupNoValidate(); } @@ -220,6 +213,14 @@ public class GridField if (m_vo.lookupInfo == null) { return; } + // Prevent loading of CreatedBy/UpdatedBy + if (m_vo.displayType == DisplayType.Table + && (m_vo.ColumnName.equals("CreatedBy") || m_vo.ColumnName.equals("UpdatedBy")) ) + { + m_vo.lookupInfo.IsCreadedUpdatedBy = true; + m_vo.lookupInfo.DisplayType = DisplayType.Search; + m_vo.displayType = DisplayType.Search; + } m_vo.lookupInfo.IsKey = isKey(); loadLookupFromFactory(); } From 63f10761f8a3620b959252fb839c0c763e0e6b8c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 1 Dec 2014 15:13:04 -0500 Subject: [PATCH 19/20] IDEMPIERE-2348 Business Partner Location : Error when selecting city from autocomplete list / thanks to Gabriel Schneider --- .../src/org/adempiere/webui/component/AutoComplete.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AutoComplete.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AutoComplete.java index f45aa3f09a..945f292167 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AutoComplete.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AutoComplete.java @@ -17,7 +17,6 @@ package org.adempiere.webui.component; -import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; @@ -60,11 +59,6 @@ public class AutoComplete extends Combobox public void setDict(String[] vals) { comboItems = vals; - - if (comboItems != null) - { - Arrays.sort(comboItems); - } } /** From 67c4abd701996e98f1a39e1493fb08ea391c0661 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 2 Dec 2014 09:46:40 -0500 Subject: [PATCH 20/20] IDEMPIERE-2349 Language wrongly applied when print format item date has pattern --- org.adempiere.base/src/org/compiere/util/DisplayType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/util/DisplayType.java b/org.adempiere.base/src/org/compiere/util/DisplayType.java index c42aa653cd..0c639249dc 100644 --- a/org.adempiere.base/src/org/compiere/util/DisplayType.java +++ b/org.adempiere.base/src/org/compiere/util/DisplayType.java @@ -476,7 +476,7 @@ public final class DisplayType // if ( pattern != null && pattern.length() > 0) { - SimpleDateFormat format = (SimpleDateFormat)DateFormat.getInstance(); + SimpleDateFormat format = (SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, language.getLocale()); try { format.applyPattern(pattern); return format;