@@ -1,35 +1,35 | |||
|
1 | 1 | <div class="contextual"> |
|
2 | 2 | <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time-add' %> |
|
3 | 3 | </div> |
|
4 | 4 | |
|
5 | 5 | <%= render_timelog_breadcrumb %> |
|
6 | 6 | |
|
7 | 7 | <h2><%= l(:label_spent_time) %></h2> |
|
8 | 8 | |
|
9 | 9 | <% form_remote_tag( :url => {}, :html => {:method => :get}, :method => :get, :update => 'content' ) do %> |
|
10 | 10 | <%# TOOD: remove the project_id and issue_id hidden fields, that information is |
|
11 | 11 | already in the URI %> |
|
12 |
<%= hidden_field_tag |
|
|
12 | <%= hidden_field_tag('project_id', params[:project_id]) if @project %> | |
|
13 | 13 | <%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %> |
|
14 | 14 | <%= render :partial => 'date_range' %> |
|
15 | 15 | <% end %> |
|
16 | 16 | |
|
17 | 17 | <div class="total-hours"> |
|
18 | 18 | <p><%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %></p> |
|
19 | 19 | </div> |
|
20 | 20 | |
|
21 | 21 | <% unless @entries.empty? %> |
|
22 | 22 | <%= render :partial => 'list', :locals => { :entries => @entries }%> |
|
23 | 23 | <p class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></p> |
|
24 | 24 | |
|
25 | 25 | <% other_formats_links do |f| %> |
|
26 | 26 | <%= f.link_to 'Atom', :url => params.merge({:issue_id => @issue, :key => User.current.rss_key}) %> |
|
27 | 27 | <%= f.link_to 'CSV', :url => params %> |
|
28 | 28 | <% end %> |
|
29 | 29 | <% end %> |
|
30 | 30 | |
|
31 | 31 | <% html_title l(:label_spent_time), l(:label_details) %> |
|
32 | 32 | |
|
33 | 33 | <% content_for :header_tags do %> |
|
34 | 34 | <%= auto_discovery_link_tag(:atom, {:issue_id => @issue, :format => 'atom', :key => User.current.rss_key}, :title => l(:label_spent_time)) %> |
|
35 | 35 | <% end %> |
@@ -1,75 +1,75 | |||
|
1 | 1 | <div class="contextual"> |
|
2 | 2 | <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time-add' %> |
|
3 | 3 | </div> |
|
4 | 4 | |
|
5 | 5 | <%= render_timelog_breadcrumb %> |
|
6 | 6 | |
|
7 | 7 | <h2><%= l(:label_spent_time) %></h2> |
|
8 | 8 | |
|
9 | 9 | <% form_remote_tag(:url => {}, :html => {:method => :get}, :method => :get, :update => 'content') do %> |
|
10 | 10 | <% @criterias.each do |criteria| %> |
|
11 | 11 | <%= hidden_field_tag 'criterias[]', criteria, :id => nil %> |
|
12 | 12 | <% end %> |
|
13 | 13 | <%# TODO: get rid of the project_id field, that should already be in the URL %> |
|
14 |
<%= hidden_field_tag |
|
|
14 | <%= hidden_field_tag('project_id', params[:project_id]) if @project %> | |
|
15 | 15 | <%= render :partial => 'date_range' %> |
|
16 | 16 | |
|
17 | 17 | <p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'], |
|
18 | 18 | [l(:label_month), 'month'], |
|
19 | 19 | [l(:label_week), 'week'], |
|
20 | 20 | [l(:label_day_plural).titleize, 'day']], @columns), |
|
21 | 21 | :onchange => "this.form.onsubmit();" %> |
|
22 | 22 | |
|
23 | 23 | <%= l(:button_add) %>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[k][:label]), k]}), |
|
24 | 24 | :onchange => "this.form.onsubmit();", |
|
25 | 25 | :style => 'width: 200px', |
|
26 | 26 | :id => nil, |
|
27 | 27 | :disabled => (@criterias.length >= 3)) %> |
|
28 | 28 | <%= link_to_remote l(:button_clear), {:url => {:project_id => @project, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @columns}, |
|
29 | 29 | :method => :get, |
|
30 | 30 | :update => 'content' |
|
31 | 31 | }, :class => 'icon icon-reload' %></p> |
|
32 | 32 | <% end %> |
|
33 | 33 | |
|
34 | 34 | <% unless @criterias.empty? %> |
|
35 | 35 | <div class="total-hours"> |
|
36 | 36 | <p><%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %></p> |
|
37 | 37 | </div> |
|
38 | 38 | |
|
39 | 39 | <% unless @hours.empty? %> |
|
40 | 40 | <table class="list" id="time-report"> |
|
41 | 41 | <thead> |
|
42 | 42 | <tr> |
|
43 | 43 | <% @criterias.each do |criteria| %> |
|
44 | 44 | <th><%= l_or_humanize(@available_criterias[criteria][:label]) %></th> |
|
45 | 45 | <% end %> |
|
46 | 46 | <% columns_width = (40 / (@periods.length+1)).to_i %> |
|
47 | 47 | <% @periods.each do |period| %> |
|
48 | 48 | <th class="period" width="<%= columns_width %>%"><%= period %></th> |
|
49 | 49 | <% end %> |
|
50 | 50 | <th class="total" width="<%= columns_width %>%"><%= l(:label_total) %></th> |
|
51 | 51 | </tr> |
|
52 | 52 | </thead> |
|
53 | 53 | <tbody> |
|
54 | 54 | <%= render :partial => 'report_criteria', :locals => {:criterias => @criterias, :hours => @hours, :level => 0} %> |
|
55 | 55 | <tr class="total"> |
|
56 | 56 | <td><%= l(:label_total) %></td> |
|
57 | 57 | <%= '<td></td>' * (@criterias.size - 1) %> |
|
58 | 58 | <% total = 0 -%> |
|
59 | 59 | <% @periods.each do |period| -%> |
|
60 | 60 | <% sum = sum_hours(select_hours(@hours, @columns, period.to_s)); total += sum -%> |
|
61 | 61 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> |
|
62 | 62 | <% end -%> |
|
63 | 63 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> |
|
64 | 64 | </tr> |
|
65 | 65 | </tbody> |
|
66 | 66 | </table> |
|
67 | 67 | |
|
68 | 68 | <% other_formats_links do |f| %> |
|
69 | 69 | <%= f.link_to 'CSV', :url => params %> |
|
70 | 70 | <% end %> |
|
71 | 71 | <% end %> |
|
72 | 72 | <% end %> |
|
73 | 73 | |
|
74 | 74 | <% html_title l(:label_spent_time), l(:label_report) %> |
|
75 | 75 |
General Comments 0
You need to be logged in to leave comments.
Login now