|
|
@ -33,11 +33,23 @@ module OpenProject::Costs |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def time_entries |
|
|
|
def time_entries |
|
|
|
|
|
|
|
if @work_package.time_entries.loaded? |
|
|
|
|
|
|
|
@work_package.time_entries.select do |time_entry| |
|
|
|
|
|
|
|
time_entry.visible_by?(@user) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
else |
|
|
|
@work_package.time_entries.visible(@user, @work_package.project) |
|
|
|
@work_package.time_entries.visible(@user, @work_package.project) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def cost_entries |
|
|
|
def cost_entries |
|
|
|
@cost_entries ||= @work_package.cost_entries.visible(@user, @work_package.project) |
|
|
|
@cost_entries ||= if @work_package.cost_entries.loaded? |
|
|
|
|
|
|
|
@work_package.cost_entries.select do |cost_entry| |
|
|
|
|
|
|
|
cost_entry.visible_by?(@user) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
@work_package.cost_entries.visible(@user, @work_package.project) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
private |
|
|
|
private |
|
|
|