annotate .svn/pristine/cf/cf1f7ec64f7ca44a3fcc2b553d180407341c51aa.svn-base @ 1296:038ba2d95de8 redmine-2.2

Fix redmine-2.2 branch update (add missing svn files)
author Chris Cannam
date Fri, 14 Jun 2013 09:05:06 +0100
parents
children
rev   line source
Chris@1296 1 <h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3>
Chris@1296 2 <%
Chris@1296 3 entries = TimeEntry.find(:all,
Chris@1296 4 :conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - 6, Date.today],
Chris@1296 5 :include => [:activity, :project, {:issue => [:tracker, :status]}],
Chris@1296 6 :order => "#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC")
Chris@1296 7 entries_by_day = entries.group_by(&:spent_on)
Chris@1296 8 %>
Chris@1296 9
Chris@1296 10 <div class="total-hours">
Chris@1296 11 <p><%= l(:label_total) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p>
Chris@1296 12 </div>
Chris@1296 13
Chris@1296 14 <% if entries.any? %>
Chris@1296 15 <table class="list time-entries">
Chris@1296 16 <thead><tr>
Chris@1296 17 <th><%= l(:label_activity) %></th>
Chris@1296 18 <th><%= l(:label_project) %></th>
Chris@1296 19 <th><%= l(:field_comments) %></th>
Chris@1296 20 <th><%= l(:field_hours) %></th>
Chris@1296 21 <th></th>
Chris@1296 22 </tr></thead>
Chris@1296 23 <tbody>
Chris@1296 24 <% entries_by_day.keys.sort.reverse.each do |day| %>
Chris@1296 25 <tr class="odd">
Chris@1296 26 <td><strong><%= day == Date.today ? l(:label_today).titleize : format_date(day) %></strong></td>
Chris@1296 27 <td colspan="2"></td>
Chris@1296 28 <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td>
Chris@1296 29 <td></td>
Chris@1296 30 </tr>
Chris@1296 31 <% entries_by_day[day].each do |entry| -%>
Chris@1296 32 <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;">
Chris@1296 33 <td class="activity"><%=h entry.activity %></td>
Chris@1296 34 <td class="subject"><%=h entry.project %> <%= h(' - ') + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td>
Chris@1296 35 <td class="comments"><%=h entry.comments %></td>
Chris@1296 36 <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td>
Chris@1296 37 <td align="center">
Chris@1296 38 <% if entry.editable_by?(@user) -%>
Chris@1296 39 <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry},
Chris@1296 40 :title => l(:button_edit) %>
Chris@1296 41 <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry},
Chris@1296 42 :data => {:confirm => l(:text_are_you_sure)},
Chris@1296 43 :method => :delete,
Chris@1296 44 :title => l(:button_delete) %>
Chris@1296 45 <% end -%>
Chris@1296 46 </td>
Chris@1296 47 </tr>
Chris@1296 48 <% end -%>
Chris@1296 49 <% end -%>
Chris@1296 50 </tbody>
Chris@1296 51 </table>
Chris@1296 52 <% end %>