From d7be2f04b227847eefa604bc4953c24a2c24c611 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Tue, 9 Aug 2016 13:22:56 +0000 Subject: [PATCH] Ticket custom fields can be constant, i.e. no edits --- config/models | 1 + src/Vervis/Form/Workflow.hs | 2 ++ src/Vervis/Handler/Workflow.hs | 1 + 3 files changed, 4 insertions(+) diff --git a/config/models b/config/models index 7551a13..2e939d4 100644 --- a/config/models +++ b/config/models @@ -171,6 +171,7 @@ WorkflowField type WorkflowFieldType enm WorkflowFieldEnumId Maybe required Bool + constant Bool -- filter TicketStatusFilterId UniqueWorkflowField workflow ident diff --git a/src/Vervis/Form/Workflow.hs b/src/Vervis/Form/Workflow.hs index 567fb5c..d6462ed 100644 --- a/src/Vervis/Form/Workflow.hs +++ b/src/Vervis/Form/Workflow.hs @@ -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 diff --git a/src/Vervis/Handler/Workflow.hs b/src/Vervis/Handler/Workflow.hs index dba0d19..cc2adf2 100644 --- a/src/Vervis/Handler/Workflow.hs +++ b/src/Vervis/Handler/Workflow.hs @@ -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."