diff --git a/migration/iD10/oracle/202207121657_IDEMPIERE-5342.sql b/migration/iD10/oracle/202207121657_IDEMPIERE-5342.sql new file mode 100644 index 0000000000..3df494dddb --- /dev/null +++ b/migration/iD10/oracle/202207121657_IDEMPIERE-5342.sql @@ -0,0 +1,46 @@ +-- IDEMPIERE-5342 +SELECT register_migration_script('202207121657_IDEMPIERE-5342.sql') FROM dual; + +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jul 12, 2022, 4:57:32 PM CEST +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (203626,0,0,'Y',TO_TIMESTAMP('2022-07-12 16:57:32','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-07-12 16:57:32','YYYY-MM-DD HH24:MI:SS'),0,'IsShowTitle','Show Title','Show Title','D','bf9b4ad5-68c4-4836-8af0-c4ca689bcc05') +; + +-- Jul 12, 2022, 4:58:05 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (215037,0,'Show Title',50010,'IsShowTitle','Y',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2022-07-12 16:58:04','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-07-12 16:58:04','YYYY-MM-DD HH24:MI:SS'),0,203626,'Y','N','D','N','N','N','Y','425d1cae-6c95-4eef-a27b-eef7e9106e48','Y',0,'N','N','N','N') +; + +-- Jul 12, 2022, 4:58:09 PM CEST +ALTER TABLE PA_DashboardContent ADD IsShowTitle CHAR(1) DEFAULT 'Y' CHECK (IsShowTitle IN ('Y','N')) NOT NULL +; + +-- Jul 12, 2022, 4:58:20 PM CEST +INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (207125,'Show Title',50010,215037,'Y',1,210,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-07-12 16:58:20','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-07-12 16:58:20','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','d0316669-2559-4a19-9eb9-0f2a5c704c6e','Y',200,2,2) +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, ColumnSpan=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=207125 +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=56504 +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200268 +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200260 +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202286 +; + +-- Jul 12, 2022, 4:59:01 PM CEST +UPDATE AD_Field SET DisplayLogic='@AD_Chart_ID@ > 0', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:59:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=207125 +; + diff --git a/migration/iD10/postgresql/202207121657_IDEMPIERE-5342.sql b/migration/iD10/postgresql/202207121657_IDEMPIERE-5342.sql new file mode 100644 index 0000000000..776171e91d --- /dev/null +++ b/migration/iD10/postgresql/202207121657_IDEMPIERE-5342.sql @@ -0,0 +1,43 @@ +-- IDEMPIERE-5342 +SELECT register_migration_script('202207121657_IDEMPIERE-5342.sql') FROM dual; + +-- Jul 12, 2022, 4:57:32 PM CEST +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,PrintName,EntityType,AD_Element_UU) VALUES (203626,0,0,'Y',TO_TIMESTAMP('2022-07-12 16:57:32','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-07-12 16:57:32','YYYY-MM-DD HH24:MI:SS'),0,'IsShowTitle','Show Title','Show Title','D','bf9b4ad5-68c4-4836-8af0-c4ca689bcc05') +; + +-- Jul 12, 2022, 4:58:05 PM CEST +INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (215037,0,'Show Title',50010,'IsShowTitle','Y',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2022-07-12 16:58:04','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-07-12 16:58:04','YYYY-MM-DD HH24:MI:SS'),0,203626,'Y','N','D','N','N','N','Y','425d1cae-6c95-4eef-a27b-eef7e9106e48','Y',0,'N','N','N','N') +; + +-- Jul 12, 2022, 4:58:09 PM CEST +ALTER TABLE PA_DashboardContent ADD COLUMN IsShowTitle CHAR(1) DEFAULT 'Y' CHECK (IsShowTitle IN ('Y','N')) NOT NULL +; + +-- Jul 12, 2022, 4:58:20 PM CEST +INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (207125,'Show Title',50010,215037,'Y',1,210,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2022-07-12 16:58:20','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2022-07-12 16:58:20','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','d0316669-2559-4a19-9eb9-0f2a5c704c6e','Y',200,2,2) +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, ColumnSpan=1, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=207125 +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=56504 +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200268 +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=200260 +; + +-- Jul 12, 2022, 4:58:32 PM CEST +UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202286 +; + +-- Jul 12, 2022, 4:59:01 PM CEST +UPDATE AD_Field SET DisplayLogic='@AD_Chart_ID@ > 0', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2022-07-12 16:59:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=207125 +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_PA_DashboardContent.java b/org.adempiere.base/src/org/compiere/model/I_PA_DashboardContent.java index 88a3934ebf..9845acba64 100644 --- a/org.adempiere.base/src/org/compiere/model/I_PA_DashboardContent.java +++ b/org.adempiere.base/src/org/compiere/model/I_PA_DashboardContent.java @@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair; /** Generated Interface for PA_DashboardContent * @author iDempiere (generated) - * @version Release 9 + * @version Release 10 */ public interface I_PA_DashboardContent { @@ -271,6 +271,15 @@ public interface I_PA_DashboardContent /** Get Show on Login */ public boolean isShowinLogin(); + /** Column name IsShowTitle */ + public static final String COLUMNNAME_IsShowTitle = "IsShowTitle"; + + /** Set Show Title */ + public void setIsShowTitle (boolean IsShowTitle); + + /** Get Show Title */ + public boolean isShowTitle(); + /** Column name Line */ public static final String COLUMNNAME_Line = "Line"; diff --git a/org.adempiere.base/src/org/compiere/model/X_PA_DashboardContent.java b/org.adempiere.base/src/org/compiere/model/X_PA_DashboardContent.java index 0ccaab1c82..c108dbe3d7 100644 --- a/org.adempiere.base/src/org/compiere/model/X_PA_DashboardContent.java +++ b/org.adempiere.base/src/org/compiere/model/X_PA_DashboardContent.java @@ -25,7 +25,7 @@ import org.compiere.util.KeyNamePair; /** Generated Model for PA_DashboardContent * @author iDempiere (generated) - * @version Release 9 - $Id$ */ + * @version Release 10 - $Id$ */ @org.adempiere.base.Model(table="PA_DashboardContent") public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent, I_Persistent { @@ -33,7 +33,7 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent, /** * */ - private static final long serialVersionUID = 20220116L; + private static final long serialVersionUID = 20220712L; /** Standard Constructor */ public X_PA_DashboardContent (Properties ctx, int PA_DashboardContent_ID, String trxName) @@ -49,6 +49,8 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent, // N setIsShowInDashboard (true); // 'Y' + setIsShowTitle (true); +// Y setName (null); setPA_DashboardContent_ID (0); } */ @@ -68,6 +70,8 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent, // N setIsShowInDashboard (true); // 'Y' + setIsShowTitle (true); +// Y setName (null); setPA_DashboardContent_ID (0); } */ @@ -427,6 +431,28 @@ public class X_PA_DashboardContent extends PO implements I_PA_DashboardContent, return false; } + /** Set Show Title. + @param IsShowTitle Show Title + */ + public void setIsShowTitle (boolean IsShowTitle) + { + set_Value (COLUMNNAME_IsShowTitle, Boolean.valueOf(IsShowTitle)); + } + + /** Get Show Title. + @return Show Title */ + public boolean isShowTitle() + { + Object oo = get_Value(COLUMNNAME_IsShowTitle); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Line No. @param Line Unique line for this document */ diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/IChartRendererService.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/IChartRendererService.java index 05363e6c12..032e88e7f8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/IChartRendererService.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/IChartRendererService.java @@ -51,7 +51,8 @@ public interface IChartRendererService { * @param width * @param height * @param chartModel + * @param showTitle * @return true if render successfully */ - public boolean renderChart(Component parent, int width, int height, ChartModel chartModel); + public boolean renderChart(Component parent, int width, int height, ChartModel chartModel, boolean showTitle); } \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/jfreegraph/ChartRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/jfreegraph/ChartRenderer.java index 03b2d38fac..4015520e8d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/jfreegraph/ChartRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/jfreegraph/ChartRenderer.java @@ -53,10 +53,14 @@ import org.zkoss.zul.Imagemap; * * @param panel * @param width + * @param height + * @param showTitle */ - public void render(Component parent, int width, int height) { + public void render(Component parent, int width, int height, boolean showTitle) { chartBuilder = new ChartBuilder(chartModel); JFreeChart chart = chartBuilder.createChart(); + if (!showTitle) + chart.setTitle(""); chart.getPlot().setForegroundAlpha(0.6f); ChartRenderingInfo info = new ChartRenderingInfo(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/jfreegraph/ChartRendererServiceImpl.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/jfreegraph/ChartRendererServiceImpl.java index c28c46fe71..44299c0e10 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/jfreegraph/ChartRendererServiceImpl.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/jfreegraph/ChartRendererServiceImpl.java @@ -169,10 +169,9 @@ public class ChartRendererServiceImpl implements IChartRendererService { } @Override - public boolean renderChart(Component parent, int width, int height, - ChartModel chartModel) { + public boolean renderChart(Component parent, int width, int height, ChartModel chartModel, boolean showTitle) { ChartRenderer renderer = new ChartRenderer(chartModel.chart); - renderer.render(parent, width, height); + renderer.render(parent, width, height, showTitle); return true; } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java index a94dd2a4d3..674520dcf7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java @@ -553,7 +553,7 @@ public class DashboardController implements EventListener { chartPanel.getChildren().clear(); ChartModel model = new ChartModel(); model.chart = chartModel; - renderChart(chartPanel, width, height, model); + renderChart(chartPanel, width, height, model, dc.isShowTitle()); } }); } @@ -1125,10 +1125,10 @@ public class DashboardController implements EventListener { } } - private void renderChart(final Div chartPanel, int width, int height, ChartModel model) { + private void renderChart(final Div chartPanel, int width, int height, ChartModel model, boolean showTitle) { List list = Extensions.getChartRendererServices(); for (IChartRendererService renderer : list) { - if (renderer.renderChart(chartPanel, width, height, model)) + if (renderer.renderChart(chartPanel, width, height, model, showTitle)) break; } } 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 1e57e01907..00310825a6 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 @@ -85,7 +85,7 @@ public class WChartEditor extends WEditor model.chart = chartModel; List list = Extensions.getChartRendererServices(); for (IChartRendererService renderer : list) { - if (renderer.renderChart(chartDiv, chartWidth, chartHeight, model)) + if (renderer.renderChart(chartDiv, chartWidth, chartHeight, model, true)) break; } } @@ -175,7 +175,7 @@ public class WChartEditor extends WEditor model.chart = chartModel; List list = Extensions.getChartRendererServices(); for (IChartRendererService renderer : list) { - if (renderer.renderChart(chartDiv, chartWidth, chartHeight, model)) + if (renderer.renderChart(chartDiv, chartWidth, chartHeight, model, true)) break; } }