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