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

Task: reactivate the dashlet with filter for your own tasks

parent 42266985
No related branches found
No related tags found
No related merge requests found
......@@ -395,6 +395,12 @@
<title>subject</title>
<linkedContext>Task</linkedContext>
</entityField>
<entityParameter>
<name>FilterOnlyOwnTask_param</name>
<valueProcess>%aditoprj%/entity/Task_entity/entityfields/filteronlyowntask_param/valueProcess.js</valueProcess>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.result");
result.string(false);
\ No newline at end of file
import("Employee_lib");
import("system.vars");
import("system.db");
import("system.result");
import("Sql_lib");
var cond = new SqlCondition();
var alternativeFallbackCondition = "1 = 1";
if (vars.getString("$param.FilterOnlyOwnTask_param") == "true")
{
var ownContactId = EmployeeUtils.getCurrentContactId();
if (ownContactId)
cond.andPrepareIfSet("TASK.EDITOR_CONTACT_ID", ownContactId);
else
alternativeFallbackCondition = "1 = 2";
}
if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param"))
{
var activityLinkCond = SqlCondition.begin().andPrepareVars("TASKLINK.OBJECT_ROWID", "$param.RowId_param")
.andPrepareVars("TASKLINK.OBJECT_TYPE", "$param.ObjectId_param");
// TODO: more performant way than IN. Maybe a join??
// TODO: more performant way than IN. Maybe a join?
cond.and(db.translateStatement(activityLinkCond.buildSql("TASK.TASKID in (select TASKLINK.TASK_ID from TASKLINK", "1=2", ")")))
}
//TODO: use a preparedCondition when available #1030812 #1034026
var resCond = db.translateCondition(cond.build("1 = 1"));
var resCond = db.translateCondition(cond.build(alternativeFallbackCondition));
result.string(resCond);
......@@ -18,6 +18,12 @@
<title>Tasks</title>
</neonDashletCategory>
</categories>
<parameters>
<neonDashletParameter>
<name>FilterOnlyOwnTask_param</name>
<value>true</value>
</neonDashletParameter>
</parameters>
</neonDashletConfiguration>
</dashletConfigurations>
<layout>
......
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