Custom ticket fields specify whether required
This commit is contained in:
parent
17643c6d49
commit
a2ca78c790
4 changed files with 6 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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."
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in a new issue