1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 18:44:51 +09:00

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
enm WorkflowFieldEnumId Maybe
required Bool
constant Bool
-- filter TicketStatusFilterId
UniqueWorkflowField workflow ident

View file

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

View file

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