Commit b8801430 authored by Bas Lijnse's avatar Bas Lijnse

Some work on the task list filter. Not finished yet.

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@328 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent add30b19
......@@ -40,11 +40,11 @@ handleWorkListRequest mainTask request session hst
, subject = mytaskdescr.taskLabel
, priority = mytaskdescr.taskPriority
, timestamp = (\(Time i) -> i) mytaskdescr.timeCreated
, tree_path = []
, tree_last = True
, tree_icon = "orTask"
, tree_path = mypath
, tree_last = mylast
, tree_icon = "editTask"
}
\\ mytaskdescr <- determineTaskList thisUserId htmlTree | not mytaskdescr.curStatus
\\ (mypath, mylast, mytaskdescr) <- determineTaskList thisUserId htmlTree | not mytaskdescr.curStatus
]
# worklist = { success = True
, total = length workitems
......
......@@ -37,7 +37,7 @@ handleWorkTabRequest mainTask request session hst
# activeTasks = if (taskStatus == TaskFinished || taskStatus == TaskDeleted)
(Just [ mytaskdescr.taskNrId
\\ mytaskdescr <- determineTaskList thisUserId htmlTree
\\ (mypath,mylast,mytaskdescr) <- determineTaskList thisUserId htmlTree
])
Nothing
# tempMessage = case taskStatus of
......
......@@ -6,7 +6,7 @@ import iTasksTypes
instance == TaskStatus
determineTaskList :: !UserId !HtmlTree -> [TaskDescription]
determineTaskList :: !UserId !HtmlTree -> [([Bool],Bool,TaskDescription)]
determineTaskForTab :: !UserId !TaskNrId !HtmlTree -> (!TaskStatus,![HtmlTag],![InputId])
// Showing Trace from Task Tree
......
......@@ -13,33 +13,55 @@ where
(==) TaskDeleted TaskDeleted = True
(==) _ _ = False
determineTaskList :: !UserId !HtmlTree -> [TaskDescription]
determineTaskList thisuser tree = determineTaskList` thisuser tree defaultTaskDescriptor
determineTaskList :: !UserId !HtmlTree -> [([Bool],Bool,TaskDescription)]
determineTaskList thisuser tree = fst (determineTaskList` thisuser [] tree defaultTaskDescriptor)
where
determineTaskList` thisuser (ntaskDescr @@: tree) taskDescr
# collected = determineTaskList` thisuser tree ntaskDescr
| ntaskDescr.taskWorkerId == thisuser = [ntaskDescr:collected]
= collected
determineTaskList` thisuser (CondAnd label nr []) taskDescr
= []
determineTaskList` thisuser (CondAnd label nr [t=:(condAndDescr,htmlTree):ts]) taskDescr
# collection = determineTaskList` thisuser htmlTree taskDescr
# collections = determineTaskList` thisuser (CondAnd label nr ts) taskDescr
= [{taskDescr & taskNrId = condAndDescr.caTaskNrId, taskLabel = label, curStatus = condAndDescr.caStatus}] ++ collection ++ collections
determineTaskList` thisuser (tree1 +|+ tree2)taskDescr
# collection1 = determineTaskList` thisuser tree1 taskDescr
# collection2 = determineTaskList` thisuser tree2 taskDescr
= collection1 ++ collection2
determineTaskList` thisuser (tree1 +-+ tree2) taskDescr
# collection1 = determineTaskList` thisuser tree1 taskDescr
# collection2 = determineTaskList` thisuser tree2 taskDescr
= collection1 ++ collection2
determineTaskList` thisuser (BT html inputs) taskDescr
determineSubTaskList thisuser path [] taskDescr
= []
determineTaskList` thisuser (DivCode id tree) taskDescr
= determineTaskList` thisuser tree taskDescr
determineTaskList` thisuser (TaskTrace traceinfo tree) taskDescr
= determineTaskList` thisuser tree taskDescr
determineSubTaskList thisuser path [(desc,t)] taskDescr
# collection = fst (determineTaskList` thisuser (path ++ [False]) t taskDescr)
= [(path ++ [False],True,taskDescr):collection]
determineSubTaskList thisuser path [(desc,t):ts] taskDescr
# collection = fst (determineTaskList` thisuser (path ++ [False]) t taskDescr)
# collections = determineSubTaskList thisuser path ts taskDescr
= [(path ++ [False],True,taskDescr):collection] ++ collections
determineTaskList` thisuser path (ntaskDescr @@: tree) taskDescr
# (collected, more) = determineTaskList` thisuser path tree ntaskDescr
| ntaskDescr.taskWorkerId == thisuser = ([(path, not more,ntaskDescr):collected], True)
= (collected, more)
determineTaskList` thisuser path (CondAnd label nr ts) taskDescr
# collections = determineSubTaskList thisuser path ts taskDescr
= ([(path,True,taskDescr):collections],True)
/*
determineTaskList` thisuser path (CondAnd label nr []) taskDescr
= ([], False)
determineTaskList` thisuser path (CondAnd label nr [t=:(condAndDescr,htmlTree):ts]) taskDescr
# collection = determineTaskList` thisuser path htmlTree taskDescr
# collections = determineTaskList` thisuser path (CondAnd label nr ts) taskDescr
= [(path,True,{taskDescr & taskNrId = condAndDescr.caTaskNrId, taskLabel = label, curStatus = condAndDescr.caStatus})] ++ collection ++ collections
*/
determineTaskList` thisuser path (tree1 +|+ tree2) taskDescr
# (collection1, more1) = determineTaskList` thisuser path tree1 taskDescr
# (collection2, more2) = determineTaskList` thisuser path tree2 taskDescr
= (collection1 ++ collection2, more1 || more2)
determineTaskList` thisuser path (tree1 +-+ tree2) taskDescr
# (collection1, more1) = determineTaskList` thisuser path tree1 taskDescr
# (collection2, more2) = determineTaskList` thisuser path tree2 taskDescr
= (collection1 ++ collection2, more1 || more2)
determineTaskList` thisuser path (BT html inputs) taskDescr
= ([], False)
determineTaskList` thisuser path (DivCode id tree) taskDescr
= determineTaskList` thisuser path tree taskDescr
determineTaskList` thisuser path (TaskTrace traceinfo tree) taskDescr
= determineTaskList` thisuser path tree taskDescr
defaultTaskDescriptor
= { delegatorId = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment