Skip to content
Snippets Groups Projects
Commit b263f99d authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Activity: Responsible filter (innate) works now just like in the Task_entity

parent 7c58033a
No related branches found
No related tags found
No related merge requests found
import("Employee_lib");
import("system.vars"); import("system.vars");
import("system.db"); import("system.db");
import("system.result"); import("system.result");
import("Sql_lib"); import("Sql_lib");
var loadNothing = false;
var cond = new SqlCondition(); var cond = new SqlCondition();
if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param")) if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param"))
{ {
...@@ -24,10 +26,22 @@ if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars. ...@@ -24,10 +26,22 @@ if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.
cond.and(db.translateStatement(activityLinkCond.buildSql("ACTIVITY.ACTIVITYID in (select ACTIVITYLINK.ACTIVITY_ID from ACTIVITYLINK", "1=2", ")"))) cond.and(db.translateStatement(activityLinkCond.buildSql("ACTIVITY.ACTIVITYID in (select ACTIVITYLINK.ACTIVITY_ID from ACTIVITYLINK", "1=2", ")")))
} }
if(vars.exists("$param.OnlyInnate_param") && vars.get("$param.OnlyInnate_param")) { if(vars.getString("$param.OnlyInnate_param") == "true")
cond.andPrepare("ACTIVITY.RESPONSIBLE", vars.get("$sys.user")); {
var ownContactId = EmployeeUtils.getCurrentContactId();
if (ownContactId)
cond.andPrepareIfSet("ACTIVITY.RESPONSIBLE", ownContactId);
else
loadNothing = true;
} }
//TODO: use a preparedCondition when available #1030812 #1034026 if (loadNothing)
var resCond = db.translateCondition(cond.build("1 = 1")); {
result.string(resCond); resCond = "1 = 2";
}
else
{
//TODO: use a preparedCondition when available #1030812 #1034026
var resCond = db.translateCondition(cond.build("1 = 1"));
}
result.string(resCond);
\ No newline at end of file
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