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