diff --git a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js index d1f2147962c848243d106274f7c681129df1c160..2bb99764fd7b879674ff32334be5a779fb80a362 100644 --- a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js @@ -5,6 +5,7 @@ import("system.vars"); import("system.result"); import("Context_lib"); import("system.translate"); +import("system.logging"); var resultList = []; if (vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param") && vars.exists("$param.ObjectRowId_param") && vars.get("$param.ObjectRowId_param")) @@ -27,7 +28,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"), true, active)); + var data = db.table(ContextUtils.getContextDataSql(context, vars.get("$param.ObjectRowId_param"), true, active, true)); data.forEach(function (row) { var record = []; diff --git a/entity/Object_entity/recordcontainers/jdito/contentProcess.js b/entity/Object_entity/recordcontainers/jdito/contentProcess.js index 8e68adce995c46e20dbc61b0c52f2b1bb9c8c628..4c8e5d685bc170924f901660acd523c9c34450c4 100644 --- a/entity/Object_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Object_entity/recordcontainers/jdito/contentProcess.js @@ -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"), false, undefined))); + result.object(db.table(vars.get("$param.ObjectRowId_param"), ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param"), false, undefined, false))); } else { - result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), undefined, false, undefined))) + result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), undefined, false, undefined, false))) } } else diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index 92e265493f280e41359b53c90443809fbf56c1a4..b8034c7952e1ac1bbdad7e623015c3b7026d7ab4 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -293,7 +293,7 @@ ContextUtils.getNameSql = function(pContextId, pRowId) /** * TODO: !!!temporary function until you can get fields from another Entity!!! */ -ContextUtils.getContextDataSql = function(pContextId, pRowId, pWithDate, pActive) +ContextUtils.getContextDataSql = function(pContextId, pRowId, pWithDate, pActive, pWithState) { var selectMap = ContextUtils._getSelectMap() var cond = SqlCondition.begin(); @@ -321,6 +321,10 @@ ContextUtils.getContextDataSql = function(pContextId, pRowId, pWithDate, pActive var dateColumn = ""; if (pWithDate === true) dateColumn = ", " + selectMap[pContextId][5]; + + var stateColumn = ""; + if (pWithState === true) + stateColumn = ", " + selectMap[pContextId][7]; - return cond.buildSql("select " + selectMap[pContextId][3] + ", " + selectMap[pContextId][0] + dateColumn + " from " + selectMap[pContextId][1] + " " + selectMap[pContextId][2], "1=1"); + return cond.buildSql("select " + selectMap[pContextId][3] + ", " + selectMap[pContextId][0] + dateColumn + stateColumn + " from " + selectMap[pContextId][1] + " " + selectMap[pContextId][2], "1=1"); }