Commit a8519c32 authored by Bas Lijnse's avatar Bas Lijnse

Migrated quotation/review example

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@508 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent c2fad3d3
......@@ -13,6 +13,7 @@ import ScheduleMeeting
import MovingTask
import DeadlineTask
import DelegateTask
import ReviewTask
//Miscellaneous examples
import Coffeemachine
......@@ -31,6 +32,7 @@ where
, movingTaskExample
, deadlineTaskExample
, delegateTaskExample
, reviewTaskExample
, coffeemachineExample
, newsgroupsExample
, exceptionHandlingExample
......
definition module ReviewTask
import iTasks
reviewTaskExample :: [Workflow]
\ No newline at end of file
module quotation
implementation module ReviewTask
import StdList, iTasks, iDataTrivial, StdBimap
import iTasks, iDataTrivial
// (c) 2007 MJP
......@@ -15,10 +15,6 @@ derive gForm QForm, Review, Person, Gender
derive gUpd QForm, Review, Person, Gender
derive gParse QForm, Review, Person, Gender
derive gPrint QForm, Review, Person, Gender
//derive gerda QForm, Review, Person, Gender
//derive read QForm, Review, Person, Gender
//derive write QForm, Review, Person, Gender
:: PersonData = { name :: String
, e_mail :: String
......@@ -28,8 +24,6 @@ derive gPrint QForm, Review, Person, Gender
, city :: String
}
Start world = startEngine [myWorkflow] world
:: QForm = { toComp :: String
, startDate :: HtmlDate
, endDate :: HtmlDate
......@@ -44,18 +38,19 @@ Start world = startEngine [myWorkflow] world
}
:: Gender = Male | Female
:: Review = Approved | Rejected | NeedsRework HtmlTextarea
:: UserID :== Int
myWorkflow
= { name = "quotation"
, label = "quotation"
reviewTaskExample :: [Workflow]
reviewTaskExample
= [ { name = "quotation"
, label = "Review the results of a task"
, roles = []
, mainTask = reviewtask #>> return_V Void
, mainTask = reviewtask >>| return Void
}
]
editTaskSA :: String a -> Task a | iData a
editTaskSA s a = UseAjax @>> editTask s a <<@ Submit
editTaskSA s a = editTask s a <<@ Submit
reviewtask :: Task (QForm,Review)
reviewtask = taskToReview 1 (createDefault, mytask)
......@@ -64,7 +59,7 @@ mytask :: a -> (Task a) | iData a
mytask v = [Text "Fill in Form:",BrTag [],BrTag []]
?>> editTaskSA "TaskDone" v
taskToReview :: UserID (a,a -> Task a) -> Task (a,Review) | iData a
taskToReview :: UserId (a,a -> Task a) -> Task (a,Review) | iData a
taskToReview reviewer (v`,task)
= newTask "taskToReview" taskToReview`
where
......@@ -75,13 +70,13 @@ where
?>> editTask "OK" Void
#>> case r of
(NeedsRework _) -> taskToReview reviewer (v,task)
else -> return_V (v,r)
else -> return (v,r)
review :: a -> Task Review | iData a
review v
= [toHtml v,BrTag [],BrTag []]
?>> chooseTask []
[ ("Rework", editTaskSA "Done" (NeedsRework createDefault))
, ("Approved",return_V Approved)
, ("Reject", return_V Rejected)
[ ("Rework", editTaskSA "Done" (NeedsRework createDefault))
, ("Approved", return Approved)
, ("Reject", return Rejected)
]
This source diff could not be displayed because it is too large. You can view the blob instead.
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