From abd74af7bb5905ff5b4ef9e0bf8d54339191a9de Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 23 Aug 2013 09:37:43 -0500 Subject: [PATCH] IDEMPIERE-1157 Adding functionality to add charts on the standard windows / QA --- .../oracle/201308230922_IDEMPIERE-1157.sql | 33 +++++++++++++++++ .../201308230922_IDEMPIERE-1157.sql | 33 +++++++++++++++++ .../src/org/compiere/model/I_AD_Chart.java | 19 +++++++--- .../compiere/model/I_AD_ChartDatasource.java | 31 ++++++++++------ .../src/org/compiere/model/I_PA_Goal.java | 4 +-- .../org/compiere/model/MChartDatasource.java | 35 +++---------------- .../src/org/compiere/model/MColumn.java | 2 ++ .../src/org/compiere/model/X_AD_Chart.java | 28 +++++++++++---- .../compiere/model/X_AD_ChartDatasource.java | 33 ++++++++++++----- .../src/org/compiere/model/X_PA_Goal.java | 4 +-- .../org/compiere/print/MPrintFormatItem.java | 4 +-- .../src/org/compiere/util/DisplayType.java | 4 ++- .../adempiere/webui/editor/WChartEditor.java | 4 +-- .../webui/factory/DefaultEditorFactory.java | 2 +- .../src/org/compiere/db/DB_Oracle.java | 1 + 15 files changed, 164 insertions(+), 73 deletions(-) create mode 100644 migration/i1.0c-release/oracle/201308230922_IDEMPIERE-1157.sql create mode 100644 migration/i1.0c-release/postgresql/201308230922_IDEMPIERE-1157.sql diff --git a/migration/i1.0c-release/oracle/201308230922_IDEMPIERE-1157.sql b/migration/i1.0c-release/oracle/201308230922_IDEMPIERE-1157.sql new file mode 100644 index 0000000000..5fb836e775 --- /dev/null +++ b/migration/i1.0c-release/oracle/201308230922_IDEMPIERE-1157.sql @@ -0,0 +1,33 @@ +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Element SET Description='Type of chart to render',Updated=TO_DATE('2013-08-23 09:21:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=53894 +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Column SET ColumnName='ChartType', Name='Chart Type', Description='Type of chart to render', Help=NULL WHERE AD_Element_ID=53894 +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Process_Para SET ColumnName='ChartType', Name='Chart Type', Description='Type of chart to render', Help=NULL, AD_Element_ID=53894 WHERE UPPER(ColumnName)='CHARTTYPE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Process_Para SET ColumnName='ChartType', Name='Chart Type', Description='Type of chart to render', Help=NULL WHERE AD_Element_ID=53894 AND IsCentrallyMaintained='Y' +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_InfoColumn SET ColumnName='ChartType', Name='Chart Type', Description='Type of chart to render', Help=NULL WHERE AD_Element_ID=53894 AND IsCentrallyMaintained='Y' +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Field SET Name='Chart Type', Description='Type of chart to render', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53894) AND IsCentrallyMaintained='Y' +; + +SELECT register_migration_script('201308230922_IDEMPIERE-1157.sql') FROM dual +; + diff --git a/migration/i1.0c-release/postgresql/201308230922_IDEMPIERE-1157.sql b/migration/i1.0c-release/postgresql/201308230922_IDEMPIERE-1157.sql new file mode 100644 index 0000000000..fea61701b2 --- /dev/null +++ b/migration/i1.0c-release/postgresql/201308230922_IDEMPIERE-1157.sql @@ -0,0 +1,33 @@ +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Element SET Description='Type of chart to render',Updated=TO_TIMESTAMP('2013-08-23 09:21:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=53894 +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Column SET ColumnName='ChartType', Name='Chart Type', Description='Type of chart to render', Help=NULL WHERE AD_Element_ID=53894 +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Process_Para SET ColumnName='ChartType', Name='Chart Type', Description='Type of chart to render', Help=NULL, AD_Element_ID=53894 WHERE UPPER(ColumnName)='CHARTTYPE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Process_Para SET ColumnName='ChartType', Name='Chart Type', Description='Type of chart to render', Help=NULL WHERE AD_Element_ID=53894 AND IsCentrallyMaintained='Y' +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_InfoColumn SET ColumnName='ChartType', Name='Chart Type', Description='Type of chart to render', Help=NULL WHERE AD_Element_ID=53894 AND IsCentrallyMaintained='Y' +; + +-- Aug 23, 2013 9:21:49 AM COT +-- IDEMPIERE-1157 Adding functionality to add charts on the standard windows +UPDATE AD_Field SET Name='Chart Type', Description='Type of chart to render', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53894) AND IsCentrallyMaintained='Y' +; + +SELECT register_migration_script('201308230922_IDEMPIERE-1157.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Chart.java b/org.adempiere.base/src/org/compiere/model/I_AD_Chart.java index 22c3a68d8c..f467f6ec4a 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_Chart.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Chart.java @@ -1,6 +1,6 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * Product: iDempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. * * This program is free software, you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * @@ -21,8 +21,8 @@ import java.sql.Timestamp; import org.compiere.util.KeyNamePair; /** Generated Interface for AD_Chart - * @author Adempiere (generated) - * @version Release 3.6.0LTS + * @author iDempiere (generated) + * @version Release 1.0c */ public interface I_AD_Chart { @@ -31,7 +31,7 @@ public interface I_AD_Chart public static final String Table_Name = "AD_Chart"; /** AD_Table_ID=53284 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 53284; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); @@ -50,6 +50,15 @@ public interface I_AD_Chart /** Get Chart */ public int getAD_Chart_ID(); + /** Column name AD_Chart_UU */ + public static final String COLUMNNAME_AD_Chart_UU = "AD_Chart_UU"; + + /** Set AD_Chart_UU */ + public void setAD_Chart_UU (String AD_Chart_UU); + + /** Get AD_Chart_UU */ + public String getAD_Chart_UU(); + /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_ChartDatasource.java b/org.adempiere.base/src/org/compiere/model/I_AD_ChartDatasource.java index 66933d1583..59aa4b0c95 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_ChartDatasource.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_ChartDatasource.java @@ -1,6 +1,6 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * Product: iDempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. * * This program is free software, you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * @@ -21,8 +21,8 @@ import java.sql.Timestamp; import org.compiere.util.KeyNamePair; /** Generated Interface for AD_ChartDatasource - * @author Adempiere (generated) - * @version 360LTS.013 + * @author iDempiere (generated) + * @version Release 1.0c */ public interface I_AD_ChartDatasource { @@ -31,7 +31,7 @@ public interface I_AD_ChartDatasource public static final String Table_Name = "AD_ChartDatasource"; /** AD_Table_ID=53282 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = 53282; KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); @@ -50,6 +50,15 @@ public interface I_AD_ChartDatasource /** Get Chart Datasource */ public int getAD_ChartDatasource_ID(); + /** Column name AD_ChartDatasource_UU */ + public static final String COLUMNNAME_AD_ChartDatasource_UU = "AD_ChartDatasource_UU"; + + /** Set AD_ChartDatasource_UU */ + public void setAD_ChartDatasource_UU (String AD_ChartDatasource_UU); + + /** Get AD_ChartDatasource_UU */ + public String getAD_ChartDatasource_UU(); + /** Column name AD_Chart_ID */ public static final String COLUMNNAME_AD_Chart_ID = "AD_Chart_ID"; @@ -59,7 +68,7 @@ public interface I_AD_ChartDatasource /** Get Chart */ public int getAD_Chart_ID(); - public I_AD_Chart getAD_Chart() throws RuntimeException; + public org.compiere.model.I_AD_Chart getAD_Chart() throws RuntimeException; /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; @@ -72,13 +81,13 @@ public interface I_AD_ChartDatasource /** Column name AD_Org_ID */ public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; - /** Set Organisation. - * Organisational entity within client + /** Set Organization. + * Organizational entity within client */ public void setAD_Org_ID (int AD_Org_ID); - /** Get Organisation. - * Organisational entity within client + /** Get Organization. + * Organizational entity within client */ public int getAD_Org_ID(); @@ -95,7 +104,7 @@ public interface I_AD_ChartDatasource */ public int getAD_Table_ID(); - public I_AD_Table getAD_Table() throws RuntimeException; + public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException; /** Column name CategoryColumn */ public static final String COLUMNNAME_CategoryColumn = "CategoryColumn"; diff --git a/org.adempiere.base/src/org/compiere/model/I_PA_Goal.java b/org.adempiere.base/src/org/compiere/model/I_PA_Goal.java index 396f72993f..3e2a7fb80d 100644 --- a/org.adempiere.base/src/org/compiere/model/I_PA_Goal.java +++ b/org.adempiere.base/src/org/compiere/model/I_PA_Goal.java @@ -96,12 +96,12 @@ public interface I_PA_Goal public static final String COLUMNNAME_ChartType = "ChartType"; /** Set Chart Type. - * Type fo chart to render + * Type of chart to render */ public void setChartType (String ChartType); /** Get Chart Type. - * Type fo chart to render + * Type of chart to render */ public String getChartType(); diff --git a/org.adempiere.base/src/org/compiere/model/MChartDatasource.java b/org.adempiere.base/src/org/compiere/model/MChartDatasource.java index 6ab754de16..df5eff7bba 100644 --- a/org.adempiere.base/src/org/compiere/model/MChartDatasource.java +++ b/org.adempiere.base/src/org/compiere/model/MChartDatasource.java @@ -117,18 +117,11 @@ public class MChartDatasource extends X_AD_ChartDatasource { sql += category + ">=TRUNC(" + DB.TO_DATE(new Timestamp(startDate.getTime())) + ", '" + unit + "') AND "; sql += category + "<=TRUNC(" + DB.TO_DATE(new Timestamp(endDate.getTime())) + ", '" + unit + "') "; } - - int startIndex=0; - if ((startIndex = sql.indexOf('@')) != -1){ - String variable = sql.substring(startIndex); - int endIndex = variable.indexOf('@',1); - if(endIndex != -1){ - variable = variable.substring(0,endIndex+1); - String val = Env.getContext(getCtx(), variable.replace('@',' ').trim()); - sql=sql.replaceFirst(variable, val); - } + + if (sql.indexOf('@') >= 0) { + sql = Env.parseContext(getCtx(), 0, sql, false, true); } - + MRole role = MRole.getDefault(getCtx(), false); sql = role.addAccessSQL(sql, null, true, false); @@ -254,26 +247,6 @@ public class MChartDatasource extends X_AD_ChartDatasource { return cal.getTime(); } - private String formatDate(Date date, String timeUnit) - { - String key = null; - String unitFormat = "yyyy-MM-dd"; - if ( timeUnit.equals(MChart.TIMEUNIT_Week)) - unitFormat = "yyyy-w"; - else if ( timeUnit.equals(MChart.TIMEUNIT_Month)) - unitFormat = "yyyy-MMM"; - else if ( timeUnit.equals(MChart.TIMEUNIT_Quarter)) - unitFormat = "yyyy-MM"; - else if ( timeUnit.equals(MChart.TIMEUNIT_Year)) - unitFormat = "yyyy"; - SimpleDateFormat format = new SimpleDateFormat(unitFormat); - key = format.format(date); - if ( timeUnit.equals(MChart.TIMEUNIT_Quarter) ) - key = convertToQuarter(format.format(date)); - - return key; - } - /** * Convert date formatted as yyyy-MM to yyyy-QQ * @param month diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index 502c410d19..1db94e2244 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -727,6 +727,8 @@ public class MColumn extends X_AD_Column foreignTable = "AD_Image"; } else if (DisplayType.Color == refid) { foreignTable = "AD_Color"; + } else if (DisplayType.Chart == refid) { + foreignTable = "AD_Chart"; } return foreignTable; diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Chart.java b/org.adempiere.base/src/org/compiere/model/X_AD_Chart.java index d93306de9b..58ce779284 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_Chart.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Chart.java @@ -1,6 +1,6 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * Product: iDempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. * * This program is free software, you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * @@ -21,15 +21,15 @@ import java.sql.ResultSet; import java.util.Properties; /** Generated Model for AD_Chart - * @author Adempiere (generated) - * @version 1.03 - $Id$ */ + * @author iDempiere (generated) + * @version Release 1.0c - $Id$ */ public class X_AD_Chart extends PO implements I_AD_Chart, I_Persistent { /** * */ - private static final long serialVersionUID = 20120608L; + private static final long serialVersionUID = 20130823L; /** Standard Constructor */ public X_AD_Chart (Properties ctx, int AD_Chart_ID, String trxName) @@ -97,6 +97,20 @@ public class X_AD_Chart extends PO implements I_AD_Chart, I_Persistent return ii.intValue(); } + /** Set AD_Chart_UU. + @param AD_Chart_UU AD_Chart_UU */ + public void setAD_Chart_UU (String AD_Chart_UU) + { + set_ValueNoCheck (COLUMNNAME_AD_Chart_UU, AD_Chart_UU); + } + + /** Get AD_Chart_UU. + @return AD_Chart_UU */ + public String getAD_Chart_UU () + { + return (String)get_Value(COLUMNNAME_AD_Chart_UU); + } + /** ChartOrientation AD_Reference_ID=53375 */ public static final int CHARTORIENTATION_AD_Reference_ID=53375; /** Horizontal = H */ @@ -149,7 +163,7 @@ public class X_AD_Chart extends PO implements I_AD_Chart, I_Persistent public static final String CHARTTYPE_RingChart = "RC"; /** Set Chart Type. @param ChartType - Type fo chart to render + Type of chart to render */ public void setChartType (String ChartType) { @@ -158,7 +172,7 @@ public class X_AD_Chart extends PO implements I_AD_Chart, I_Persistent } /** Get Chart Type. - @return Type fo chart to render + @return Type of chart to render */ public String getChartType () { diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_ChartDatasource.java b/org.adempiere.base/src/org/compiere/model/X_AD_ChartDatasource.java index 4bf0209e75..2cd85763b8 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_ChartDatasource.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_ChartDatasource.java @@ -1,6 +1,6 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * Product: iDempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved. * * This program is free software, you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * @@ -22,15 +22,15 @@ import java.util.Properties; import org.compiere.util.KeyNamePair; /** Generated Model for AD_ChartDatasource - * @author Adempiere (generated) - * @version 1.03 - $Id$ */ + * @author iDempiere (generated) + * @version Release 1.0c - $Id$ */ public class X_AD_ChartDatasource extends PO implements I_AD_ChartDatasource, I_Persistent { /** * */ - private static final long serialVersionUID = 20120608L; + private static final long serialVersionUID = 20130823L; /** Standard Constructor */ public X_AD_ChartDatasource (Properties ctx, int AD_ChartDatasource_ID, String trxName) @@ -40,6 +40,7 @@ public class X_AD_ChartDatasource extends PO implements I_AD_ChartDatasource, I_ { setAD_ChartDatasource_ID (0); setAD_Chart_ID (0); + setCategoryColumn (null); setEntityType (null); // U setFromClause (null); @@ -98,9 +99,23 @@ public class X_AD_ChartDatasource extends PO implements I_AD_ChartDatasource, I_ return ii.intValue(); } - public I_AD_Chart getAD_Chart() throws RuntimeException + /** Set AD_ChartDatasource_UU. + @param AD_ChartDatasource_UU AD_ChartDatasource_UU */ + public void setAD_ChartDatasource_UU (String AD_ChartDatasource_UU) + { + set_ValueNoCheck (COLUMNNAME_AD_ChartDatasource_UU, AD_ChartDatasource_UU); + } + + /** Get AD_ChartDatasource_UU. + @return AD_ChartDatasource_UU */ + public String getAD_ChartDatasource_UU () + { + return (String)get_Value(COLUMNNAME_AD_ChartDatasource_UU); + } + + public org.compiere.model.I_AD_Chart getAD_Chart() throws RuntimeException { - return (I_AD_Chart)MTable.get(getCtx(), I_AD_Chart.Table_Name) + return (org.compiere.model.I_AD_Chart)MTable.get(getCtx(), org.compiere.model.I_AD_Chart.Table_Name) .getPO(getAD_Chart_ID(), get_TrxName()); } /** Set Chart. @@ -123,9 +138,9 @@ public class X_AD_ChartDatasource extends PO implements I_AD_ChartDatasource, I_ return ii.intValue(); } - public I_AD_Table getAD_Table() throws RuntimeException + public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException { - return (I_AD_Table)MTable.get(getCtx(), I_AD_Table.Table_Name) + return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_Name) .getPO(getAD_Table_ID(), get_TrxName()); } /** Set Table. diff --git a/org.adempiere.base/src/org/compiere/model/X_PA_Goal.java b/org.adempiere.base/src/org/compiere/model/X_PA_Goal.java index 3e3039d6b8..47755b590d 100644 --- a/org.adempiere.base/src/org/compiere/model/X_PA_Goal.java +++ b/org.adempiere.base/src/org/compiere/model/X_PA_Goal.java @@ -157,7 +157,7 @@ public class X_PA_Goal extends PO implements I_PA_Goal, I_Persistent public static final String CHARTTYPE_WaterfallChart = "WC"; /** Set Chart Type. @param ChartType - Type fo chart to render + Type of chart to render */ public void setChartType (String ChartType) { @@ -166,7 +166,7 @@ public class X_PA_Goal extends PO implements I_PA_Goal, I_Persistent } /** Get Chart Type. - @return Type fo chart to render + @return Type of chart to render */ public String getChartType () { diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java b/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java index 8ba1459d20..cb7eb08891 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java @@ -479,7 +479,7 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem || ColumnName.equals("IsActive") || displayType == DisplayType.Button || displayType == DisplayType.Binary || displayType == DisplayType.ID || displayType == DisplayType.Image - || displayType == DisplayType.RowID + || displayType == DisplayType.RowID || displayType == DisplayType.Chart || seqNo == 0 ) { pfi.setIsPrinted(false); @@ -565,7 +565,7 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem // if (displayType == DisplayType.Button || displayType == DisplayType.Binary || displayType == DisplayType.ID || displayType == DisplayType.Image - || displayType == DisplayType.RowID + || displayType == DisplayType.RowID || displayType == DisplayType.Chart || seqNo == 0) { pfi.setIsPrinted(false); diff --git a/org.adempiere.base/src/org/compiere/util/DisplayType.java b/org.adempiere.base/src/org/compiere/util/DisplayType.java index bf03f47a7d..6a963f1c6f 100644 --- a/org.adempiere.base/src/org/compiere/util/DisplayType.java +++ b/org.adempiere.base/src/org/compiere/util/DisplayType.java @@ -189,7 +189,7 @@ public final class DisplayType if (displayType == ID || displayType == Table || displayType == TableDir || displayType == Search || displayType == Location || displayType == Locator || displayType == Account || displayType == Assignment || displayType == PAttribute - || displayType == Image || displayType == Color) + || displayType == Image || displayType == Chart || displayType == Color) return true; List factoryList = Service.locator().list(IDisplayTypeFactory.class).getServices(); @@ -711,6 +711,8 @@ public final class DisplayType return "PrinterName"; if (displayType == Payment) return "Payment"; + if (displayType == Chart) + return "Chart"; List factoryList = Service.locator().list(IDisplayTypeFactory.class).getServices(); for(IDisplayTypeFactory factory : factoryList){ diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WChartEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WChartEditor.java index 250f063b41..515174226e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WChartEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WChartEditor.java @@ -56,6 +56,7 @@ public class WChartEditor extends WEditor { private static final String[] LISTENER_EVENTS = {Events.ON_CLICK}; + @SuppressWarnings("unused") private static final CLogger logger; static @@ -161,7 +162,7 @@ public class WChartEditor extends WEditor count++; } - myImage.addEventListener(Events.ON_CLICK, new EventListener() { + myImage.addEventListener(Events.ON_CLICK, new EventListener() { public void onEvent(Event event) throws Exception { MouseEvent me = (MouseEvent) event; String areaId = me.getArea(); @@ -189,7 +190,6 @@ public class WChartEditor extends WEditor private void init() { - AImage img = null; } @Override diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultEditorFactory.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultEditorFactory.java index 9a47941020..31ac92e67e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultEditorFactory.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultEditorFactory.java @@ -123,7 +123,7 @@ public class DefaultEditorFactory implements IEditorFactory { /** Chart */ else if(displayType == DisplayType.Chart) { - editor = new WChartEditor(gridField, gridTab.getWindowNo()); + editor = new WChartEditor(gridField, (gridTab == null ? 0 : gridTab.getWindowNo())); } /** Button */ diff --git a/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java b/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java index 918528883f..61addf67a7 100644 --- a/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java +++ b/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java @@ -932,6 +932,7 @@ public class DB_Oracle implements AdempiereDatabase case DisplayType.Table: case DisplayType.TableDir: case DisplayType.Image: + case DisplayType.Chart: retValue = "NUMBER(10)"; break;