Each ticket has a unique discussion ID
This commit is contained in:
parent
604e3ca80a
commit
c435dfa89b
3 changed files with 5 additions and 1 deletions
|
@ -75,6 +75,7 @@ Ticket
|
|||
done Bool
|
||||
closed UTCTime
|
||||
closer PersonId
|
||||
discuss DiscussionId
|
||||
|
||||
UniqueTicket project number
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ editTicketAForm ticket pid = fmap fixDone $ Ticket
|
|||
<*> areq checkBoxField "Done*" (Just $ ticketDone ticket)
|
||||
<*> now
|
||||
<*> pure (ticketCloser ticket)
|
||||
<*> pure (ticketDiscuss ticket)
|
||||
where
|
||||
fixDone result = case (ticketDone ticket, ticketDone result) of
|
||||
(True, True) -> result { ticketClosed = ticketClosed ticket }
|
||||
|
|
|
@ -83,6 +83,8 @@ postTicketsR shar proj = do
|
|||
Entity pid project <- do
|
||||
Entity sid _sharer <- getBy404 $ UniqueSharerIdent shar
|
||||
getBy404 $ UniqueProject proj sid
|
||||
update pid [ProjectNextTicket +=. 1]
|
||||
did <- insert Discussion
|
||||
let ticket = Ticket
|
||||
{ ticketProject = pid
|
||||
, ticketNumber = projectNextTicket project
|
||||
|
@ -93,8 +95,8 @@ postTicketsR shar proj = do
|
|||
, ticketDone = False
|
||||
, ticketClosed = UTCTime (ModifiedJulianDay 0) 0
|
||||
, ticketCloser = author
|
||||
, ticketDiscuss = did
|
||||
}
|
||||
update pid [ProjectNextTicket +=. 1]
|
||||
insert_ ticket
|
||||
return $ ticketNumber ticket
|
||||
setMessage "Ticket created."
|
||||
|
|
Loading…
Reference in a new issue