Custom ticket fields specify whether required

This commit is contained in:
fr33domlover 2016-08-08 17:29:12 +00:00
parent 17643c6d49
commit a2ca78c790
4 changed files with 6 additions and 0 deletions

View file

@ -168,6 +168,7 @@ WorkflowField
name Text
desc Text Maybe
type WorkflowFieldType
required Bool
-- filter TicketStatusFilterId
UniqueWorkflowField workflow ident

View file

@ -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

View file

@ -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."

View file

@ -24,3 +24,5 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
Description: #{fromMaybe "(none)" $ workflowFieldDesc f}
<li>
Type: #{show $ workflowFieldType f}
<li>
Required: #{workflowFieldRequired f}