forked from forgejo/forgejo
Add UI to delete tracked times (#14100)
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
6a696b93b1
commit
d38ae597e1
13 changed files with 123 additions and 4 deletions
|
@ -136,6 +136,8 @@ type Comment struct {
|
|||
MilestoneID int64
|
||||
OldMilestone *Milestone `xorm:"-"`
|
||||
Milestone *Milestone `xorm:"-"`
|
||||
TimeID int64
|
||||
Time *TrackedTime `xorm:"-"`
|
||||
AssigneeID int64
|
||||
RemovedAssignee bool
|
||||
Assignee *User `xorm:"-"`
|
||||
|
@ -541,6 +543,16 @@ func (c *Comment) LoadDepIssueDetails() (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
// LoadTime loads the associated time for a CommentTypeAddTimeManual
|
||||
func (c *Comment) LoadTime() error {
|
||||
if c.Time != nil || c.TimeID == 0 {
|
||||
return nil
|
||||
}
|
||||
var err error
|
||||
c.Time, err = GetTrackedTimeByID(c.TimeID)
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Comment) loadReactions(e Engine, repo *Repository) (err error) {
|
||||
if c.Reactions != nil {
|
||||
return nil
|
||||
|
@ -692,6 +704,7 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err
|
|||
MilestoneID: opts.MilestoneID,
|
||||
OldProjectID: opts.OldProjectID,
|
||||
ProjectID: opts.ProjectID,
|
||||
TimeID: opts.TimeID,
|
||||
RemovedAssignee: opts.RemovedAssignee,
|
||||
AssigneeID: opts.AssigneeID,
|
||||
AssigneeTeamID: opts.AssigneeTeamID,
|
||||
|
@ -859,6 +872,7 @@ type CreateCommentOptions struct {
|
|||
MilestoneID int64
|
||||
OldProjectID int64
|
||||
ProjectID int64
|
||||
TimeID int64
|
||||
AssigneeID int64
|
||||
AssigneeTeamID int64
|
||||
RemovedAssignee bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue