Commit 5fd0692d authored by Steffen Michels's avatar Steffen Michels

- fix index handling for nested groups

- add GroupActionsBehaviour annotation for determining if group actions are added to actions of interaction tasks

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1032 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent c3f01dba
......@@ -86,8 +86,8 @@
display: none;
}
.GroupFloating .ToolbarNoEnabledItems,
/*.GroupFloating .ToolbarGroupActionsOnly*/ {
.GroupFloating .ToolbarNoEnabledItems/*,
.GroupFloating .ToolbarGroupActionsOnly*/ {
display: none;
}
......
......@@ -52,7 +52,7 @@ where
GOContinue = (Void, Continue)
GOExtend tasks = (Void, Extend (changeTasksType tasks))
changeTasksType tasks = map (\t -> (t >>| return GOContinue) <<@ getGroupedBehaviour t) tasks
getGroupedBehaviour (Task _ gb _ _) = gb
getGroupedBehaviour (Task _ gb _ _ _) = gb
(-||-) infixr 3 :: !(Task a) !(Task a) -> (Task a) | iTask a
(-||-) taska taskb = group "-||-" "Done when either subtask is finished." orfunc hd [] [taska,taskb] emptyGActionL
......
......@@ -4,7 +4,7 @@ definition module TuningCombinators
*/
from Types import :: Task, :: ManagerProperties, :: UserName, :: TaskPriority
from Time import :: Timestamp
from TaskTree import :: GroupedBehaviour
from TaskTree import :: GroupedBehaviour, :: GroupActionsBehaviour
//Annotation combinator
class (<<@) infixl 2 b :: !(Task a) !b -> Task a
......@@ -22,4 +22,6 @@ instance <<@ Timestamp //Set initial deadline
instance @>> Timestamp
instance <<@ GroupedBehaviour //Set grouped behaviour
instance @>> GroupedBehaviour
\ No newline at end of file
instance @>> GroupedBehaviour
instance <<@ GroupActionsBehaviour
instance @>> GroupActionsBehaviour
\ No newline at end of file
......@@ -6,32 +6,36 @@ import Types, TSt
class (<<@) infixl 2 b :: !(Task a) !b -> Task a
instance <<@ ManagerProperties
where (<<@) (Task _ gb mbTn tf) props = Task props gb mbTn tf
where (<<@) (Task _ gb ga mbTn tf) props = Task props gb ga mbTn tf
instance <<@ UserName
where (<<@) (Task props gb mbTn tf) u = Task {ManagerProperties|props & worker = u} gb mbTn tf
where (<<@) (Task props gb ga mbTn tf) u = Task {ManagerProperties|props & worker = u} gb ga mbTn tf
instance <<@ String
where (<<@) (Task props gb mbTn tf) s = Task {ManagerProperties|props & subject = s} gb mbTn tf
where (<<@) (Task props gb ga mbTn tf) s = Task {ManagerProperties|props & subject = s} gb ga mbTn tf
instance <<@ TaskPriority
where (<<@) (Task props gb mbTn tf) p = Task {ManagerProperties|props & priority = p} gb mbTn tf
where (<<@) (Task props gb ga mbTn tf) p = Task {ManagerProperties|props & priority = p} gb ga mbTn tf
instance <<@ Timestamp
where (<<@) (Task props gb mbTn tf) d = Task {ManagerProperties|props & deadline = Just d} gb mbTn tf
where (<<@) (Task props gb ga mbTn tf) d = Task {ManagerProperties|props & deadline = Just d} gb ga mbTn tf
instance <<@ GroupedBehaviour
where (<<@) (Task props _ mbTn tf) gb = Task props gb mbTn tf
where (<<@) (Task props _ ga mbTn tf) gb = Task props gb ga mbTn tf
instance <<@ GroupActionsBehaviour
where (<<@) (Task props gb _ mbTn tf) ga = Task props gb ga mbTn tf
class (@>>) infixr 2 b :: !b !(Task a) -> Task a
instance @>> ManagerProperties
where (@>>) props (Task _ gb mbTn tf) = Task props gb mbTn tf
where (@>>) props (Task _ gb ga mbTn tf) = Task props gb ga mbTn tf
instance @>> UserName
where (@>>) u (Task props gb mbTn tf) = Task {ManagerProperties|props & worker = u} gb mbTn tf
where (@>>) u (Task props gb ga mbTn tf) = Task {ManagerProperties|props & worker = u} gb ga mbTn tf
instance @>> String
where (@>>) s (Task props gb mbTn tf) = Task {ManagerProperties|props & subject = s} gb mbTn tf
where (@>>) s (Task props gb ga mbTn tf) = Task {ManagerProperties|props & subject = s} gb ga mbTn tf
instance @>> TaskPriority
where (@>>) p (Task props gb mbTn tf) = Task {ManagerProperties|props & priority = p} gb mbTn tf
where (@>>) p (Task props gb ga mbTn tf) = Task {ManagerProperties|props & priority = p} gb ga mbTn tf
instance @>> Timestamp
where (@>>) d (Task props gb mbTn tf) = Task {ManagerProperties|props & deadline = Just d} gb mbTn tf
where (@>>) d (Task props gb ga mbTn tf) = Task {ManagerProperties|props & deadline = Just d} gb ga mbTn tf
instance @>> GroupedBehaviour
where (@>>) gb (Task props _ mbTn tf) = Task props gb mbTn tf
where (@>>) gb (Task props _ ga mbTn tf) = Task props gb ga mbTn tf
instance @>> GroupActionsBehaviour
where (@>>) ga (Task props gb _ mbTn tf) = Task props gb ga mbTn tf
......@@ -63,6 +63,7 @@ initTaskInfo
, traceValue = ""
, worker = UserName "" ""
, groupedBehaviour = GBFixed
, groupActionsBehaviour = IncludeGroupActions
, taskDescription = ""
}
......@@ -250,7 +251,7 @@ where
resetTSt :: !ProcessId !TaskProperties !(Maybe TaskParallelType) !*TSt -> *TSt
resetTSt processId properties inptype tst
# taskNr = taskNrFromString processId
# info = {TaskInfo|taskId = toString processId, taskLabel = properties.managerProps.subject, traceValue = "", worker=properties.managerProps.ManagerProperties.worker, groupedBehaviour = GBFixed, taskDescription = ""}
# info = {TaskInfo|taskId = toString processId, taskLabel = properties.managerProps.subject, traceValue = "", worker=properties.managerProps.ManagerProperties.worker, groupedBehaviour = GBFixed, groupActionsBehaviour = IncludeGroupActions, taskDescription = ""}
# tree = TTMainTask info properties menus inptype (TTFinishedTask info [])
= {TSt| tst & taskNr = taskNr, tree = tree, staticInfo = {tst.staticInfo & currentProcessId = processId}, mainTask = processId}
......@@ -379,7 +380,7 @@ where
* Adds the task number at which it has run before to a task
*/
setTaskContext :: !TaskNr !(Task a) -> (Task a)
setTaskContext cxt (Task props gb _ tf) = Task props gb (Just cxt) tf
setTaskContext cxt (Task props gb ga _ tf) = Task props gb ga (Just cxt) tf
/*
* Store the changes that are still active after a run.
......@@ -418,7 +419,7 @@ calculateTaskTree processId tst
# (mbProcess,tst) = getProcess processId tst
= case mbProcess of
Nothing
= (TTFinishedTask {TaskInfo|taskId = toString processId, taskLabel = "Deleted Process", traceValue="Deleted", worker = UserName "" "", groupedBehaviour = GBFixed, taskDescription="Task Result"} [], tst)
= (TTFinishedTask {TaskInfo|taskId = toString processId, taskLabel = "Deleted Process", traceValue="Deleted", worker = UserName "" "", groupedBehaviour = GBFixed, groupActionsBehaviour = IncludeGroupActions, taskDescription="Task Result"} [], tst)
Just process=:{Process|status,properties}
= case status of
Active
......@@ -427,7 +428,7 @@ calculateTaskTree processId tst
= (tree,tst)
_
//retrieve process result from store and show it??
= (TTFinishedTask {TaskInfo|taskId = toString processId, taskLabel = properties.managerProps.subject, traceValue = "Finished", worker = properties.managerProps.ManagerProperties.worker, groupedBehaviour = GBFixed, taskDescription="Task Result"} [], tst)
= (TTFinishedTask {TaskInfo|taskId = toString processId, taskLabel = properties.managerProps.subject, traceValue = "Finished", worker = properties.managerProps.ManagerProperties.worker, groupedBehaviour = GBFixed, groupActionsBehaviour = IncludeGroupActions, taskDescription="Task Result"} [], tst)
calculateTaskForest :: !*TSt -> (![TaskTree], !*TSt)
calculateTaskForest tst
......@@ -485,31 +486,31 @@ mkTaskFunction :: (*TSt -> (!a,!*TSt)) -> (*TSt -> (!TaskResult a,!*TSt))
mkTaskFunction f = \tst -> let (a,tst`) = f tst in (TaskFinished a,tst`)
mkInteractiveTask :: !String !(*TSt -> *(!TaskResult a,!*TSt)) -> Task a
mkInteractiveTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkInteractiveTask`
mkInteractiveTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkInteractiveTask`
where
mkInteractiveTask` tst=:{TSt|taskNr,taskInfo}
= taskfun {tst & tree = TTInteractiveTask taskInfo (abort "No interface definition given")}
mkInstantTask :: !String !(*TSt -> *(!TaskResult a,!*TSt)) -> Task a
mkInstantTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkInstantTask`
mkInstantTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkInstantTask`
where
mkInstantTask` tst=:{TSt|taskNr,taskInfo}
= taskfun {tst & tree = TTFinishedTask taskInfo []} //We use a FinishedTask node because the task is finished after one evaluation
mkMonitorTask :: !String !(*TSt -> *(!TaskResult a,!*TSt)) -> Task a
mkMonitorTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkMonitorTask`
mkMonitorTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkMonitorTask`
where
mkMonitorTask` tst=:{TSt|taskNr,taskInfo}
= taskfun {tst & tree = TTMonitorTask taskInfo []}
mkInstructionTask :: !String !(*TSt -> *(!TaskResult Void,!*TSt)) -> Task Void
mkInstructionTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkInstructionTask`
mkInstructionTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkInstructionTask`
where
mkInstructionTask` tst =:{TSt | taskInfo}
= taskfun {tst & tree = TTInstructionTask taskInfo [] Nothing}
mkRpcTask :: !String !RPCExecute !(String -> a) -> Task a | gUpdate{|*|} a
mkRpcTask taskname rpce parsefun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkRpcTask`
mkRpcTask taskname rpce parsefun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkRpcTask`
where
mkRpcTask` tst=:{TSt | taskNr, taskInfo}
# rpce = {RPCExecute | rpce & taskId = taskNrToString taskNr}
......@@ -564,47 +565,48 @@ where
setStatus status tst = setTaskStore "status" status tst
mkExtProcessTask :: !String !String !(*TSt -> *(!TaskResult Int,!*TSt)) -> Task Int
mkExtProcessTask taskname cmdline taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkExtProcessTask`
mkExtProcessTask taskname cmdline taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkExtProcessTask`
where
mkExtProcessTask` tst =:{TSt | taskInfo}
= taskfun {tst & tree = TTExtProcessTask taskInfo cmdline}
mkSequenceTask :: !String !(*TSt -> *(!TaskResult a,!*TSt)) -> Task a
mkSequenceTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkSequenceTask`
mkSequenceTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkSequenceTask`
where
mkSequenceTask` tst=:{TSt|taskNr,taskInfo}
= taskfun {tst & tree = TTSequenceTask taskInfo [], taskNr = [0:taskNr]}
mkParallelTask :: !String !TaskParallelInfo !(*TSt -> *(!TaskResult a,!*TSt)) -> Task a
mkParallelTask taskname tpi taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkParallelTask`
mkParallelTask taskname tpi taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkParallelTask`
where
mkParallelTask` tst=:{TSt|taskNr,taskInfo}
# tst = {tst & tree = TTParallelTask taskInfo tpi [], taskNr = [0:taskNr]}
= taskfun tst
mkGroupedTask :: !String !(*TSt -> *(!TaskResult a,!*TSt)) -> Task a
mkGroupedTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkGroupedTask`
mkGroupedTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkGroupedTask`
where
mkGroupedTask` tst=:{TSt|taskNr,taskInfo}
# tst = {tst & tree = TTGroupedTask taskInfo [] [], taskNr = [0:taskNr]}
= taskfun tst
mkMainTask :: !String !(*TSt -> *(!TaskResult a,!*TSt)) -> Task a
mkMainTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed Nothing mkMainTask`
mkMainTask taskname taskfun = Task {initManagerProperties & subject = taskname} GBFixed IncludeGroupActions Nothing mkMainTask`
where
mkMainTask` tst=:{taskNr,taskInfo}
= taskfun {tst & tree = TTMainTask taskInfo initTaskProperties Nothing Nothing (TTFinishedTask taskInfo [])}
applyTask :: !(Task a) !*TSt -> (!TaskResult a,!*TSt) | iTask a
applyTask (Task initProperties groupedBehaviour mbInitTaskNr taskfun) tst=:{taskNr,tree,dataStore,world,properties}
applyTask (Task initProperties groupedBehaviour groupActionsBehaviour mbInitTaskNr taskfun) tst=:{taskNr,tree,dataStore,world,properties}
# taskId = iTaskId taskNr ""
# (taskVal,dataStore,world) = loadValue taskId dataStore world
# taskInfo = { taskId = taskNrToString taskNr
, taskLabel = initProperties.subject
, traceValue = ""
, worker = properties.managerProps.ManagerProperties.worker
, groupedBehaviour = groupedBehaviour
, taskDescription = ""
# taskInfo = { taskId = taskNrToString taskNr
, taskLabel = initProperties.subject
, traceValue = ""
, worker = properties.managerProps.ManagerProperties.worker
, groupedBehaviour = groupedBehaviour
, groupActionsBehaviour = groupActionsBehaviour
, taskDescription = ""
}
# tst = {TSt|tst & dataStore = dataStore, world = world, taskInfo = taskInfo, newTask = isNothing taskVal}
= case taskVal of
......@@ -814,7 +816,7 @@ where
stl xs = tl xs
taskLabel :: !(Task a) -> String
taskLabel (Task p _ _ _) = p.subject
taskLabel (Task p _ _ _ _) = p.subject
taskProperties :: !(Task a) -> ManagerProperties
taskProperties (Task p _ _ _) = p
taskProperties (Task p _ _ _ _) = p
......@@ -110,9 +110,9 @@ derive JSONEncode TTCFormContainer, TTCMonitorContainer, TTCResultContainer, TTC
}
:: GroupContainerElement =
{ panel :: TaskPanel
, behaviour :: GroupedBehaviour
, index :: Int
{ panel :: !TaskPanel
, behaviour :: !GroupedBehaviour
, index :: !String
}
:: SubtaskInfo =
......
......@@ -37,7 +37,7 @@ buildTaskPanel` tree menus gActions currentUser tst=:{menusChanged} = case tree
| xtype = "itasks.ttc.form"
, id = "taskform-" +++ ti.TaskInfo.taskId
, taskId = ti.TaskInfo.taskId
, content = Just {form = def, tbar = makeMenuBar menus acceptedA gActions ti, buttons = map TUIButton buttons}
, content = Just {form = def, tbar = makeMenuBar menus acceptedA (if (includeGroupActions ti) gActions []) ti, buttons = map TUIButton buttons}
, updates = Nothing
, hotkeys = mkHotkeys hotkeyA
, subtaskId = Nothing
......@@ -49,7 +49,7 @@ buildTaskPanel` tree menus gActions currentUser tst=:{menusChanged} = case tree
, id = "taskform-" +++ ti.TaskInfo.taskId
, taskId = ti.TaskInfo.taskId
, content = Nothing
, updates = Just (determineUpdates upd menus menusChanged acceptedA gActions ti)
, updates = Just (determineUpdates upd menus menusChanged acceptedA (if (includeGroupActions ti) gActions []) ti)
, hotkeys = mkHotkeys hotkeyA
, subtaskId = Nothing
, description = ti.TaskInfo.taskDescription
......@@ -62,7 +62,7 @@ buildTaskPanel` tree menus gActions currentUser tst=:{menusChanged} = case tree
| xtype = "itasks.ttc.message"
, id = "taskform-" +++ ti.TaskInfo.taskId
, taskId = ti.TaskInfo.taskId
, content = {form = msg, tbar = makeMenuBar menus acceptedA gActions ti, buttons = map TUIButton buttons}
, content = {form = msg, tbar = makeMenuBar menus acceptedA (if (includeGroupActions ti) gActions []) ti, buttons = map TUIButton buttons}
, subtaskId = Nothing
, hotkeys = mkHotkeys hotkeyA
, description = ti.TaskInfo.taskDescription
......@@ -153,6 +153,10 @@ where
(TTParallelTask _ _ _) = False // the parallel subtask itself should not become visible
(TTMainTask _ _ _ _ _) = False // a main-subtask should not become visible
_ = abort "Unknown panel type in parallel"
includeGroupActions info = case info.TaskInfo.groupActionsBehaviour of
IncludeGroupActions = True
ExcludeGroupActions = False
buildSubtaskPanels :: !TaskTree !SubtaskNr !(Maybe [Menu]) !UserName !TaskParallelType !Bool !(Maybe TaskProperties) !*TSt -> (![SubtaskContainer],!*TSt)
buildSubtaskPanels tree stnr menus manager partype inClosed procProps tst=:{menusChanged} = case tree of
......@@ -384,40 +388,41 @@ filterFinished container = case container.panel of
buildGroupElements :: ![TaskTree] !UserName ![(Action,Bool)] !(Maybe [Menu]) !*TSt -> (![GroupContainerElement], !*TSt)
buildGroupElements tasks currentUser gActions menus tst
# (panels, tst) = seqList [buildPanel t gActions Nothing \\ t <- tasks] tst
# elements = [{panel = p, behaviour = b, index = idx} \\ (p, b) <- flatten panels & idx <- [0..]]
= (elements, tst)
# (elements, tst) = seqList [buildGroupElements` t [nr] gActions Nothing \\ t <- tasks & nr <- [1..]] tst
= (flatten elements, tst)
where
buildPanel :: !TaskTree ![(Action,Bool)] !(Maybe GroupedBehaviour) !*TSt -> (![(TaskPanel, GroupedBehaviour)] , !*TSt)
buildPanel (TTGroupedTask _ tasks gActions) _ _ tst
buildGroupElements` :: !TaskTree !SubtaskNr ![(Action,Bool)] !(Maybe GroupedBehaviour) !*TSt -> (![GroupContainerElement] , !*TSt)
buildGroupElements` (TTGroupedTask _ tasks gActions) stnr _ _ tst
# (gActions,tst) = evaluateGActions gActions tst
# (panels, tst) = seqList [buildPanel t gActions Nothing \\ t <- tasks] tst
# (panels, tst) = seqList [buildGroupElements` t [nr:stnr] gActions Nothing \\ t <- tasks & nr <- [1..]] tst
= (flatten panels, tst)
buildPanel (TTSequenceTask ti tasks) gActions mbBehaviour tst
buildGroupElements` (TTSequenceTask ti tasks) stnr gActions mbBehaviour tst
= case filter (not o isFinished) tasks of
[] = ([], tst)
[t] = buildPanel t gActions (Just (getGroupedBehaviour t mbBehaviour)) tst
[t] = buildGroupElements` t stnr gActions (Just (getGroupedBehaviour ti mbBehaviour)) tst
_ = abort "Multiple simultaneously active tasks in a sequence!"
buildPanel t gActions mbBehaviour tst
buildGroupElements` t stnr gActions mbBehaviour tst
# (p, tst) = buildTaskPanel` t menus gActions currentUser tst
= ([(p, getGroupedBehaviour t mbBehaviour)], tst)
= ([{panel = p, behaviour = getGroupedBehaviour (getTaskInfo t) mbBehaviour, index = subtaskNrToString stnr}], tst)
getGroupedBehaviour :: !TaskTree !(Maybe GroupedBehaviour) -> GroupedBehaviour
getGroupedBehaviour task mbFixedBehaviour = case mbFixedBehaviour of
Just fixedBehaviour = fixedBehaviour
Nothing
# info = case task of
(TTInteractiveTask ti _ ) = ti
(TTMonitorTask ti _) = ti
(TTRpcTask ti _) = ti
(TTFinishedTask ti _) = ti
(TTParallelTask ti _ _) = ti
(TTSequenceTask ti _) = ti
(TTMainTask ti _ _ _ _) = ti
(TTGroupedTask ti _ _) = ti
(TTInstructionTask ti _ _) = ti
_ = abort "Unknown panel type in group"
= info.TaskInfo.groupedBehaviour
getGroupedBehaviour :: !TaskInfo !(Maybe GroupedBehaviour) -> GroupedBehaviour
getGroupedBehaviour info mbFixedBehaviour = case mbFixedBehaviour of
Just fixedBehaviour = fixedBehaviour
Nothing = info.TaskInfo.groupedBehaviour
getTaskInfo task
# info = case task of
(TTInteractiveTask ti _ ) = ti
(TTMonitorTask ti _) = ti
(TTRpcTask ti _) = ti
(TTFinishedTask ti _) = ti
(TTParallelTask ti _ _) = ti
(TTSequenceTask ti _) = ti
(TTMainTask ti _ _ _ _) = ti
(TTGroupedTask ti _ _) = ti
(TTInstructionTask ti _ _) = ti
_ = abort "Unknown panel type in group"
= info
// === Menu Functions
makeMenuBar :: !(Maybe [Menu]) ![(Action,Bool)] ![(Action,Bool)] !TaskInfo -> [TUIDef]
......
......@@ -31,12 +31,13 @@ from TUIDefinition import :: TUIDef, :: TUIUpdate
| TTGroupedTask TaskInfo [TaskTree] ![(Action, (Either Bool (*TSt -> *(!Bool,!*TSt))))] //A task that is composed of a number of grouped subtasks
| TTFinishedTask TaskInfo [HtmlTag] //A completed task
:: TaskInfo = { taskId :: TaskId //Task number in string format
, taskLabel :: String //Descriptive label of the task
, traceValue :: String //String representation of value for tracing
, worker :: UserName
, groupedBehaviour :: GroupedBehaviour
, taskDescription :: String
:: TaskInfo = { taskId :: TaskId //Task number in string format
, taskLabel :: String //Descriptive label of the task
, traceValue :: String //String representation of value for tracing
, worker :: UserName
, groupedBehaviour :: GroupedBehaviour
, groupActionsBehaviour :: GroupActionsBehaviour
, taskDescription :: String
}
......@@ -52,4 +53,8 @@ from TUIDefinition import :: TUIDef, :: TUIUpdate
| GBFloating //The editor is shown in a floating window, user can dock editor (making it fixed)
| GBAlwaysFixed //Same as Fixed, but user cannot undock
| GBAlwaysFloating //Same as Floating, but user cannot dock
| GBModal //The editor is shown in a modal dialog
\ No newline at end of file
| GBModal //The editor is shown in a modal dialog
// Determines if group-actions are added to actions of interactive task
:: GroupActionsBehaviour = IncludeGroupActions
| ExcludeGroupActions
\ No newline at end of file
......@@ -5,7 +5,7 @@ definition module Types
*/
from TSt import :: TSt
from TaskTree import :: TaskProperties, :: GroupedBehaviour(..)
from TaskTree import :: TaskProperties, :: GroupedBehaviour(..), :: GroupActionsBehaviour(..)
from Html import :: HtmlTag
from CommonDomain import :: Note, :: Password
from Time import :: Timestamp
......@@ -75,7 +75,7 @@ instance == Password
:: TaskId :== String // String serialization of TaskNr values
:: MenuId :== Int
:: Task a = Task !ManagerProperties !GroupedBehaviour !(Maybe TaskNr) !(*TSt -> *(!TaskResult a,!*TSt))
:: Task a = Task !ManagerProperties !GroupedBehaviour !GroupActionsBehaviour !(Maybe TaskNr) !(*TSt -> *(!TaskResult a,!*TSt))
:: TaskResult a = TaskBusy
| TaskFinished !a
| TaskException !Dynamic
......
......@@ -77,12 +77,12 @@ gParse{|Dynamic|} expr
parseString expr = gParse{|*|} expr
gVisualize{|Task|} fx (VValue (Task props _ _ _) _) _ vst = ([TextFragment props.ManagerProperties.subject],4,vst)
gVisualize{|Task|} fx (VValue (Task props _ _ _ _) _) _ vst = ([TextFragment props.ManagerProperties.subject],4,vst)
gVisualize{|Task|} fx _ _ vst = ([],0,vst)
gUpdate{|Task|} fx _ ust=:{mode=UDCreate}
# (a,ust) = fx (abort "Task create with undef") ust
= (Task {ManagerProperties|worker = UserName "" "",subject = "return", priority = NormalPriority, deadline = Nothing} GBFixed Nothing (\tst -> (TaskFinished a,tst)), ust)
= (Task {ManagerProperties|worker = UserName "" "",subject = "return", priority = NormalPriority, deadline = Nothing} GBFixed IncludeGroupActions Nothing (\tst -> (TaskFinished a,tst)), ust)
gUpdate{|Task|} fx x ust = (x,ust)
gError{|Task|} fx x est = est
......
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