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