Commit 8b5419c1 authored by Rinus Plasmeijer's avatar Rinus Plasmeijer

rewriting a task does not throw away the underlying code such that one can...

rewriting a task does not throw away the underlying code such that one can still decide whether a task has ended or has been removed.
There is still a bugs, among other in condAnd.
We better fix this when we have the new user interface to deal with this operator.

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@314 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 19206a2d
......@@ -24,10 +24,10 @@ editTask` prompt a tst=:{tasknr,html,hst,userId}
# taskId = iTaskId userId tasknr "EdFin"
# editId = iTaskId userId tasknr "EdVal"
# buttonId = iTaskId userId tasknr "EdBut"
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) id hst // remember if the task has been done
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) id hst // determine if the task has been done previously
| taskdone.Form.value // test if task has completed
# (editor,hst) = (mkEditForm (Init,cFormId tst.options editId a <@ Display) hst) // yes, read out current value, make editor passive
= (editor.Form.value,{tst & activated = True, html = html +|+ BT [] [] , hst = hst}) // return result task
= (editor.Form.value,{tst & activated = True,/* html = html +|+ BT editor.Form.form [],*/ hst = hst}) // return result task
# (editor,hst) = mkEditForm (Init,cFormId tst.options editId a) hst // no, read out current value from active editor
# (finbut,hst) = mySimpleButton tst.options buttonId prompt (\_ -> True) hst // add button for marking task as done
# (taskdone,hst) = mkStoreForm (Init,storageFormId tst.options taskId False) finbut.Form.value hst // remember task status for next time
......
......@@ -58,15 +58,15 @@ where
Once :: !String !(Task a) -> (Task a) | iData a
Once label task = mkTask label (Task doit)
where
doit tst=:{activated,html,tasknr,hst,userId,options}
doit tst=:{activated,tasknr,hst,userId,options}
# taskId = iTaskId userId tasknr (label +++ "_")
# (store,hst) = mkStoreForm (Init,storageFormId options taskId (False,createDefault)) id hst
# (done,value) = store.Form.value
| done = (value,{tst & hst = hst}) // if task has completed, don't do it again
| done = (value,{tst & hst = hst}) // if task has completed, don't do it again
# (value,tst=:{hst})= appTaskTSt task {tst & hst = hst}
# (store,hst) = mkStoreForm (Init,storageFormId options taskId (False,createDefault)) (\_ -> (True,value)) hst // remember task status for next time
# (store,hst) = mkStoreForm (Init,storageFormId options taskId (False,createDefault)) (\_ -> (True,value)) hst // remember task status for next time
# (done,value) = store.Form.value
= (value,{tst & activated = done, hst = hst}) // task is now completed, handle as previously
= (value,{tst & activated = done, hst = hst}) // task is now completed, handle as previously
// ******************************************************************************************************
// looping tasks
......@@ -78,17 +78,17 @@ foreverTask :: !(Task a) -> Task a | iData a
foreverTask task = mkTask "foreverTask" (Task foreverTask`)
where
foreverTask` tst=:{tasknr,activated,userId,options,html}
| options.gc == Collect // garbace collect everything when task finsihed
# (val,tst=:{activated})= appTaskTSt task {tst & tasknr = [-1:tasknr]} // shift tasknr
| activated = foreverTask` (deleteSubTasksAndThreads tasknr {tst & tasknr = tasknr, options = options, html = html}) // loop
| options.gc == Collect // garbace collect everything when task finsihed
# (val,tst=:{activated})= appTaskTSt task {tst & tasknr = [-1:tasknr]} // shift tasknr
| activated = foreverTask` (deleteSubTasksAndThreads tasknr {tst & tasknr = tasknr, options = options/*, html = html*/}) // loop
= (val,tst)
# taskId = iTaskId userId tasknr "ForSt" // create store id
# (currtasknr,tst) = liftHst (mkStoreForm (Init,storageFormId options taskId tasknr) id) tst // fetch actual tasknr
# taskId = iTaskId userId tasknr "ForSt" // create store id
# (currtasknr,tst) = liftHst (mkStoreForm (Init,storageFormId options taskId tasknr) id) tst // fetch actual tasknr
# (val,tst=:{activated}) = appTaskTSt task {tst & tasknr = [-1:currtasknr.Form.value]}
| activated // task is completed
# ntasknr = incNr currtasknr.Form.value // incr tasknr
# (currtasknr,tst) = liftHst (mkStoreForm (Init,storageFormId options taskId tasknr) (\_ -> ntasknr)) tst // store next task nr
= foreverTask` {tst & tasknr = tasknr, options = options, html = html} // initialize new task
| activated // task is completed
# ntasknr = incNr currtasknr.Form.value // incr tasknr
# (currtasknr,tst) = liftHst (mkStoreForm (Init,storageFormId options taskId tasknr) (\_ -> ntasknr)) tst // store next task nr
= foreverTask` {tst & tasknr = tasknr, options = options/*, html = html*/} // initialize new task
= (val,tst)
(<!) infixl 6 :: !(Task a) !(a -> .Bool) -> Task a | iCreateAndPrint a
......@@ -114,8 +114,8 @@ where
# (currtime,tst=:{html=ohtml}) = appTaskTSt (appWorldOnce ("Task " +++ taskname +++ " for " +++ toString nuserId) time) tst
# tst = IF_Ajax (administrateNewThread userId tst) tst
# (a,tst=:{html=nhtml,activated}) = appTaskTSt (IF_Ajax (UseAjax @>> taska) taska) {tst & html = BT [] [],userId = nuserId} // activate task of indicated user NEWTRACE
| activated = (a,{tst & activated = True // work is done
, userId = userId // restore previous user id
| activated = (a,{tst & activated = True // work is done
, userId = userId // restore previous user id
, html = ohtml +|+ ( { delegatorId = userId
, taskWorkerId = nuserId
, taskNrId = toStringTaskNr tasknr
......@@ -125,8 +125,8 @@ where
, taskLabel = taskname
, timeCreated = currtime
, curStatus = activated
} @@: BT [] [])}) // plus new one tagged
= (a,{tst & userId = userId // restore user Id
} @@: nhtml)}) // plus new one tagged
= (a,{tst & userId = userId // restore user Id
, html = ohtml +|+ ( { delegatorId = userId
, taskWorkerId = nuserId
, taskNrId = toStringTaskNr tasknr
......
......@@ -208,11 +208,11 @@ where
pr _ Nothing = []
pr dprev (Just info=:{trTaskName, trActivated})
| dprev && (not trActivated) = pr False Nothing // subtask not important anymore (assume no milestone tasks)
| not trActivated && trTaskName%(0,4) == "Ajax " = showTask cellattr1b White Navy Aqua Silver info
| not trActivated && trTaskName%(0,6) == "Server " = showTask cellattr1b White Navy Aqua Silver info
| not trActivated && trTaskName%(0,6) == "Client " = showTask cellattr1b White Navy Aqua Silver info
| not trActivated = showTask cellattr1b White Navy Maroon Silver info
= showTask cellattr1a White Yellow Red White info
| not trActivated && trTaskName%(0,4) == "Ajax " = showTask cellattr1b Black Navy Aqua Silver info
| not trActivated && trTaskName%(0,6) == "Server " = showTask cellattr1b Black Navy Aqua Silver info
| not trActivated && trTaskName%(0,6) == "Client " = showTask cellattr1b Black Navy Aqua Silver info
| not trActivated = showTask cellattr1b Black Navy Maroon Silver info
= showTask cellattr1a Black Yellow Red Black info
showTask att c1 c2 c3 c4 info
= [STable doneBackground
......
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