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 name Text
desc Text Maybe desc Text Maybe
type WorkflowFieldType type WorkflowFieldType
required Bool
-- filter TicketStatusFilterId -- filter TicketStatusFilterId
UniqueWorkflowField workflow ident UniqueWorkflowField workflow ident

View file

@ -56,6 +56,7 @@ data NewField = NewField
, nfName :: Text , nfName :: Text
, nfDesc :: Maybe Text , nfDesc :: Maybe Text
, nfType :: WorkflowFieldType , nfType :: WorkflowFieldType
, nfReq :: Bool
} }
newFieldAForm :: WorkflowId -> AForm Handler NewField newFieldAForm :: WorkflowId -> AForm Handler NewField
@ -64,6 +65,7 @@ newFieldAForm wid = NewField
<*> areq textField "Name*" Nothing <*> areq textField "Name*" Nothing
<*> aopt textField "Description" Nothing <*> aopt textField "Description" Nothing
<*> areq (selectField optionsEnum) "Type*" Nothing <*> areq (selectField optionsEnum) "Type*" Nothing
<*> areq checkBoxField "Required*" Nothing
newFieldForm :: WorkflowId -> Form NewField newFieldForm :: WorkflowId -> Form NewField
newFieldForm wid = renderDivs $ newFieldAForm wid newFieldForm wid = renderDivs $ newFieldAForm wid

View file

@ -149,6 +149,7 @@ postWorkflowFieldsR shr wfl = do
, workflowFieldName = nfName nf , workflowFieldName = nfName nf
, workflowFieldDesc = nfDesc nf , workflowFieldDesc = nfDesc nf
, workflowFieldType = nfType nf , workflowFieldType = nfType nf
, workflowFieldRequired = nfReq nf
} }
runDB $ insert_ field runDB $ insert_ field
setMessage "Workflow field added." setMessage "Workflow field added."

View file

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