From 95cf3f19b3456e96ba7b1c9ddb97f971198efc43 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Sat, 24 Jun 2017 17:34:28 +0200 Subject: [PATCH] IDEMPIERE-3409 Make separator used between identifier fields configurable (1004703) --- .../src/org/compiere/model/MLookupFactory.java | 6 +++++- org.adempiere.base/src/org/compiere/model/MSysConfig.java | 3 ++- .../WEB-INF/src/org/adempiere/webui/info/InfoWindow.java | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index be79425bae..9550277d12 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -854,7 +854,11 @@ public class MLookupFactory for (int i = 0; i < size; i++) { if (i > 0) - displayColumn.append(" ||'_'|| " ); + { + displayColumn.append(" ||'") + .append(MSysConfig.getValue(MSysConfig.IDENTIFIER_SEPARATOR, "_", Env.getAD_Client_ID(Env.getCtx()))) + .append("'|| " ); + } LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i); StringBuilder msg = new StringBuilder().append(TableName).append(".").append(ldc.ColumnName); String columnSQL = ldc.IsVirtual ? ldc.ColumnSQL : msg.toString(); diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index e47fce87ab..4299fd3e89 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -42,7 +42,7 @@ public class MSysConfig extends X_AD_SysConfig /** * */ - private static final long serialVersionUID = -3599797130058840418L; + private static final long serialVersionUID = 8251867765594097812L; public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION"; public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS"; @@ -85,6 +85,7 @@ public class MSysConfig extends X_AD_SysConfig public static final String GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS = "GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS"; public static final String HTML_REPORT_THEME = "HTML_REPORT_THEME"; public static final String IBAN_VALIDATION = "IBAN_VALIDATION" ; + public static final String IDENTIFIER_SEPARATOR = "IDENTIFIER_SEPARATOR" ; public static final String Invoice_ReverseUseNewNumber = "Invoice_ReverseUseNewNumber"; public static final String JASPER_SWAP_MAX_PAGES = "JASPER_SWAP_MAX_PAGES"; public static final String LASTRUN_RECORD_COUNT = "LASTRUN_RECORD_COUNT"; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index c2ab38daf9..9d919319a7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -68,6 +68,7 @@ import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupInfo; import org.compiere.model.MProcess; import org.compiere.model.MRole; +import org.compiere.model.MSysConfig; import org.compiere.model.MTable; import org.compiere.model.X_AD_InfoColumn; import org.compiere.util.DB; @@ -464,12 +465,13 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL boolean splitValue = false; if (m_count <= 0) { - String[] values = queryValue.split("[_]"); + String separator = MSysConfig.getValue(MSysConfig.IDENTIFIER_SEPARATOR, "_", Env.getAD_Client_ID(Env.getCtx())); + String[] values = queryValue.split("[" + separator.trim()+"]"); if (values.length == 2) { splitValue = true; for(int i = 0; i < values.length && i < identifiers.size(); i++) { WEditor editor = identifiers.get(i); - editor.setValue(values[i]); + editor.setValue(values[i].trim()); } testCount(false); }