IDEMPIERE-1581 tree maintenance translation missing / thanks to Sergio Oropeza for the patch
This commit is contained in:
parent
9f67539c3d
commit
71db6871df
|
@ -26,6 +26,7 @@ import org.compiere.model.MTree_NodeMM;
|
||||||
import org.compiere.model.MTree_NodePR;
|
import org.compiere.model.MTree_NodePR;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.KeyNamePair;
|
import org.compiere.util.KeyNamePair;
|
||||||
|
|
||||||
public class TreeMaintenance {
|
public class TreeMaintenance {
|
||||||
|
@ -51,14 +52,29 @@ public class TreeMaintenance {
|
||||||
String fromClause = m_tree.getSourceTableName(false); // fully qualified
|
String fromClause = m_tree.getSourceTableName(false); // fully qualified
|
||||||
String columnNameX = m_tree.getSourceTableName(true);
|
String columnNameX = m_tree.getSourceTableName(true);
|
||||||
String actionColor = m_tree.getActionColorName();
|
String actionColor = m_tree.getActionColorName();
|
||||||
|
String fieldName = null;
|
||||||
String sql = "SELECT t." + columnNameX
|
String fieldDescription = null;
|
||||||
+ "_ID,t.Name,t.Description,t.IsSummary,"
|
String join = null;
|
||||||
+ actionColor
|
if (m_tree.getTreeType().equals(MTree.TREETYPE_Menu) // IDEMPIERE-1581 (see MTree.getNodeDetails)
|
||||||
+ " FROM " + fromClause
|
&& ! Env.isBaseLanguage(Env.getCtx(), "AD_Menu")) {
|
||||||
// + " WHERE t.IsActive='Y'" // R/O
|
fieldName = "trl.Name";
|
||||||
+ " ORDER BY 2";
|
fieldDescription ="trl.Description";
|
||||||
sql = MRole.getDefault().addAccessSQL(sql,
|
join = " LEFT JOIN AD_Menu_Trl trl ON (t.AD_Menu_ID = trl.AD_Menu_ID AND trl.AD_Language='"
|
||||||
|
+ Env.getAD_Language(Env.getCtx()) + "')";
|
||||||
|
} else {
|
||||||
|
fieldName ="t.Name";
|
||||||
|
fieldDescription ="t.Description";
|
||||||
|
join = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sqlb = new StringBuilder("SELECT t.")
|
||||||
|
.append(columnNameX)
|
||||||
|
.append("_ID,").append(fieldName).append(",").append(fieldDescription).append(",t.IsSummary,")
|
||||||
|
.append(actionColor)
|
||||||
|
.append(" FROM ").append(fromClause).append(join)
|
||||||
|
// .append(" WHERE t.IsActive='Y'") // R/O
|
||||||
|
.append(" ORDER BY 2");
|
||||||
|
String sql = MRole.getDefault().addAccessSQL(sqlb.toString(),
|
||||||
"t", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
|
"t", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
|
||||||
log.config(sql);
|
log.config(sql);
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue