From 53dc57717154d94a0296bb08f5b4aae9b27afb2a Mon Sep 17 00:00:00 2001 From: trifonnt Date: Tue, 1 Dec 2009 21:13:16 +0000 Subject: [PATCH] BF [2905222] - Find and FindWinow do not handle encrypted columns http://sourceforge.net/tracker/?func=detail&atid=879334&aid=2905222&group_id=176962 --- .../src/org/adempiere/webui/window/FindWindow.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 0ce6002710..d14d28aa20 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -72,6 +72,7 @@ import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Msg; +import org.compiere.util.SecureEngine; import org.compiere.util.ValueNamePair; import org.zkoss.zk.au.out.AuFocus; import org.zkoss.zk.ui.Component; @@ -1310,6 +1311,11 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe // globalqss - Carlos Ruiz - 20060711 // fix a bug with virtualColumn + isSelectionColumn not yielding results GridField field = getTargetMField(ColumnName); + // add encryption here if the field is encrypted. + if (field.isEncryptedColumn()) { + value = SecureEngine.encrypt(value); + } + boolean isProductCategoryField = isProductCategoryField(field.getAD_Column_ID()); String ColumnSQL = field.getColumnSQL(false); if (value.toString().indexOf('%') != -1) @@ -1407,6 +1413,10 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe Object parsedValue = parseValue(field, value); if (parsedValue == null) continue; + //encrypt the value if we are searching an encrypted column. + if (field.isEncryptedColumn()) { + value = SecureEngine.encrypt(value); + } String infoDisplay = value.toString(); if (field.isLookup()) infoDisplay = field.getLookup().getDisplay(value);