diff --git a/config/models b/config/models
index ad475e6..d058919 100644
--- a/config/models
+++ b/config/models
@@ -168,6 +168,7 @@ WorkflowField
name Text
desc Text Maybe
type WorkflowFieldType
+ required Bool
-- filter TicketStatusFilterId
UniqueWorkflowField workflow ident
diff --git a/src/Vervis/Form/Workflow.hs b/src/Vervis/Form/Workflow.hs
index 571bc54..567fb5c 100644
--- a/src/Vervis/Form/Workflow.hs
+++ b/src/Vervis/Form/Workflow.hs
@@ -56,6 +56,7 @@ data NewField = NewField
, nfName :: Text
, nfDesc :: Maybe Text
, nfType :: WorkflowFieldType
+ , nfReq :: Bool
}
newFieldAForm :: WorkflowId -> AForm Handler NewField
@@ -64,6 +65,7 @@ newFieldAForm wid = NewField
<*> areq textField "Name*" Nothing
<*> aopt textField "Description" Nothing
<*> areq (selectField optionsEnum) "Type*" Nothing
+ <*> areq checkBoxField "Required*" Nothing
newFieldForm :: WorkflowId -> Form NewField
newFieldForm wid = renderDivs $ newFieldAForm wid
diff --git a/src/Vervis/Handler/Workflow.hs b/src/Vervis/Handler/Workflow.hs
index 02a3a1d..1b71db6 100644
--- a/src/Vervis/Handler/Workflow.hs
+++ b/src/Vervis/Handler/Workflow.hs
@@ -149,6 +149,7 @@ postWorkflowFieldsR shr wfl = do
, workflowFieldName = nfName nf
, workflowFieldDesc = nfDesc nf
, workflowFieldType = nfType nf
+ , workflowFieldRequired = nfReq nf
}
runDB $ insert_ field
setMessage "Workflow field added."
diff --git a/templates/workflow/field/one.hamlet b/templates/workflow/field/one.hamlet
index 10bf606..1bfc7c5 100644
--- a/templates/workflow/field/one.hamlet
+++ b/templates/workflow/field/one.hamlet
@@ -24,3 +24,5 @@ $#