mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-29 02:14:52 +09:00
Ticket custom fields can be constant, i.e. no edits
This commit is contained in:
parent
19c18b031e
commit
d7be2f04b2
3 changed files with 4 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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."
|
||||||
|
|
Loading…
Reference in a new issue