limit spent time block to project, but show all visible entries

pull/6827/head
Jens Ulferts 8 years ago
parent 2e3780761a
commit 404e100694
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 6
      app/views/my_projects_overviews/blocks/_spent_time.html.erb

@ -31,7 +31,9 @@ See doc/COPYRIGHT.md for more details.
<%
entries = TimeEntry
.includes([:activity, :project, {:work_package => [:type, :status]}])
.where(["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", user.id, Date.today - 6, Date.today]).references(:projects)
.visible(User.current)
.where(project_id: @project.id)
.where(["#{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", Date.today - 6, Date.today]).references(:projects)
.order("#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Type.table_name}.position ASC, #{WorkPackage.table_name}.id ASC")
entries_by_day = entries.group_by(&:spent_on)
%>
@ -128,7 +130,7 @@ See doc/COPYRIGHT.md for more details.
<% end -%>
</tbody>
</table>
</div>
</div>
<% end %>

Loading…
Cancel
Save