IDEMPIERE-2858 Display a Reference List Name in the tab name

This commit is contained in:
Nicolas Micoud 2019-02-07 14:34:14 +01:00
parent 15102da10d
commit 55df014054
1 changed files with 7 additions and 0 deletions

View File

@ -59,6 +59,7 @@ import org.compiere.model.MClient;
import org.compiere.model.MColumn;
import org.compiere.model.MLookupCache;
import org.compiere.model.MQuery;
import org.compiere.model.MRefList;
import org.compiere.model.MRole;
import org.compiere.model.MSession;
import org.compiere.model.MSysConfig;
@ -1686,6 +1687,12 @@ public final class Env
}
}
}
} else if (v instanceof String && !Util.isEmpty((String) v) && !Util.isEmpty(foreignTable) && foreignTable.equals(MRefList.Table_Name) && !Util.isEmpty(format)) {
int refID = colToken.getAD_Reference_Value_ID();
if (format.equals("Name"))
outStr.append(MRefList.getListName(getCtx(), refID, (String) v));
else if (format.equals("Description"))
outStr.append(MRefList.getListDescription(getCtx(), DB.getSQLValueStringEx(null, "SELECT Name FROM AD_Reference WHERE AD_Reference_ID = ?", refID), (String) v));
} else if (v instanceof Date) {
SimpleDateFormat df = new SimpleDateFormat(format);
outStr.append(df.format((Date)v));