mirror of https://github.com/go-gitea/gitea.git
parent
31df892059
commit
fc8c23edb7
|
@ -21,13 +21,18 @@ func (repo *Repository) CanEnableTimetracker() bool {
|
||||||
|
|
||||||
// IsTimetrackerEnabled returns whether or not the timetracker is enabled. It returns the default value from config if an error occurs.
|
// IsTimetrackerEnabled returns whether or not the timetracker is enabled. It returns the default value from config if an error occurs.
|
||||||
func (repo *Repository) IsTimetrackerEnabled() bool {
|
func (repo *Repository) IsTimetrackerEnabled() bool {
|
||||||
|
return repo.isTimetrackerEnabled(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsTimetrackerEnabled returns whether or not the timetracker is enabled. It returns the default value from config if an error occurs.
|
||||||
|
func (repo *Repository) isTimetrackerEnabled(e Engine) bool {
|
||||||
if !setting.Service.EnableTimetracking {
|
if !setting.Service.EnableTimetracking {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
var u *RepoUnit
|
var u *RepoUnit
|
||||||
var err error
|
var err error
|
||||||
if u, err = repo.GetUnit(UnitTypeIssues); err != nil {
|
if u, err = repo.getUnit(e, UnitTypeIssues); err != nil {
|
||||||
return setting.Service.DefaultEnableTimetracking
|
return setting.Service.DefaultEnableTimetracking
|
||||||
}
|
}
|
||||||
return u.IssuesConfig().EnableTimetracker
|
return u.IssuesConfig().EnableTimetracker
|
||||||
|
|
Loading…
Reference in New Issue