From 16c46701c8be99f9758de724158eaf2323d8c93d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 31 May 2013 17:37:25 -0500 Subject: [PATCH 01/16] IDEMPIERE-942 Duplicate Attribute Use showing wrong message for user --- org.adempiere.base/src/org/compiere/model/MAttributeUse.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeUse.java b/org.adempiere.base/src/org/compiere/model/MAttributeUse.java index ad99de46db..fdaccf875c 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeUse.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeUse.java @@ -69,6 +69,8 @@ public class MAttributeUse extends X_M_AttributeUse */ protected boolean afterSave (boolean newRecord, boolean success) { + if (!success) + return success; // also used for afterDelete StringBuilder sql = new StringBuilder("UPDATE M_AttributeSet mas") .append(" SET IsInstanceAttribute='Y' ") From a61ba2846cfd28eaa87eb733bcb106652daec98c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 31 May 2013 17:38:20 -0500 Subject: [PATCH 02/16] IDEMPIERE-989 decimal display is not consistent --- .../src/org/adempiere/webui/editor/WNumberEditor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java index 17039b22c1..ce363f4688 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java @@ -30,6 +30,7 @@ import org.adempiere.webui.window.WFieldRecordInfo; import org.compiere.model.GridField; import org.compiere.util.DisplayType; import org.compiere.util.Env; +import org.compiere.util.Language; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Events; @@ -134,8 +135,12 @@ public class WNumberEditor extends WEditor implements ContextMenuListener displayType = DisplayType.Integer; else if (!DisplayType.isNumeric(displayType)) displayType = DisplayType.Number; - DecimalFormat format = DisplayType.getNumberFormat(displayType, AEnv.getLanguage(Env.getCtx())); + // IDEMPIERE-989 + Language lang = AEnv.getLanguage(Env.getCtx()); + DecimalFormat format = DisplayType.getNumberFormat(displayType, lang); getComponent().getDecimalbox().setFormat(format.toPattern()); + getComponent().getDecimalbox().setLocale(lang.getLocale()); + getComponent().setFormat(format); popupMenu = new WEditorPopupMenu(false, false, isShowPreference()); addChangeLogMenu(popupMenu); From 6d7fb18ed27bfafc006a0f6bdbfe3ea15484cdd2 Mon Sep 17 00:00:00 2001 From: Richard Morales Date: Fri, 31 May 2013 17:55:26 -0500 Subject: [PATCH 03/16] IDEMPIERE-908 Cannot report on window Product Costs / Team work between Richard, Juan and Carlos --- .../org/compiere/model/AccessSqlParser.java | 29 ++++++++++++++++++- .../src/org/compiere/model/GridTab.java | 14 ++++----- .../src/org/compiere/model/GridTable.java | 15 +++++----- .../webui/panel/action/ReportAction.java | 28 ++++++++++++++++-- 4 files changed, 69 insertions(+), 17 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java b/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java index f1c8cbb8e0..10c711ba58 100644 --- a/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java +++ b/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java @@ -238,7 +238,7 @@ public class AccessSqlParser index = from.indexOf(ON); while (index != -1) { - int indexClose = from.indexOf(')'); // does not catch "IN (1,2)" in ON + int indexClose = getIndexClose(from); // does not catch "IN (1,2)" in ON int indexNextOn = from.indexOf(ON, index+4); if (indexNextOn != -1) indexClose = from.lastIndexOf(')', indexNextOn); @@ -383,6 +383,33 @@ public class AccessSqlParser } return ""; } // getMainSql + + /** + * Get index of ')' + * @return index of ')' + */ + public int getIndexClose(String from) + { + int parenthesisLevel = 0; + int indexOpen=from.indexOf('('); + int index=-1; + while(indexOpen!=-1) + { + parenthesisLevel++; + int indexNextOpen = from.indexOf('(', indexOpen+1); + int indexClose = from.indexOf(')',indexOpen+1); + if (indexNextOpen==-1 || indexClose0) + { + index = from.indexOf(')',index+1); + parenthesisLevel--; + } + return index; + } /** * Table Info VO diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 2aef26f077..da93807ec8 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -111,7 +111,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * */ - private static final long serialVersionUID = -1638364577972806113L; + private static final long serialVersionUID = -4022944302529684348L; public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate"; @@ -785,20 +785,20 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (query.getRestrictionCount() != 1) { if (log.isLoggable(Level.FINE)) log.fine("Ignored(More than 1 Restriction): " + query); - return query.getWhereClause(); + return query.getWhereClause(true); } String colName = query.getColumnName(0); if (colName == null) { if (log.isLoggable(Level.FINE)) log.fine("Ignored(No Column): " + query); - return query.getWhereClause(); + return query.getWhereClause(true); } // a '(' in the name = function - don't try to resolve if (colName.indexOf('(') != -1) { if (log.isLoggable(Level.FINE)) log.fine("Ignored(Function): " + colName); - return query.getWhereClause(); + return query.getWhereClause(true); } // OK - Query is valid @@ -806,7 +806,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (getField(colName) != null) { if (log.isLoggable(Level.FINE)) log.fine("Field Found: " + colName); - return query.getWhereClause(); + return query.getWhereClause(true); } String refColName = null; @@ -845,7 +845,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (getField(refColName) != null) { if (log.isLoggable(Level.FINE)) log.fine("Column " + colName + " replaced with " + refColName); - return query.getWhereClause(); + return query.getWhereClause(true); } colName = refColName; } @@ -897,7 +897,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (log.isLoggable(Level.INFO)) log.info ("Not successfull - Column=" + colName + ", Key=" + tabKeyColumn + ", Query=" + query); - return query.getWhereClause(); + return query.getWhereClause(true); } query.setTableName("xx"); diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 3edd09bed1..ab1c166058 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -100,7 +100,7 @@ public class GridTable extends AbstractTableModel /** * */ - private static final long serialVersionUID = 5782826500266625861L; + private static final long serialVersionUID = -2181155164268688340L; public static final String DATA_REFRESH_MESSAGE = "Refreshed"; @@ -2270,6 +2270,7 @@ public class GridTable extends AbstractTableModel int size = m_fields.size(); StringBuffer singleRowWHERE = null; StringBuffer multiRowWHERE = null; + String tableName = getTableName(); for (int col = 0; col < size; col++) { GridField field = (GridField)m_fields.get (col); @@ -2283,10 +2284,10 @@ public class GridTable extends AbstractTableModel return null; } if (columnName.endsWith ("_ID")) - singleRowWHERE = new StringBuffer(columnName) + singleRowWHERE = new StringBuffer(tableName).append(".").append(columnName) .append ("=").append (value); else - singleRowWHERE = new StringBuffer(columnName) + singleRowWHERE = new StringBuffer(tableName).append(".").append(columnName) .append ("=").append (DB.TO_STRING(value.toString())); } else if (field.isParentColumn()) @@ -2303,10 +2304,10 @@ public class GridTable extends AbstractTableModel else multiRowWHERE.append(" AND "); if (columnName.endsWith ("_ID")) - multiRowWHERE.append (columnName) + multiRowWHERE.append (tableName).append(".").append(columnName) .append ("=").append (value); else - multiRowWHERE.append (columnName) + multiRowWHERE.append (tableName).append(".").append(columnName) .append ("=").append (DB.TO_STRING(value.toString())); } } // for all columns @@ -2889,13 +2890,13 @@ public class GridTable extends AbstractTableModel close(false); if (retainedWhere != null) { - String whereClause = m_whereClause; + // String whereClause = m_whereClause; if (m_whereClause != null && m_whereClause.trim().length() > 0) { m_whereClause = "((" + m_whereClause + ") OR (" + retainedWhere + ")) "; } open(m_maxRows); - m_whereClause = whereClause; + // m_whereClause = whereClause; } else { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/ReportAction.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/ReportAction.java index 9d4b7cca60..ef75c0f4e8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/ReportAction.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/ReportAction.java @@ -247,21 +247,45 @@ public class ReportAction implements EventListener int Record_ID = 0; int[] RecordIDs = null; MQuery query = new MQuery(gridTab.getTableName()); + String whereClause; + if (currentRowOnly) { Record_ID = gridTab.getRecord_ID(); - query.addRestriction(query.getTableName() + "_ID", MQuery.EQUAL, Record_ID); + whereClause = gridTab.getTableModel().getWhereClause(gridTab.getCurrentRow()); + if (whereClause==null) + whereClause = gridTab.getTableModel().getSelectWhereClause(); + } else { + whereClause = gridTab.getTableModel().getSelectWhereClause(); RecordIDs = new int[gridTab.getRowCount()]; for(int i = 0; i < gridTab.getRowCount(); i++) { RecordIDs[i] = gridTab.getKeyID(i); - query.addRestriction(query.getTableName() + "." + query.getTableName() + "_ID" + MQuery.EQUAL + RecordIDs[i], false, 0); + } + } + + if (whereClause!=null && whereClause.length() > 0) + { + if (whereClause.indexOf('@') != -1) //replace variables in context + { + String context = Env.parseContext(Env.getCtx(), panel.getWindowNo(), whereClause, false); + if(context != null && context.trim().length() > 0) + { + whereClause = context; + } + else + { + log.log(Level.WARNING, "Failed to parse where clause. whereClause= "+whereClause); + whereClause = ("1 = 2"); + } } } + query.addRestriction(whereClause); + PrintInfo info = new PrintInfo(pf.getName(), pf.getAD_Table_ID(), Record_ID); info.setDescription(query.getInfo()); From 1a54f69c3471d39e528c099d3bd853882c8dc4c4 Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Thu, 16 May 2013 18:53:38 +0530 Subject: [PATCH 04/16] IDEMPIERE-925 Date field shows error for incorrect format but allow user to proceed on ok button --- .../adempiere/webui/window/FindWindow.java | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 23bc367769..8149afc0b7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -29,6 +29,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; +import java.util.Date; import java.util.Hashtable; import java.util.Iterator; import java.util.List; @@ -43,6 +44,7 @@ import org.adempiere.webui.component.Column; import org.adempiere.webui.component.Columns; import org.adempiere.webui.component.Combobox; import org.adempiere.webui.component.ConfirmPanel; +import org.adempiere.webui.component.DatetimeBox; import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.ListCell; @@ -96,6 +98,7 @@ import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; import org.zkoss.zul.South; @@ -1331,7 +1334,24 @@ public class FindWindow extends Window implements EventListener, ValueCha // Value ****** ListCell cellQueryFrom = (ListCell)row.getFellow("cellQueryFrom"+row.getId()); - Object value = cellQueryFrom.getAttribute("value"); + Object value = null; + + //Allowing Date validation before save + List compoList = cellQueryFrom.getChildren(); + if(compoList.get(0) instanceof Datebox) { + Datebox dbox = (Datebox)compoList.get(0); + if(dbox.getValue() != null) + value = new Timestamp(((Date)dbox.getValue()).getTime()); + } + else if(compoList.get(0) instanceof DatetimeBox) { + DatetimeBox dtbox = (DatetimeBox)compoList.get(0); + if(dtbox.getValue() != null) + value = new Timestamp(((Date)dtbox.getValue()).getTime()); + } + else { + value = cellQueryFrom.getAttribute("value"); + } + if (value == null) { if(Operator.equals(MQuery.NULL) || Operator.equals(MQuery.NOT_NULL)) @@ -1369,6 +1389,24 @@ public class FindWindow extends Window implements EventListener, ValueCha if (MQuery.OPERATORS[MQuery.BETWEEN_INDEX].getValue().equals(Operator)) { ListCell cellQueryTo = (ListCell)row.getFellow("cellQueryTo"+row.getId()); + + //Allowing Date validation before save + compoList = cellQueryTo.getChildren(); + if(compoList.get(0) instanceof Datebox) { + Datebox dbox = (Datebox)compoList.get(0); + if(dbox.getValue() != null) + value2 = new Timestamp(((Date)dbox.getValue()).getTime()); + } + else if(compoList.get(0) instanceof DatetimeBox) { + DatetimeBox dtbox = (DatetimeBox)compoList.get(0); + if(dtbox.getValue() != null) + value2 = new Timestamp(((Date)dtbox.getValue()).getTime()); + } + else { + value2 = cellQueryFrom.getAttribute("value"); + } + + value2 = cellQueryTo.getAttribute("value"); if (value2 == null) continue; From e11d43b05909852bade74ac70d7414a7289e8f55 Mon Sep 17 00:00:00 2001 From: Juan David Arboleda Date: Fri, 31 May 2013 18:06:48 -0500 Subject: [PATCH 05/16] IDEMPIERE-925 Date field shows error for incorrect format but allow user to proceed on ok button / peer review --- .../adempiere/webui/window/FindWindow.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 8149afc0b7..0b20d2518b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -1337,16 +1337,16 @@ public class FindWindow extends Window implements EventListener, ValueCha Object value = null; //Allowing Date validation before save - List compoList = cellQueryFrom.getChildren(); - if(compoList.get(0) instanceof Datebox) { - Datebox dbox = (Datebox)compoList.get(0); - if(dbox.getValue() != null) - value = new Timestamp(((Date)dbox.getValue()).getTime()); + Component compo = cellQueryFrom.getFirstChild(); + if(compo instanceof Datebox) { + Datebox dbox = (Datebox)compo; + if(dbox.getValue() != null) + value = new Timestamp(((Date)dbox.getValue()).getTime()); } - else if(compoList.get(0) instanceof DatetimeBox) { - DatetimeBox dtbox = (DatetimeBox)compoList.get(0); - if(dtbox.getValue() != null) - value = new Timestamp(((Date)dtbox.getValue()).getTime()); + else if(compo instanceof DatetimeBox) { + DatetimeBox dtbox = (DatetimeBox)compo; + if(dtbox.getValue() != null) + value = new Timestamp(((Date)dtbox.getValue()).getTime()); } else { value = cellQueryFrom.getAttribute("value"); @@ -1391,16 +1391,16 @@ public class FindWindow extends Window implements EventListener, ValueCha ListCell cellQueryTo = (ListCell)row.getFellow("cellQueryTo"+row.getId()); //Allowing Date validation before save - compoList = cellQueryTo.getChildren(); - if(compoList.get(0) instanceof Datebox) { - Datebox dbox = (Datebox)compoList.get(0); - if(dbox.getValue() != null) - value2 = new Timestamp(((Date)dbox.getValue()).getTime()); + compo = cellQueryTo.getFirstChild(); + if(compo instanceof Datebox) { + Datebox dbox = (Datebox)compo; + if(dbox.getValue() != null) + value2 = new Timestamp(((Date)dbox.getValue()).getTime()); } - else if(compoList.get(0) instanceof DatetimeBox) { - DatetimeBox dtbox = (DatetimeBox)compoList.get(0); - if(dtbox.getValue() != null) - value2 = new Timestamp(((Date)dtbox.getValue()).getTime()); + else if(compo instanceof DatetimeBox) { + DatetimeBox dtbox = (DatetimeBox)compo; + if(dtbox.getValue() != null) + value2 = new Timestamp(((Date)dtbox.getValue()).getTime()); } else { value2 = cellQueryFrom.getAttribute("value"); From 829583bd28594535147a99b479010c2e6398f324 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 1 Jun 2013 10:11:26 -0500 Subject: [PATCH 06/16] IDEMPIERE-1004 Account Info title translation --- .../oracle/201306011007_IDEMPIERE-1004.sql | 13 +++++++++++++ .../postgresql/201306011007_IDEMPIERE-1004.sql | 13 +++++++++++++ .../src/org/adempiere/webui/acct/WAcctViewer.java | 4 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 migration/i1.0b-release/oracle/201306011007_IDEMPIERE-1004.sql create mode 100644 migration/i1.0b-release/postgresql/201306011007_IDEMPIERE-1004.sql diff --git a/migration/i1.0b-release/oracle/201306011007_IDEMPIERE-1004.sql b/migration/i1.0b-release/oracle/201306011007_IDEMPIERE-1004.sql new file mode 100644 index 0000000000..3c4dd81027 --- /dev/null +++ b/migration/i1.0b-release/oracle/201306011007_IDEMPIERE-1004.sql @@ -0,0 +1,13 @@ +-- Jun 1, 2013 10:06:30 AM COT +-- IDEMPIERE-1004 Account Info title translation +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('I','Posting',200177,'D','fa29733a-5b1d-44b4-b1e1-875e3fb18e4f','Posting','Y',TO_DATE('2013-06-01 10:06:28','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_DATE('2013-06-01 10:06:28','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Jun 1, 2013 10:06:30 AM COT +-- IDEMPIERE-1004 Account Info title translation +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200177 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +SELECT register_migration_script('201306011007_IDEMPIERE-1004.sql') FROM dual +; + diff --git a/migration/i1.0b-release/postgresql/201306011007_IDEMPIERE-1004.sql b/migration/i1.0b-release/postgresql/201306011007_IDEMPIERE-1004.sql new file mode 100644 index 0000000000..76f39cd6f3 --- /dev/null +++ b/migration/i1.0b-release/postgresql/201306011007_IDEMPIERE-1004.sql @@ -0,0 +1,13 @@ +-- Jun 1, 2013 10:06:30 AM COT +-- IDEMPIERE-1004 Account Info title translation +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('I','Posting',200177,'D','fa29733a-5b1d-44b4-b1e1-875e3fb18e4f','Posting','Y',TO_TIMESTAMP('2013-06-01 10:06:28','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_TIMESTAMP('2013-06-01 10:06:28','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Jun 1, 2013 10:06:30 AM COT +-- IDEMPIERE-1004 Account Info title translation +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200177 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +SELECT register_migration_script('201306011007_IDEMPIERE-1004.sql') FROM dual +; + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java index c749d1a17a..e06ea7fee6 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java @@ -583,7 +583,7 @@ public class WAcctViewer extends Window implements EventListener southPanel.setVflex("1"); southPanel.setHflex("1"); - this.setTitle(TITLE); + this.setTitle(Msg.getMsg(Env.getCtx(), TITLE)); this.setClosable(true); this.setStyle("position: absolute; width: 100%; height: 100%;"); this.setSizable(true); @@ -770,7 +770,7 @@ public class WAcctViewer extends Window implements EventListener RModelExcelExporter exporter = new RModelExcelExporter(m_rmodel); File file; try { - file = new File(FileUtil.getTempMailName(TITLE, ".xls")); + file = new File(FileUtil.getTempMailName(Msg.getMsg(Env.getCtx(), TITLE), ".xls")); exporter.export(file, Env.getLanguage(Env.getCtx())); Filedownload.save(file, "application/vnd.ms-excel"); } catch (Exception e) { From fb4dfe08bd857ba050c0815f615c5a97cafb4f80 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 1 Jun 2013 10:52:05 -0500 Subject: [PATCH 07/16] IDEMPIERE-1006 Improve transaction and busy dialog for merge window --- .../org/adempiere/webui/apps/form/WMerge.java | 9 ++---- .../src/org/compiere/apps/form/Merge.java | 31 ++++++------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WMerge.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WMerge.java index 9f23b9eb62..e5aa7e3b8d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WMerge.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WMerge.java @@ -77,7 +77,6 @@ public class WMerge extends Merge implements IFormController, EventListener Date: Sat, 1 Jun 2013 11:15:54 -0500 Subject: [PATCH 08/16] IDEMPIERE-1001 Cannot correct Inventory (MA) Message IMPROVEMENT --- .../src/org/compiere/model/MInOut.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 8d87f8e52d..3439a78d8e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1352,7 +1352,6 @@ public class MInOut extends X_M_InOut implements DocAction orderedDiff = ma.getMovementQty().negate(); } - // Update Storage - see also VMatch.createMatchRecord if (!MStorageOnHand.add(getCtx(), getM_Warehouse_ID(), sLine.getM_Locator_ID(), @@ -1362,7 +1361,7 @@ public class MInOut extends X_M_InOut implements DocAction get_TrxName())) { String lastError = CLogger.retrieveErrorString(""); - m_processMsg = "Cannot correct Inventory OnHand (MA) - " + lastError; + m_processMsg = "Cannot correct Inventory OnHand (MA) [" + product.getValue() + "] - " + lastError; return DocAction.STATUS_Invalid; } if (sameWarehouse && reservedDiff.signum() != 0) { @@ -1374,7 +1373,7 @@ public class MInOut extends X_M_InOut implements DocAction get_TrxName())) { String lastError = CLogger.retrieveErrorString(""); - m_processMsg = "Cannot correct Inventory Reserved (MA) - " + lastError; + m_processMsg = "Cannot correct Inventory Reserved (MA) [" + product.getValue() + "] - " + lastError; return DocAction.STATUS_Invalid; } } @@ -1387,7 +1386,7 @@ public class MInOut extends X_M_InOut implements DocAction get_TrxName())) { String lastError = CLogger.retrieveErrorString(""); - m_processMsg = "Cannot correct Inventory Ordered (MA) - " + lastError; + m_processMsg = "Cannot correct Inventory Ordered (MA) [" + product.getValue() + "] - " + lastError; return DocAction.STATUS_Invalid; } } @@ -1401,7 +1400,7 @@ public class MInOut extends X_M_InOut implements DocAction ma.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, reservedDiff, true, get_TrxName())) { - m_processMsg = "Cannot correct Inventory Reserved (MA) in order warehouse"; + m_processMsg = "Cannot correct Inventory Reserved (MA) in order warehouse [" + product.getValue() + "]"; return DocAction.STATUS_Invalid; } } @@ -1411,7 +1410,7 @@ public class MInOut extends X_M_InOut implements DocAction ma.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, orderedDiff, false, get_TrxName())) { - m_processMsg = "Cannot correct Inventory Ordered (MA) in order warehouse"; + m_processMsg = "Cannot correct Inventory Ordered (MA) in order warehouse [" + product.getValue() + "]"; return DocAction.STATUS_Invalid; } @@ -1425,7 +1424,7 @@ public class MInOut extends X_M_InOut implements DocAction mtrx.setM_InOutLine_ID(sLine.getM_InOutLine_ID()); if (!mtrx.save()) { - m_processMsg = "Could not create Material Transaction (MA)"; + m_processMsg = "Could not create Material Transaction (MA) [" + product.getValue() + "]"; return DocAction.STATUS_Invalid; } } @@ -1444,7 +1443,7 @@ public class MInOut extends X_M_InOut implements DocAction Qty, get_TrxName())) { String lastError = CLogger.retrieveErrorString(""); - m_processMsg = "Cannot correct Inventory OnHand - " + lastError; + m_processMsg = "Cannot correct Inventory OnHand [" + product.getValue() + "] - " + lastError; return DocAction.STATUS_Invalid; } if (reservedDiff.signum() != 0) { @@ -1453,7 +1452,7 @@ public class MInOut extends X_M_InOut implements DocAction sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, reservedDiff, true, get_TrxName())) { - m_processMsg = "Cannot correct Inventory Reserved"; + m_processMsg = "Cannot correct Inventory Reserved [" + product.getValue() + "]"; return DocAction.STATUS_Invalid; } } @@ -1463,7 +1462,7 @@ public class MInOut extends X_M_InOut implements DocAction sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, orderedDiff, false, get_TrxName())) { - m_processMsg = "Cannot correct Inventory Ordered"; + m_processMsg = "Cannot correct Inventory Ordered [" + product.getValue() + "]"; return DocAction.STATUS_Invalid; } } @@ -1477,7 +1476,7 @@ public class MInOut extends X_M_InOut implements DocAction sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, QtySO.negate(), true, get_TrxName())) { - m_processMsg = "Cannot correct Inventory Reserved"; + m_processMsg = "Cannot correct Inventory Reserved [" + product.getValue() + "]"; return DocAction.STATUS_Invalid; } } @@ -1487,7 +1486,7 @@ public class MInOut extends X_M_InOut implements DocAction sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, QtyPO.negate(), false, get_TrxName())) { - m_processMsg = "Cannot correct Inventory Ordered"; + m_processMsg = "Cannot correct Inventory Ordered [" + product.getValue() + "]"; return DocAction.STATUS_Invalid; } } @@ -1500,7 +1499,7 @@ public class MInOut extends X_M_InOut implements DocAction mtrx.setM_InOutLine_ID(sLine.getM_InOutLine_ID()); if (!mtrx.save()) { - m_processMsg = CLogger.retrieveErrorString("Could not create Material Transaction"); + m_processMsg = CLogger.retrieveErrorString("Could not create Material Transaction [" + product.getValue() + "]"); return DocAction.STATUS_Invalid; } } From 2bbff2bf5c63ee8806ede8ef239c1afd5d59a72a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 1 Jun 2013 11:50:56 -0500 Subject: [PATCH 09/16] IDEMPIERE-993 Upgrade upload button on Image fields to zk6 --- .../webui/factory/ButtonFactory.java | 8 ++---- .../webui/install/WTranslationDialog.java | 3 ++- .../adempiere/webui/window/WImageDialog.java | 27 +++++-------------- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/ButtonFactory.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/ButtonFactory.java index e69db584f0..5d5e7a4976 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/ButtonFactory.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/ButtonFactory.java @@ -68,12 +68,8 @@ public class ButtonFactory { { Button button = new Button(); button.setName("btn"+name); - - String text = Msg.translate(Env.getCtx(), name); - if (!name.equals(text)) - text = text.replaceAll("[&]", ""); - else - text = null; + + String text = Util.cleanAmp(Msg.translate(Env.getCtx(), name)); if (withText && text != null) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/install/WTranslationDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/install/WTranslationDialog.java index 02d314063e..3e078fd993 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/install/WTranslationDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/install/WTranslationDialog.java @@ -26,6 +26,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import org.adempiere.exceptions.AdempiereException; +import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.FolderBrowser; @@ -128,7 +129,7 @@ public class WTranslationDialog extends TranslationController implements IFormCo bImport.setLabel(Msg.getMsg(Env.getCtx(), "Import")); bImport.addActionListener(this); bImportZIP.setLabel(Msg.getMsg(Env.getCtx(), "ImportZIP")); - bImportZIP.setUpload("true"); + bImportZIP.setUpload(AdempiereWebUI.getUploadSetting()); bImportZIP.addEventListener(Events.ON_UPLOAD, this); Rows rows = centerLayout.newRows(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WImageDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WImageDialog.java index cfc401b4db..a1039b3c79 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WImageDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WImageDialog.java @@ -38,11 +38,10 @@ import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.UploadEvent; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; -import org.zkoss.zul.North; -import org.zkoss.zul.South; -import org.zkoss.zul.Fileupload; import org.zkoss.zul.Image; +import org.zkoss.zul.North; import org.zkoss.zul.Separator; +import org.zkoss.zul.South; /** * Base on the original Swing Image Dialog. @@ -57,7 +56,7 @@ public class WImageDialog extends Window implements EventListener /** * */ - private static final long serialVersionUID = 4253571652070223072L; + private static final long serialVersionUID = -5048907034691374834L; /** * Constructor @@ -147,9 +146,10 @@ public class WImageDialog extends Window implements EventListener south.setStyle("background-color: transparent; border: none;"); south.setParent(mainLayout); south.appendChild(confirmPanel); - + // - fileButton.addEventListener(Events.ON_CLICK, this); + fileButton.setUpload(AdempiereWebUI.getUploadSetting()); + fileButton.addEventListener(Events.ON_UPLOAD, this); confirmPanel.addActionListener(Events.ON_CLICK, this); addEventListener(Events.ON_UPLOAD, this); @@ -161,10 +161,6 @@ public class WImageDialog extends Window implements EventListener UploadEvent ue = (UploadEvent) e; processUploadMedia(ue.getMedia()); } - else if (e.getTarget() == fileButton) - { - cmd_file(); - } else if (e.getTarget().getId().equals(ConfirmPanel.A_OK)) { if (image.getContent() != null) @@ -196,17 +192,6 @@ public class WImageDialog extends Window implements EventListener public boolean isCancel() { return cancel; } - - /** - * Load file & display - */ - private void cmd_file() - { - // Show File Open Dialog - Media media = Fileupload.get(); - if (AdempiereWebUI.isEventThreadEnabled()) - processUploadMedia(media); - } // cmd_file private void processUploadMedia(Media imageFile) { if (imageFile == null) From f24ff19805d581013598c74069956833b1c6239b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 1 Jun 2013 15:17:02 -0500 Subject: [PATCH 10/16] IDEMPIERE-985 NPE In Callout for Payment Window --- .../src/org/compiere/model/CalloutPayment.java | 14 ++++++++++++-- .../compiere/model/CalloutPaymentAllocate.java | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java index 312e495fec..34a5a9d048 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java @@ -363,14 +363,24 @@ public class CalloutPayment extends CalloutEngine + ", C_Currency_ID=" + C_Currency_Invoice_ID); // Get Info from Tab BigDecimal PayAmt = (BigDecimal)mTab.getValue ("PayAmt"); + if (PayAmt == null) + PayAmt = Env.ZERO; BigDecimal DiscountAmt = (BigDecimal)mTab.getValue ("DiscountAmt"); + if (DiscountAmt == null) + DiscountAmt = Env.ZERO; BigDecimal WriteOffAmt = (BigDecimal)mTab.getValue ("WriteOffAmt"); + if (WriteOffAmt == null) + WriteOffAmt = Env.ZERO; BigDecimal OverUnderAmt = (BigDecimal)mTab.getValue ("OverUnderAmt"); + if (OverUnderAmt == null) + OverUnderAmt = Env.ZERO; if (log.isLoggable(Level.FINE)) log.fine ("Pay=" + PayAmt + ", Discount=" + DiscountAmt + ", WriteOff=" + WriteOffAmt + ", OverUnderAmt=" + OverUnderAmt); // Get Currency Info - int C_Currency_ID = ((Integer)mTab.getValue ("C_Currency_ID")) - .intValue (); + Integer curr_int = (Integer) mTab.getValue ("C_Currency_ID"); + if (curr_int == null) + curr_int = Integer.valueOf(0); + int C_Currency_ID = curr_int.intValue (); MCurrency currency = MCurrency.get (ctx, C_Currency_ID); Timestamp ConvDate = (Timestamp)mTab.getValue ("DateTrx"); int C_ConversionType_ID = 0; diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java index 9982b85f21..30d5ff6c21 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java @@ -151,10 +151,18 @@ public class CalloutPaymentAllocate extends CalloutEngine if (C_Invoice_ID == 0) return ""; // Get Info from Tab - BigDecimal Amount = (BigDecimal)mTab.getValue("Amount"); - BigDecimal DiscountAmt = (BigDecimal)mTab.getValue("DiscountAmt"); - BigDecimal WriteOffAmt = (BigDecimal)mTab.getValue("WriteOffAmt"); - BigDecimal OverUnderAmt = (BigDecimal)mTab.getValue("OverUnderAmt"); + BigDecimal Amount = (BigDecimal)mTab.getValue ("Amount"); + if (Amount == null) + Amount = Env.ZERO; + BigDecimal DiscountAmt = (BigDecimal)mTab.getValue ("DiscountAmt"); + if (DiscountAmt == null) + DiscountAmt = Env.ZERO; + BigDecimal WriteOffAmt = (BigDecimal)mTab.getValue ("WriteOffAmt"); + if (WriteOffAmt == null) + WriteOffAmt = Env.ZERO; + BigDecimal OverUnderAmt = (BigDecimal)mTab.getValue ("OverUnderAmt"); + if (OverUnderAmt == null) + OverUnderAmt = Env.ZERO; BigDecimal InvoiceAmt = (BigDecimal)mTab.getValue("InvoiceAmt"); if (log.isLoggable(Level.FINE)) log.fine("Amt=" + Amount + ", Discount=" + DiscountAmt + ", WriteOff=" + WriteOffAmt + ", OverUnder=" + OverUnderAmt From 77cd656f07962225914b91242caffdffd3bde8f9 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 1 Jun 2013 15:36:24 -0500 Subject: [PATCH 11/16] IDEMPIERE-1008 Missing icon in Role/User Assignment - IDEMPIERE-724 --- .../org/adempiere/webui/editor/WSearchEditor.java | 2 +- .../theme/default/images/Location16.png | Bin 0 -> 372 bytes .../theme/default/images/Locator16.png | Bin 0 -> 224 bytes .../theme/default/images/PickOpen16.png | Bin 0 -> 947 bytes 4 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 org.adempiere.ui.zk/theme/default/images/Location16.png create mode 100644 org.adempiere.ui.zk/theme/default/images/Locator16.png create mode 100644 org.adempiere.ui.zk/theme/default/images/PickOpen16.png diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java index 35c3fc2874..e6ddf4ee8c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java @@ -170,7 +170,6 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value { columnName = this.getColumnName(); - imageUrl = ThemeManager.getThemeResource("images/PickOpen16.png"); if (columnName.equals("C_BPartner_ID")) { popupMenu = new WEditorPopupMenu(true, true, isShowPreference(), true, true, false, lookup); @@ -184,6 +183,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value else { popupMenu = new WEditorPopupMenu(true, true, isShowPreference(), false, false, false, lookup); + imageUrl = ThemeManager.getThemeResource("images/PickOpen16.png"); } getComponent().getButton().setImage(imageUrl); diff --git a/org.adempiere.ui.zk/theme/default/images/Location16.png b/org.adempiere.ui.zk/theme/default/images/Location16.png new file mode 100644 index 0000000000000000000000000000000000000000..b7a50d3fb240af7ffc9042f82d1eaf310938396c GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf67>k44ofy`glX(f`FeQ1ryDWIJRj{cYfIC<^cH<*bJ1g$9i2jcJ9e0+_ot^gMKUuPR(ge*7%EG%cU*yhO zU=+YLtLRKt*GzWX6p6@9>8|&uM)Tgjc67yakD$ZdzS7fdtqa#J&Gp{l*ZK3Y8i P7zPZUu6{1-oD!M&x$KAd9gi$S;_|;n|He5GTpo-G!lpRn`N@;VkfoEM{Qf z76xHPhFNnYfP(BLp1!W^ci9+4M2?+uW+HHm+tUbMkl1Z679I-dHFpF|**l|FTp(=szfy&40$ACsKc)I$ztaD0e F0ss-)Iu8H< literal 0 HcmV?d00001 diff --git a/org.adempiere.ui.zk/theme/default/images/PickOpen16.png b/org.adempiere.ui.zk/theme/default/images/PickOpen16.png new file mode 100644 index 0000000000000000000000000000000000000000..5364d53d60aabecaed5eb0058f243cc8c36fe568 GIT binary patch literal 947 zcmV;k15EshP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*n% z6dN_MA~S&i00T2gL_t(I%UzPaj~hiChToar?DyKfbL=zbawHK7A|EdJ5FvMTiRh6K z4Fv@X6f{BMzaT=QL`so{Btk+dQiFmZK0pz0L?9$|LW;RWzVp}G-ksf@*%^v(6g>U& z7LQ&A0KNC&#}S=!g!5JyMi=Y#`YG3SBV$dqm@j5&mVGmy&%Z27eD&*R7~)?xuLw}@ z65?8o&O}l8diUw>*4k68XPaxaI9O%m)hxo;hv&Q8A(w=})IX`F?H3?NKLZ-H)sb9=!(v|j(4qI zi>7%YCI9YYJ=GeI08Fg46Cxr_aqML zF`p}~gf(but&fn$5O^^>9z!M?$!zg(zD#cBg}ftk{S$3o5!l$|7;GCP4`A#uH37?0 z4juz&`<@>=2)He&TFkOX$t?MLwwT=7{af$sUWXL;9}jOpb}!@JbUwBgI(MD5w-qx- zRH1`tVW%xxU0e~HfTOT<9fO}UJ0ATG+M9-b@U#>?h?*UjhmEO%udF#(X zy1jP;%R}eC1{>!&0N|M|2ZMfv^mnMvOM09a%Z|*KV_9T7rBdJiaShWavI}c1{sBGp VjRrPM1epK;002ovPDHLkV1hFIoP+=X literal 0 HcmV?d00001 From 1b24942054248e6e31a102ffc57c79a2fa0b4fa9 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Sun, 2 Jun 2013 14:06:50 +0200 Subject: [PATCH 12/16] IDEMPIERE 1009 Translation of tree popup --- .../webui/component/ADTreeOnDropListener.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java index 55c3dbfc7e..665b3a3ddb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java @@ -20,14 +20,16 @@ import org.compiere.model.MTree; import org.compiere.model.MTreeNode; import org.compiere.util.CLogger; import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Msg; import org.compiere.util.Trx; import org.zkoss.zk.ui.event.DropEvent; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; +import org.zkoss.zul.DefaultTreeNode; import org.zkoss.zul.Menuitem; import org.zkoss.zul.Menupopup; -import org.zkoss.zul.DefaultTreeNode; import org.zkoss.zul.Tree; import org.zkoss.zul.Treeitem; import org.zkoss.zul.Treerow; @@ -102,21 +104,20 @@ public class ADTreeOnDropListener implements EventListener { tree.setSelectedItem(toItem); Events.sendEvent(tree, new Event(Events.ON_SELECT, tree)); - + MenuListener listener = new MenuListener(movingNode, toNode); - - //TODO: translation + Menupopup popup = new Menupopup(); - Menuitem menuItem = new Menuitem("Insert After"); + Menuitem menuItem = new Menuitem(Msg.getMsg(Env.getCtx(), "InsertAfter")); menuItem.setValue("InsertAfter"); menuItem.setParent(popup); menuItem.addEventListener(Events.ON_CLICK, listener); - - menuItem = new Menuitem("Move Into"); + + menuItem = new Menuitem(Msg.getMsg(Env.getCtx(), "MoveInto")); menuItem.setValue("MoveInto"); menuItem.setParent(popup); menuItem.addEventListener(Events.ON_CLICK, listener); - + popup.setPage(tree.getPage()); popup.open(toItem.getTreerow()); } From 97f4c4796ef6fcbeac97457d217870ffbb4205b2 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Sun, 2 Jun 2013 14:07:04 +0200 Subject: [PATCH 13/16] IDEMPIERE 1009 Translation of tree popup --- .../oracle/201306021405_IDEMPIERE-1009.sql | 20 +++++++++++++++++++ .../201306021405_IDEMPIERE-1009.sql | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql create mode 100644 migration/i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql diff --git a/migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql b/migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql new file mode 100644 index 0000000000..999f18a6d2 --- /dev/null +++ b/migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql @@ -0,0 +1,20 @@ +-- Jun 2, 2013 1:51:02 PM CEST +-- IDEMPIERE-1009 Translation of tree popup +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200178,'8619a78f-92b8-4f84-b2ea-8cea0a7af2e5',0,TO_DATE('2013-06-02 13:51:01','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Move into','I',TO_DATE('2013-06-02 13:51:01','YYYY-MM-DD HH24:MI:SS'),100,'MoveInto') +; + +-- Jun 2, 2013 1:51:03 PM CEST +-- IDEMPIERE-1009 Translation of tree popup +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200178 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Jun 2, 2013 1:51:19 PM CEST +-- IDEMPIERE-1009 Translation of tree popup +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200179,'91f51d98-8afb-4a08-ba21-f4b24fa8da04',0,TO_DATE('2013-06-02 13:51:19','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Insert after','I',TO_DATE('2013-06-02 13:51:19','YYYY-MM-DD HH24:MI:SS'),100,'InsertAfter') +; + +-- Jun 2, 2013 1:51:19 PM CEST +-- IDEMPIERE-1009 Translation of tree popup +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200179 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + diff --git a/migration/i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql b/migration/i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql new file mode 100644 index 0000000000..e44c398242 --- /dev/null +++ b/migration/i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql @@ -0,0 +1,20 @@ +-- Jun 2, 2013 1:51:02 PM CEST +-- IDEMPIERE-1009 Translation of tree popup +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200178,'8619a78f-92b8-4f84-b2ea-8cea0a7af2e5',0,TO_TIMESTAMP('2013-06-02 13:51:01','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Move into','I',TO_TIMESTAMP('2013-06-02 13:51:01','YYYY-MM-DD HH24:MI:SS'),100,'MoveInto') +; + +-- Jun 2, 2013 1:51:03 PM CEST +-- IDEMPIERE-1009 Translation of tree popup +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200178 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + +-- Jun 2, 2013 1:51:19 PM CEST +-- IDEMPIERE-1009 Translation of tree popup +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200179,'91f51d98-8afb-4a08-ba21-f4b24fa8da04',0,TO_TIMESTAMP('2013-06-02 13:51:19','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Insert after','I',TO_TIMESTAMP('2013-06-02 13:51:19','YYYY-MM-DD HH24:MI:SS'),100,'InsertAfter') +; + +-- Jun 2, 2013 1:51:19 PM CEST +-- IDEMPIERE-1009 Translation of tree popup +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200179 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) +; + From 9ff4a4874d8527f46c61e9fca0255ec6395e62f1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 2 Jun 2013 11:19:43 -0500 Subject: [PATCH 14/16] IDEMPIERE 1009 Translation of tree popup / peer review --- migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql | 3 +++ .../i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql | 3 +++ 2 files changed, 6 insertions(+) diff --git a/migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql b/migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql index 999f18a6d2..f259c06d90 100644 --- a/migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql +++ b/migration/i1.0b-release/oracle/201306021405_IDEMPIERE-1009.sql @@ -18,3 +18,6 @@ INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Creat INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200179 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) ; +SELECT register_migration_script('201306021405_IDEMPIERE-1009.sql') FROM dual +; + diff --git a/migration/i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql b/migration/i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql index e44c398242..04f2ffefea 100644 --- a/migration/i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql +++ b/migration/i1.0b-release/postgresql/201306021405_IDEMPIERE-1009.sql @@ -18,3 +18,6 @@ INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Creat INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200179 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID) ; +SELECT register_migration_script('201306021405_IDEMPIERE-1009.sql') FROM dual +; + From 6c939f1c7ec2572fc8c68138d02c788c5e4518dc Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 2 Jun 2013 19:46:03 -0500 Subject: [PATCH 15/16] IDEMPIERE-1010 Thousands grouping separator is used for integers values / Implemented FormatPattern support for zk edition on numbers --- db/ddlutils/oracle/views/AD_FIELD_V.sql | 3 +- db/ddlutils/oracle/views/AD_FIELD_VT.sql | 3 +- db/ddlutils/postgresql/views/AD_FIELD_V.sql | 3 +- db/ddlutils/postgresql/views/AD_FIELD_VT.sql | 3 +- .../oracle/201306021150_IDEMPIERE-1010.sql | 80 +++++++++++++++++++ .../201306021150_IDEMPIERE-1010.sql | 66 +++++++++++++++ .../src/org/compiere/model/GridField.java | 12 ++- .../src/org/compiere/model/GridFieldVO.java | 9 ++- .../src/org/compiere/model/MColumn.java | 36 +++++++-- .../adempiere/webui/component/NumberBox.java | 10 +-- .../adempiere/webui/editor/WNumberEditor.java | 5 +- 11 files changed, 209 insertions(+), 21 deletions(-) create mode 100644 migration/i1.0b-release/oracle/201306021150_IDEMPIERE-1010.sql create mode 100644 migration/i1.0b-release/postgresql/201306021150_IDEMPIERE-1010.sql diff --git a/db/ddlutils/oracle/views/AD_FIELD_V.sql b/db/ddlutils/oracle/views/AD_FIELD_V.sql index 67134ef926..a3d519f0ac 100644 --- a/db/ddlutils/oracle/views/AD_FIELD_V.sql +++ b/db/ddlutils/oracle/views/AD_FIELD_V.sql @@ -23,7 +23,8 @@ CREATE OR REPLACE VIEW AD_FIELD_V AS f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, - COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton + COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton, + c.FormatPattern FROM AD_FIELD f INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) diff --git a/db/ddlutils/oracle/views/AD_FIELD_VT.sql b/db/ddlutils/oracle/views/AD_FIELD_VT.sql index 896f74b808..078ea01e23 100644 --- a/db/ddlutils/oracle/views/AD_FIELD_VT.sql +++ b/db/ddlutils/oracle/views/AD_FIELD_VT.sql @@ -22,7 +22,8 @@ CREATE OR REPLACE VIEW AD_FIELD_VT AS f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, - COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton + COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton, + c.FormatPattern FROM AD_FIELD f INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID) INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) diff --git a/db/ddlutils/postgresql/views/AD_FIELD_V.sql b/db/ddlutils/postgresql/views/AD_FIELD_V.sql index 40299e4f51..897aa1bdaa 100644 --- a/db/ddlutils/postgresql/views/AD_FIELD_V.sql +++ b/db/ddlutils/postgresql/views/AD_FIELD_V.sql @@ -19,7 +19,8 @@ CREATE OR REPLACE VIEW ad_field_v AS f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, - COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton + COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton, + c.FormatPattern FROM ad_field f JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id diff --git a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql index 30bc3a340c..9e0d1fd25f 100644 --- a/db/ddlutils/postgresql/views/AD_FIELD_VT.sql +++ b/db/ddlutils/postgresql/views/AD_FIELD_VT.sql @@ -15,7 +15,8 @@ CREATE OR REPLACE VIEW ad_field_vt AS f.isdisplayedgrid, f.seqnogrid, c.seqnoselection, f.xposition, f.columnspan, f.numlines, - COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton + COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton, + c.FormatPattern FROM ad_field f JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id diff --git a/migration/i1.0b-release/oracle/201306021150_IDEMPIERE-1010.sql b/migration/i1.0b-release/oracle/201306021150_IDEMPIERE-1010.sql new file mode 100644 index 0000000000..d3314fdd30 --- /dev/null +++ b/migration/i1.0b-release/oracle/201306021150_IDEMPIERE-1010.sql @@ -0,0 +1,80 @@ +-- IDEMPIERE-1010 Thousands grouping separator is used for integers values +CREATE OR REPLACE VIEW AD_FIELD_V AS + SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, + f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength, + f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly, + f.IsEncrypted AS IsEncryptedField, f.ObscureType, + c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, + COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue, + c.IsKey, c.IsParent, + COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory, + c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID, + c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID, + COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) AS AD_Val_Rule_ID, c.AD_Process_ID, + COALESCE(f.Isalwaysupdateable , C.Isalwaysupdateable) As Isalwaysupdateable, + COALESCE(f.Readonlylogic, c.Readonlylogic ) As Readonlylogic, + COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic, + COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.IsEncrypted AS IsEncryptedColumn, + c.IsSelectionColumn, + tbl.TableName, c.ValueMin, c.ValueMax, + fg.NAME AS FieldGroup, vr.Code AS ValidationCode, + f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault, + COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass, + c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, + f.isdisplayedgrid, + f.seqnogrid, + c.seqnoselection, f.xposition, f.columnspan, f.numlines, + COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton, + c.FormatPattern +FROM AD_FIELD f + INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) + LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) + LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID) + INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID) + LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID)) +WHERE f.IsActive = 'Y' + AND c.IsActive = 'Y' +; + +CREATE OR REPLACE VIEW AD_FIELD_VT AS + SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, + trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength, + f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly, + f.IsEncrypted AS IsEncryptedField, f.ObscureType, + c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, + COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue, + c.IsKey, c.IsParent, + COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory, + c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID, + c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID, + COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) as AD_Val_Rule_ID, c.AD_Process_ID, + COALESCE(f.Isalwaysupdateable , C.Isalwaysupdateable) As Isalwaysupdateable, + COALESCE(f.Readonlylogic, c.Readonlylogic ) As Readonlylogic, + COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic, + COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn, + tbl.TableName, c.ValueMin, c.ValueMax, + fgt.NAME AS FieldGroup, vr.Code AS ValidationCode, + f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault, + COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass, + c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, + f.isdisplayedgrid, + f.seqnogrid, + c.seqnoselection, f.xposition, f.columnspan, f.numlines, + COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton, + c.FormatPattern + FROM AD_FIELD f + INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID) + INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) + LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) + LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON + (f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE) + LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID) + INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID) + LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID)) + WHERE f.IsActive = 'Y' + AND c.IsActive = 'Y' +; + +SELECT register_migration_script('201306021150_IDEMPIERE-1010.sql') FROM dual +; + diff --git a/migration/i1.0b-release/postgresql/201306021150_IDEMPIERE-1010.sql b/migration/i1.0b-release/postgresql/201306021150_IDEMPIERE-1010.sql new file mode 100644 index 0000000000..2b46d71c17 --- /dev/null +++ b/migration/i1.0b-release/postgresql/201306021150_IDEMPIERE-1010.sql @@ -0,0 +1,66 @@ +-- IDEMPIERE-1010 Thousands grouping separator is used for integers values +CREATE OR REPLACE VIEW ad_field_v AS + SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, + f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, + f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield, + f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, + COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent, + COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, + COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, + COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, + COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, + COALESCE(f.Isalwaysupdateable , C.Isalwaysupdateable) As Isalwaysupdateable, + COALESCE(f.Readonlylogic, c.Readonlylogic ) As Readonlylogic, + COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic, + COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, + c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, + fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, + COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, + COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, + f.isdisplayedgrid, + f.seqnogrid, + c.seqnoselection, f.xposition, f.columnspan, f.numlines, + COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton, + c.FormatPattern + FROM ad_field f + JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id + LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id + LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id + JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id + LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) + WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar +; + +CREATE OR REPLACE VIEW ad_field_vt AS + SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description, + trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, + f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, + c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated, + COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, + COALESCE(f.ad_val_rule_id,c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, + COALESCE(f.Isalwaysupdateable,C.Isalwaysupdateable) As Isalwaysupdateable, + COALESCE(f.Readonlylogic,c.Readonlylogic) As Readonlylogic, + COALESCE(f.Mandatorylogic , C.Mandatorylogic) As Mandatorylogic, + COALESCE(f.isupdateable, c.isupdateable) AS isupdateable, + c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, + f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete, + COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy, + f.isdisplayedgrid, + f.seqnogrid, + c.seqnoselection, f.xposition, f.columnspan, f.numlines, + COALESCE(f.istoolbarbutton , c.istoolbarbutton ) As istoolbarbutton, + c.FormatPattern + FROM ad_field f + JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id + JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id + LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id + LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text + LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id + JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id + LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) + WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar +; + +SELECT register_migration_script('201306021150_IDEMPIERE-1010.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 73122f87e3..b4b281a41e 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -76,12 +76,10 @@ import org.compiere.util.Evaluator; public class GridField implements Serializable, Evaluatee, Cloneable { - - /** * */ - private static final long serialVersionUID = -2384947306143518488L; + private static final long serialVersionUID = -4907605626586089308L; /** * Field Constructor. @@ -1197,6 +1195,13 @@ public class GridField { return m_vo.VFormat; } + /** + * Get Format Pattern + * @return format pattern + */ + public String getFormatPattern() { + return m_vo.FormatPattern; + } /** * Get Value Min * @return min @@ -2005,4 +2010,5 @@ public class GridField } } + } // MField diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java index c55d62b8db..43716718be 100644 --- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java @@ -45,7 +45,7 @@ public class GridFieldVO implements Serializable /** * */ - private static final long serialVersionUID = 542767511640866058L; + private static final long serialVersionUID = -6098724121324445114L; /** * Return the SQL statement used for the MFieldVO.create @@ -144,6 +144,8 @@ public class GridFieldVO implements Serializable vo.FieldLength = rs.getInt (i); else if (columnName.equalsIgnoreCase("VFormat")) vo.VFormat = rs.getString (i); + else if (columnName.equalsIgnoreCase("FormatPattern")) + vo.FormatPattern = rs.getString (i); else if (columnName.equalsIgnoreCase("ValueMin")) vo.ValueMin = rs.getString (i); else if (columnName.equalsIgnoreCase("ValueMax")) @@ -311,6 +313,7 @@ public class GridFieldVO implements Serializable vo.DefaultValue = rs.getString("DefaultValue"); vo.DefaultValue2 = rs.getString("DefaultValue2"); vo.VFormat = rs.getString("VFormat"); + vo.FormatPattern = rs.getString("FormatPattern"); vo.ValueMin = rs.getString("ValueMin"); vo.ValueMax = rs.getString("ValueMax"); vo.isRange = rs.getString("IsRange").equals("Y"); @@ -359,6 +362,7 @@ public class GridFieldVO implements Serializable voT.DisplayLength = voF.FieldLength; voT.DefaultValue = voF.DefaultValue2; voT.VFormat = voF.VFormat; + voT.FormatPattern = voF.FormatPattern; voT.ValueMin = voF.ValueMin; voT.ValueMax = voF.ValueMax; voT.isRange = voF.isRange; @@ -519,6 +523,8 @@ public class GridFieldVO implements Serializable public int FieldLength = 0; /** Format enforcement */ public String VFormat = ""; + /** Format pattern */ + public String FormatPattern; /** Min. Value */ public String ValueMin = ""; /** Max. Value */ @@ -696,6 +702,7 @@ public class GridFieldVO implements Serializable clone.SortNo = SortNo; clone.FieldLength = FieldLength; clone.VFormat = VFormat; + clone.FormatPattern = FormatPattern; clone.ValueMin = ValueMin; clone.ValueMax = ValueMax; clone.FieldGroup = FieldGroup; diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index 769be5cb51..f4e867ac9a 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -20,6 +20,11 @@ import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.Locale; import java.util.Properties; import java.util.logging.Level; @@ -39,11 +44,10 @@ import org.compiere.util.Util; */ public class MColumn extends X_AD_Column { - /** * */ - private static final long serialVersionUID = 6543789555737635129L; + private static final long serialVersionUID = -3366954463322356334L; /** * Get MColumn from Cache @@ -305,11 +309,33 @@ public class MColumn extends X_AD_Column ) setIsAllowCopy(false); } - + + // validate FormatPattern + String pattern = getFormatPattern(); + if (! Util.isEmpty(pattern, true)) { + if (DisplayType.isNumeric(getAD_Reference_ID())) { + DecimalFormat format = (DecimalFormat)NumberFormat.getNumberInstance(Locale.US); + try { + format.applyPattern(pattern); + } catch (IllegalArgumentException e) { + log.saveError("SaveError", "Invalid number format: " + pattern); + return false; + } + } else if (DisplayType.isDate(getAD_Reference_ID())) { + SimpleDateFormat format = (SimpleDateFormat)DateFormat.getInstance(); + try { + format.applyPattern(pattern); + } catch (IllegalArgumentException e) { + log.saveError("SaveError", "Invalid date pattern: " + pattern); + return false; + } + } else { + setFormatPattern(null); + } + } + return true; } // beforeSave - - /** * After Save diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java index fd7d1713b2..8e37667080 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java @@ -45,10 +45,10 @@ import org.zkoss.zul.Vbox; */ public class NumberBox extends Div { - /** + /** * */ - private static final long serialVersionUID = 7089099079981906933L; + private static final long serialVersionUID = -3548087521669052891L; private Textbox txtCalc = new Textbox(); @@ -145,11 +145,7 @@ public class NumberBox extends Div { BigDecimal value = decimalBox.getValue(); if (value == null) return null; - - if (format != null) - return format.format(value); - else - return value.toPlainString(); + return decimalBox.getText(); } /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java index ce363f4688..28466f34bc 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java @@ -138,7 +138,10 @@ public class WNumberEditor extends WEditor implements ContextMenuListener // IDEMPIERE-989 Language lang = AEnv.getLanguage(Env.getCtx()); DecimalFormat format = DisplayType.getNumberFormat(displayType, lang); - getComponent().getDecimalbox().setFormat(format.toPattern()); + if (gridField != null && gridField.getFormatPattern() != null) + getComponent().getDecimalbox().setFormat(gridField.getFormatPattern()); + else + getComponent().getDecimalbox().setFormat(format.toPattern()); getComponent().getDecimalbox().setLocale(lang.getLocale()); getComponent().setFormat(format); From d2a6dae20bee3c4d7f70d0f2dc8c1cae2a1b5c0f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 2 Jun 2013 20:34:46 -0500 Subject: [PATCH 16/16] IDEMPIERE-1011 Improve usability of Table window --- .../oracle/201306021533_IDEMPIERE-1011.sql | 260 ++++++++++++++++++ .../201306021533_IDEMPIERE-1011.sql | 260 ++++++++++++++++++ .../org/compiere/model/Callout_AD_Column.java | 114 +++++++- 3 files changed, 632 insertions(+), 2 deletions(-) create mode 100644 migration/i1.0b-release/oracle/201306021533_IDEMPIERE-1011.sql create mode 100644 migration/i1.0b-release/postgresql/201306021533_IDEMPIERE-1011.sql diff --git a/migration/i1.0b-release/oracle/201306021533_IDEMPIERE-1011.sql b/migration/i1.0b-release/oracle/201306021533_IDEMPIERE-1011.sql new file mode 100644 index 0000000000..d46281e99c --- /dev/null +++ b/migration/i1.0b-release/oracle/201306021533_IDEMPIERE-1011.sql @@ -0,0 +1,260 @@ +-- IDEMPIERE-1011 Improve usability of Table window +-- Jun 2, 2013 12:02:52 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@#UIClient@!swing',Updated=TO_DATE('2013-06-02 12:02:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1179 +; + +-- Jun 2, 2013 12:10:10 PM COT +UPDATE AD_Field SET SeqNo=160, NumLines=2,Updated=TO_DATE('2013-06-02 12:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=133 +; + +-- Jun 2, 2013 12:10:10 PM COT +UPDATE AD_Field SET SeqNo=240,Updated=TO_DATE('2013-06-02 12:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200350 +; + +-- Jun 2, 2013 12:10:10 PM COT +UPDATE AD_Field SET SeqNo=250,Updated=TO_DATE('2013-06-02 12:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200348 +; + +-- Jun 2, 2013 12:10:10 PM COT +UPDATE AD_Field SET SeqNo=260,Updated=TO_DATE('2013-06-02 12:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200349 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=270,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13425 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=280,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200837 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=290,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54402 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=300,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54401 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=310,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200838 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=320,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200834 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=330,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13424 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=340,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62468 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=350, AD_FieldGroup_ID=200004, IsDisplayed='Y', XPosition=1, NumLines=2,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53280 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=360, IsDisplayed='Y', XPosition=1, NumLines=2,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200836 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=370, NumLines=2,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200835 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=380,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=136 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=390,Updated=TO_DATE('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=139 +; + +-- Jun 2, 2013 12:14:18 PM COT +UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2013-06-02 12:14:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56374 +; + +-- Jun 2, 2013 12:14:18 PM COT +UPDATE AD_Field SET SeqNo=160, AD_FieldGroup_ID=NULL, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2013-06-02 12:14:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=310 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=170,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2526 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=180, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=169 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=200, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56279 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=210,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=171 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=240,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=161 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=250,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=162 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=260,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=166 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=270,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2370 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=280, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=290,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10128 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=300, IsDisplayed='Y', XPosition=1, NumLines=2,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=160 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=310, NumLines=2,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4941 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=320, NumLines=2,Updated=TO_DATE('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50188 +; + +-- Jun 2, 2013 12:14:44 PM COT +UPDATE AD_Column SET IsToolbarButton='Y',Updated=TO_DATE('2013-06-02 12:14:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=128 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=40, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1345 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=50,Updated=TO_DATE('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=156 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=60,Updated=TO_DATE('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11264 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=130, IsDisplayed='Y', XPosition=4,Updated=TO_DATE('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5121 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=140,Updated=TO_DATE('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=170 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=172 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=160,Updated=TO_DATE('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56374 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=170,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=310 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=180,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2526 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=190,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=169 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=200,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200648 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=210,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56279 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=220,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=171 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=230,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2574 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=240,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2573 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=250,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=161 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=260,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=162 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=270,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=166 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=280, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2370 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=310, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=320,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4941 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=330,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50188 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=340,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=168 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=350,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=159 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=380, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56317 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=390, IsDisplayed='Y', XPosition=5,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62467 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=400, AD_FieldGroup_ID=200015, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=167 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=410, AD_FieldGroup_ID=200015, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=825 +; + +-- Jun 2, 2013 7:51:57 PM COT +UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_DATE('2013-06-02 19:51:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=156 +; + +-- Jun 2, 2013 7:53:38 PM COT +UPDATE AD_Column SET Callout='org.compiere.model.Callout_AD_Column.element',Updated=TO_DATE('2013-06-02 19:53:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2608 +; + +SELECT register_migration_script('201306021533_IDEMPIERE-1011.sql') FROM dual +; + diff --git a/migration/i1.0b-release/postgresql/201306021533_IDEMPIERE-1011.sql b/migration/i1.0b-release/postgresql/201306021533_IDEMPIERE-1011.sql new file mode 100644 index 0000000000..3a59275353 --- /dev/null +++ b/migration/i1.0b-release/postgresql/201306021533_IDEMPIERE-1011.sql @@ -0,0 +1,260 @@ +-- IDEMPIERE-1011 Improve usability of Table window +-- Jun 2, 2013 12:02:52 PM COT +UPDATE AD_Column SET ReadOnlyLogic='@#UIClient@!swing',Updated=TO_TIMESTAMP('2013-06-02 12:02:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1179 +; + +-- Jun 2, 2013 12:10:10 PM COT +UPDATE AD_Field SET SeqNo=160, NumLines=2,Updated=TO_TIMESTAMP('2013-06-02 12:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=133 +; + +-- Jun 2, 2013 12:10:10 PM COT +UPDATE AD_Field SET SeqNo=240,Updated=TO_TIMESTAMP('2013-06-02 12:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200350 +; + +-- Jun 2, 2013 12:10:10 PM COT +UPDATE AD_Field SET SeqNo=250,Updated=TO_TIMESTAMP('2013-06-02 12:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200348 +; + +-- Jun 2, 2013 12:10:10 PM COT +UPDATE AD_Field SET SeqNo=260,Updated=TO_TIMESTAMP('2013-06-02 12:10:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200349 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=270,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13425 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=280,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200837 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=290,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54402 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=300,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=54401 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=310,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200838 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=320,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200834 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=330,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13424 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=340,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62468 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=350, AD_FieldGroup_ID=200004, IsDisplayed='Y', XPosition=1, NumLines=2,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53280 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=360, IsDisplayed='Y', XPosition=1, NumLines=2,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200836 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=370, NumLines=2,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200835 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=380,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=136 +; + +-- Jun 2, 2013 12:10:11 PM COT +UPDATE AD_Field SET SeqNo=390,Updated=TO_TIMESTAMP('2013-06-02 12:10:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=139 +; + +-- Jun 2, 2013 12:14:18 PM COT +UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2013-06-02 12:14:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56374 +; + +-- Jun 2, 2013 12:14:18 PM COT +UPDATE AD_Field SET SeqNo=160, AD_FieldGroup_ID=NULL, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-06-02 12:14:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=310 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2526 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=180, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=169 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=200, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56279 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=171 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=240,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=161 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=250,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=162 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=260,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=166 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=270,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2370 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=280, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=290,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10128 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=300, IsDisplayed='Y', XPosition=1, NumLines=2,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=160 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=310, NumLines=2,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4941 +; + +-- Jun 2, 2013 12:14:19 PM COT +UPDATE AD_Field SET SeqNo=320, NumLines=2,Updated=TO_TIMESTAMP('2013-06-02 12:14:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50188 +; + +-- Jun 2, 2013 12:14:44 PM COT +UPDATE AD_Column SET IsToolbarButton='Y',Updated=TO_TIMESTAMP('2013-06-02 12:14:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=128 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=40, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1345 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=156 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=11264 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=130, IsDisplayed='Y', XPosition=4,Updated=TO_TIMESTAMP('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5121 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=170 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=172 +; + +-- Jun 2, 2013 12:20:54 PM COT +UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2013-06-02 12:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56374 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=310 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2526 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=169 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200648 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56279 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=220,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=171 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=230,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2574 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=240,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2573 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=250,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=161 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=260,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=162 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=270,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=166 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=280, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2370 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=310, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=320,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4941 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=330,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50188 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=340,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=168 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=350,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=159 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=380, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56317 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=390, IsDisplayed='Y', XPosition=5,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62467 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=400, AD_FieldGroup_ID=200015, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=167 +; + +-- Jun 2, 2013 12:20:55 PM COT +UPDATE AD_Field SET SeqNo=410, AD_FieldGroup_ID=200015, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2013-06-02 12:20:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=825 +; + +-- Jun 2, 2013 7:51:57 PM COT +UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2013-06-02 19:51:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=156 +; + +-- Jun 2, 2013 7:53:38 PM COT +UPDATE AD_Column SET Callout='org.compiere.model.Callout_AD_Column.element',Updated=TO_TIMESTAMP('2013-06-02 19:53:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2608 +; + +SELECT register_migration_script('201306021533_IDEMPIERE-1011.sql') FROM dual +; + diff --git a/org.adempiere.base.callout/src/org/compiere/model/Callout_AD_Column.java b/org.adempiere.base.callout/src/org/compiere/model/Callout_AD_Column.java index 245834adeb..a568648f89 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/Callout_AD_Column.java +++ b/org.adempiere.base.callout/src/org/compiere/model/Callout_AD_Column.java @@ -12,13 +12,20 @@ *****************************************************************************/ package org.compiere.model; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.Properties; +import org.adempiere.exceptions.DBException; import org.adempiere.model.GridTabWrapper; +import org.compiere.util.DB; +import org.compiere.util.DisplayType; /** * @author teo_sarca - * + * + * @author Carlos Ruiz - globalqss - IDEMPIERE-1011 Improve usability of Table window */ public class Callout_AD_Column extends CalloutEngine { @@ -27,7 +34,110 @@ public class Callout_AD_Column extends CalloutEngine I_AD_Column column = GridTabWrapper.create(mTab, I_AD_Column.class); if (MColumn.isSuggestSelectionColumn(column.getColumnName(), true)) column.setIsSelectionColumn(true); - // + + // IDEMPIERE-1011 + if (PO.getUUIDColumnName(column.getAD_Table().getTableName()).equals(column.getColumnName())) { + // UUID column + column.setAD_Reference_ID(DisplayType.String); + column.setAD_Val_Rule_ID(0); + column.setAD_Reference_Value_ID(0); + column.setFieldLength(36); + column.setDefaultValue(null); + column.setMandatoryLogic(null); + column.setReadOnlyLogic(null); + column.setIsIdentifier(false); + column.setIsUpdateable(false); + column.setIsAlwaysUpdateable(false); + column.setIsKey(true); + } else if (column.getAD_Table().getTableName().concat("_ID").equals(column.getColumnName())) { + // ID key column + column.setAD_Reference_ID(DisplayType.ID); + column.setAD_Val_Rule_ID(0); + column.setAD_Reference_Value_ID(0); + column.setFieldLength(22); + column.setDefaultValue(null); + column.setMandatoryLogic(null); + column.setReadOnlyLogic(null); + column.setIsIdentifier(false); + column.setIsUpdateable(false); + column.setIsAlwaysUpdateable(false); + } else { + // get defaults from most used case + String sql = "" + + "SELECT AD_Reference_ID, " + + " AD_Val_Rule_ID, " + + " AD_Reference_Value_ID, " + + " FieldLength, " + + " DefaultValue, " + + " MandatoryLogic, " + + " ReadOnlyLogic, " + + " IsIdentifier, " + + " IsUpdateable, " + + " IsAlwaysUpdateable, " + + " COUNT(*) " + + "FROM AD_Column " + + "WHERE ColumnName = ? " + + "GROUP BY AD_Reference_ID, " + + " AD_Val_Rule_ID, " + + " AD_Reference_Value_ID, " + + " FieldLength, " + + " DefaultValue, " + + " MandatoryLogic, " + + " ReadOnlyLogic, " + + " IsIdentifier, " + + " IsUpdateable, " + + " IsAlwaysUpdateable " + + "ORDER BY COUNT(*) DESC "; + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, column.getColumnName()); + rs = pstmt.executeQuery(); + if (rs.next()) { + int ad_reference_id = rs.getInt(1); + if (ad_reference_id == DisplayType.ID) + ad_reference_id = DisplayType.TableDir; + column.setAD_Reference_ID(ad_reference_id); + column.setAD_Val_Rule_ID(rs.getInt(2)); + column.setAD_Reference_Value_ID(rs.getInt(3)); + column.setFieldLength(rs.getInt(4)); + column.setDefaultValue(rs.getString(5)); + column.setMandatoryLogic(rs.getString(6)); + column.setReadOnlyLogic(rs.getString(7)); + column.setIsIdentifier("Y".equals(rs.getString(8))); + column.setIsUpdateable("Y".equals(rs.getString(9))); + column.setIsAlwaysUpdateable("Y".equals(rs.getString(10))); + } + } + catch (SQLException e) + { + throw new DBException(e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + } + + return ""; + } + + public String element (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) + { + // IDEMPIERE-1011 + I_AD_Column column = GridTabWrapper.create(mTab, I_AD_Column.class); + if (column.getAD_Element_ID() > 0) { + M_Element element = new M_Element(ctx, column.getAD_Element_ID(), null); + column.setColumnName(element.getColumnName()); + column.setName(element.getName()); + column.setDescription(element.getDescription()); + column.setHelp(element.getHelp()); + } + return ""; }