mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Add UI to delete tracked times (#14100)
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user