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

Task: automatically filter "ended" tasks

parent eedb6dc8
No related branches found
No related tags found
No related merge requests found
import("system.neon");
import("system.vars");
import("system.neon");
import("ActivityTask_lib");
import("Keyword_lib");
import("KeywordRegistry_basic");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
var recordState = vars.get("$sys.recordstate");
if(recordState == neon.OPERATINGSTATE_NEW)
{
TaskUtils.addLinkRecords("$param.ObjectId_param", "$param.RowId_param", "$param.PresetLinks_param", "$field.PARENT_CONTEXT", "$field.PARENT_ID");
}
else if (recordState != neon.OPERATINGSTATE_SEARCH)
{
var statusFilterElement = {
"type":"row",
"name":"STATUS",
"operator":"NOT_EQUAL",
"key":$KeywordRegistry.taskStatus$ended(),
"contenttype": vars.get("$property.STATUS.contentType")
};
statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.taskStatus(), statusFilterElement.key);
var filter = {
"type":"group",
"operator":"AND",
"childs": [statusFilterElement]
};
filter = JSON.stringify(filter);
neon.setFilter("#ENTITY", filter);
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
<name>mytasks</name>
<title>My tasks</title>
<description>Tasks for which I am responsible</description>
<fragment>Task/filter</fragment>
<fragment>Task/filter?search=eyJ0eXBlIjoiZ3JvdXAiLCJvcGVyYXRvciI6IkFORCIsImNoaWxkcyI6W3sidHlwZSI6InJvdyIsIm5hbWUiOiJTVEFUVVMiLCJvcGVyYXRvciI6Ik5PVF9FUVVBTCIsInZhbHVlIjoiRU5ERUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiwia2V5IjoiRU5ERUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiwiY29udGVudHR5cGUiOiJURVhUIn1dfSXc</fragment>
<singleton v="true" />
<requiresConfiguration v="false" />
<storeRoles />
......
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