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