Project

General

Profile

Patch #6546 » timelog_last_week.diff

Maxim Strukov, 2010-09-30 16:14

View differences:

home/mst/desktop/redmine-1.0/app/views/my/blocks/_timelog.rhtml
1
<h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3>
2
<% 
1
<h3><%=l(:label_spent_time)%> (<%= l(:label_this_week) %>)</h3>
2
<%
3 3
entries = TimeEntry.find(:all,
4
				:conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - 6, Date.today],
4
				:conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - (Date.today.cwday - 1) % 7, Date.today - (Date.today.cwday - 1) % 7 + 6],
5 5
				:include => [:activity, :project, {:issue => [:tracker, :status]}],
6 6
				:order => "#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC")
7 7
entries_by_day = entries.group_by(&:spent_on)
......
50 50
</tbody>
51 51
</table>
52 52
<% end %>
53

  
(1-1/2)