Skip to content
Snippets Groups Projects
Commit 13498ec8 authored by Andre Loreth's avatar Andre Loreth
Browse files

Fixed selectMap (Context_lib)

parent d3c585be
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ if (vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param"
var contextList = JSON.parse(vars.getString("$param.ObjectType_param"));
contextList.forEach(function (context)
{
var data = db.table(ContextUtils.getContextDataSql(context, vars.get("$param.ObjectRowId_param")));
var data = db.table(ContextUtils.getContextDataSql(context, vars.get("$param.ObjectRowId_param"), true));
data.forEach(function (row)
{
var record = [];
......
......@@ -7,11 +7,11 @@ if (vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param"
{
if (vars.exists("$param.ObjectRowId_param") && vars.get("$param.ObjectRowId_param"))
{
result.object(db.table(vars.get("$param.ObjectRowId_param"), ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param"))));
result.object(db.table(vars.get("$param.ObjectRowId_param"), ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param"), false)));
}
else
{
result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"))))
result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), undefined, false)))
}
}
else
......
......@@ -246,7 +246,7 @@ ContextUtils.getNameSql = function(pContextId, pRowId)
/**
* TODO: !!!temporary function until you can get fields from another Entity!!!
*/
ContextUtils.getContextDataSql = function(pContextId, pRowId)
ContextUtils.getContextDataSql = function(pContextId, pRowId, pWithDate)
{
var selectMap = ContextUtils._getSelectMap()
var cond = SqlCondition.begin();
......@@ -254,7 +254,10 @@ ContextUtils.getContextDataSql = function(pContextId, pRowId)
{
cond.andPrepare(selectMap[pContextId][1] + "." + selectMap[pContextId][3], pRowId)
}
return cond.buildSql("select " + selectMap[pContextId][2] + ", " + selectMap[pContextId][0] + ", " + selectMap[pContextId][4] + " from " + selectMap[pContextId][1], "1=1");
}
var dateColumn = "";
if (pWithDate === true)
dateColumn = ", " + selectMap[pContextId][4];
return cond.buildSql("select " + selectMap[pContextId][2] + ", " + selectMap[pContextId][0] + dateColumn + " from " + selectMap[pContextId][1], "1=1");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment