@@ -1,74 +1,74 | |||||
1 | <div class="contextual"> |
|
1 | <div class="contextual"> | |
2 | <%= link_to l(:button_log_time), |
|
2 | <%= link_to l(:button_log_time), | |
3 | _new_time_entry_path(@project, @issue), |
|
3 | _new_time_entry_path(@project, @issue), | |
4 | :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %> |
|
4 | :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %> | |
5 | </div> |
|
5 | </div> | |
6 |
|
6 | |||
7 | <%= render_timelog_breadcrumb %> |
|
7 | <%= render_timelog_breadcrumb %> | |
8 |
|
8 | |||
9 | <h2><%= l(:label_spent_time) %></h2> |
|
9 | <h2><%= l(:label_spent_time) %></h2> | |
10 |
|
10 | |||
11 | <%= form_tag(params.slice(:project_id, :issue_id), :method => :get, :id => 'query_form') do %> |
|
11 | <%= form_tag(params.slice(:project_id, :issue_id), :method => :get, :id => 'query_form') do %> | |
12 | <% @report.criteria.each do |criterion| %> |
|
12 | <% @report.criteria.each do |criterion| %> | |
13 | <%= hidden_field_tag 'criteria[]', criterion, :id => nil %> |
|
13 | <%= hidden_field_tag 'criteria[]', criterion, :id => nil %> | |
14 | <% end %> |
|
14 | <% end %> | |
15 | <%= render :partial => 'timelog/date_range' %> |
|
15 | <%= render :partial => 'timelog/date_range' %> | |
16 |
|
16 | |||
17 | <p><label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'], |
|
17 | <p><label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'], | |
18 | [l(:label_month), 'month'], |
|
18 | [l(:label_month), 'month'], | |
19 | [l(:label_week), 'week'], |
|
19 | [l(:label_week), 'week'], | |
20 | [l(:label_day_plural).titleize, 'day']], @report.columns), |
|
20 | [l(:label_day_plural).titleize, 'day']], @report.columns), | |
21 | :onchange => "this.form.submit();" %> |
|
21 | :onchange => "this.form.submit();" %> | |
22 |
|
22 | |||
23 | <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criteria[]', options_for_select([[]] + (@report.available_criteria.keys - @report.criteria).collect{|k| [l_or_humanize(@report.available_criteria[k][:label]), k]}), |
|
23 | <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criteria[]', options_for_select([[]] + (@report.available_criteria.keys - @report.criteria).collect{|k| [l_or_humanize(@report.available_criteria[k][:label]), k]}), | |
24 | :onchange => "this.form.submit();", |
|
24 | :onchange => "this.form.submit();", | |
25 | :style => 'width: 200px', |
|
25 | :style => 'width: 200px', | |
26 |
: |
|
26 | :disabled => (@report.criteria.length >= 3), | |
27 |
: |
|
27 | :id => "criterias") %> | |
28 | <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @report.columns}, :class => 'icon icon-reload' %></p> |
|
28 | <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @report.columns}, :class => 'icon icon-reload' %></p> | |
29 | <% end %> |
|
29 | <% end %> | |
30 |
|
30 | |||
31 | <% unless @report.criteria.empty? %> |
|
31 | <% unless @report.criteria.empty? %> | |
32 | <div class="total-hours"> |
|
32 | <div class="total-hours"> | |
33 | <p><%= l(:label_total_time) %>: <%= html_hours(l_hours(@report.total_hours)) %></p> |
|
33 | <p><%= l(:label_total_time) %>: <%= html_hours(l_hours(@report.total_hours)) %></p> | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | <% unless @report.hours.empty? %> |
|
36 | <% unless @report.hours.empty? %> | |
37 | <div class="autoscroll"> |
|
37 | <div class="autoscroll"> | |
38 | <table class="list" id="time-report"> |
|
38 | <table class="list" id="time-report"> | |
39 | <thead> |
|
39 | <thead> | |
40 | <tr> |
|
40 | <tr> | |
41 | <% @report.criteria.each do |criteria| %> |
|
41 | <% @report.criteria.each do |criteria| %> | |
42 | <th><%= l_or_humanize(@report.available_criteria[criteria][:label]) %></th> |
|
42 | <th><%= l_or_humanize(@report.available_criteria[criteria][:label]) %></th> | |
43 | <% end %> |
|
43 | <% end %> | |
44 | <% columns_width = (40 / (@report.periods.length+1)).to_i %> |
|
44 | <% columns_width = (40 / (@report.periods.length+1)).to_i %> | |
45 | <% @report.periods.each do |period| %> |
|
45 | <% @report.periods.each do |period| %> | |
46 | <th class="period" style="width:<%= columns_width %>%;"><%= period %></th> |
|
46 | <th class="period" style="width:<%= columns_width %>%;"><%= period %></th> | |
47 | <% end %> |
|
47 | <% end %> | |
48 | <th class="total" style="width:<%= columns_width %>%;"><%= l(:label_total_time) %></th> |
|
48 | <th class="total" style="width:<%= columns_width %>%;"><%= l(:label_total_time) %></th> | |
49 | </tr> |
|
49 | </tr> | |
50 | </thead> |
|
50 | </thead> | |
51 | <tbody> |
|
51 | <tbody> | |
52 | <%= render :partial => 'report_criteria', :locals => {:criterias => @report.criteria, :hours => @report.hours, :level => 0} %> |
|
52 | <%= render :partial => 'report_criteria', :locals => {:criterias => @report.criteria, :hours => @report.hours, :level => 0} %> | |
53 | <tr class="total"> |
|
53 | <tr class="total"> | |
54 | <td><%= l(:label_total_time) %></td> |
|
54 | <td><%= l(:label_total_time) %></td> | |
55 | <%= ('<td></td>' * (@report.criteria.size - 1)).html_safe %> |
|
55 | <%= ('<td></td>' * (@report.criteria.size - 1)).html_safe %> | |
56 | <% total = 0 -%> |
|
56 | <% total = 0 -%> | |
57 | <% @report.periods.each do |period| -%> |
|
57 | <% @report.periods.each do |period| -%> | |
58 | <% sum = sum_hours(select_hours(@report.hours, @report.columns, period.to_s)); total += sum -%> |
|
58 | <% sum = sum_hours(select_hours(@report.hours, @report.columns, period.to_s)); total += sum -%> | |
59 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> |
|
59 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> | |
60 | <% end -%> |
|
60 | <% end -%> | |
61 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> |
|
61 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> | |
62 | </tr> |
|
62 | </tr> | |
63 | </tbody> |
|
63 | </tbody> | |
64 | </table> |
|
64 | </table> | |
65 | </div> |
|
65 | </div> | |
66 |
|
66 | |||
67 | <% other_formats_links do |f| %> |
|
67 | <% other_formats_links do |f| %> | |
68 | <%= f.link_to 'CSV', :url => params %> |
|
68 | <%= f.link_to 'CSV', :url => params %> | |
69 | <% end %> |
|
69 | <% end %> | |
70 | <% end %> |
|
70 | <% end %> | |
71 | <% end %> |
|
71 | <% end %> | |
72 |
|
72 | |||
73 | <% html_title l(:label_spent_time), l(:label_report) %> |
|
73 | <% html_title l(:label_spent_time), l(:label_report) %> | |
74 |
|
74 |
General Comments 0
You need to be logged in to leave comments.
Login now