BF [2905222] - Find and FindWinow do not handle encrypted columns

http://sourceforge.net/tracker/?func=detail&atid=879334&aid=2905222&group_id=176962
This commit is contained in:
trifonnt 2009-12-01 21:13:16 +00:00
parent d54fe59e0a
commit 53dc577171
1 changed files with 10 additions and 0 deletions

View File

@ -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);