Ticket custom fields can be constant, i.e. no edits

This commit is contained in:
fr33domlover 2016-08-09 13:22:56 +00:00
parent 19c18b031e
commit d7be2f04b2
3 changed files with 4 additions and 0 deletions

View file

@ -171,6 +171,7 @@ WorkflowField
type WorkflowFieldType type WorkflowFieldType
enm WorkflowFieldEnumId Maybe enm WorkflowFieldEnumId Maybe
required Bool required Bool
constant Bool
-- filter TicketStatusFilterId -- filter TicketStatusFilterId
UniqueWorkflowField workflow ident UniqueWorkflowField workflow ident

View file

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

View file

@ -152,6 +152,7 @@ postWorkflowFieldsR shr wfl = do
, workflowFieldType = nfType nf , workflowFieldType = nfType nf
, workflowFieldEnm = Nothing , workflowFieldEnm = Nothing
, workflowFieldRequired = nfReq nf , workflowFieldRequired = nfReq nf
, workflowFieldConstant = nfConst nf
} }
runDB $ insert_ field runDB $ insert_ field
setMessage "Workflow field added." setMessage "Workflow field added."