@@ -1,70 +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 => '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 | <%= 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']], @columns), |
|
18 | [l(:label_day_plural).titleize, 'day']], @columns), | |
19 | :onchange => "this.form.onsubmit();" %> |
|
19 | :onchange => "this.form.onsubmit();" %> | |
20 |
|
20 | |||
21 | <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[k][:label]), k]}), |
|
21 | <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[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 => (@criterias.length >= 3), :id => "criterias") %> |
|
25 | :disabled => (@criterias.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 => @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> | |
27 | <% end %> |
|
27 | <% end %> | |
28 |
|
28 | |||
29 | <% unless @criterias.empty? %> |
|
29 | <% unless @criterias.empty? %> | |
30 | <div class="total-hours"> |
|
30 | <div class="total-hours"> | |
31 | <p><%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %></p> |
|
31 | <p><%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %></p> | |
32 | </div> |
|
32 | </div> | |
33 |
|
33 | |||
34 | <% unless @hours.empty? %> |
|
34 | <% unless @hours.empty? %> | |
|
35 | <div class="autoscroll"> | |||
35 | <table class="list" id="time-report"> |
|
36 | <table class="list" id="time-report"> | |
36 | <thead> |
|
37 | <thead> | |
37 | <tr> |
|
38 | <tr> | |
38 | <% @criterias.each do |criteria| %> |
|
39 | <% @criterias.each do |criteria| %> | |
39 | <th><%= l_or_humanize(@available_criterias[criteria][:label]) %></th> |
|
40 | <th><%= l_or_humanize(@available_criterias[criteria][:label]) %></th> | |
40 | <% end %> |
|
41 | <% end %> | |
41 | <% columns_width = (40 / (@periods.length+1)).to_i %> |
|
42 | <% columns_width = (40 / (@periods.length+1)).to_i %> | |
42 | <% @periods.each do |period| %> |
|
43 | <% @periods.each do |period| %> | |
43 | <th class="period" width="<%= columns_width %>%"><%= period %></th> |
|
44 | <th class="period" width="<%= columns_width %>%"><%= period %></th> | |
44 | <% end %> |
|
45 | <% end %> | |
45 | <th class="total" width="<%= columns_width %>%"><%= l(:label_total) %></th> |
|
46 | <th class="total" width="<%= columns_width %>%"><%= l(:label_total) %></th> | |
46 | </tr> |
|
47 | </tr> | |
47 | </thead> |
|
48 | </thead> | |
48 | <tbody> |
|
49 | <tbody> | |
49 | <%= render :partial => 'report_criteria', :locals => {:criterias => @criterias, :hours => @hours, :level => 0} %> |
|
50 | <%= render :partial => 'report_criteria', :locals => {:criterias => @criterias, :hours => @hours, :level => 0} %> | |
50 | <tr class="total"> |
|
51 | <tr class="total"> | |
51 | <td><%= l(:label_total) %></td> |
|
52 | <td><%= l(:label_total) %></td> | |
52 | <%= '<td></td>' * (@criterias.size - 1) %> |
|
53 | <%= '<td></td>' * (@criterias.size - 1) %> | |
53 | <% total = 0 -%> |
|
54 | <% total = 0 -%> | |
54 | <% @periods.each do |period| -%> |
|
55 | <% @periods.each do |period| -%> | |
55 | <% sum = sum_hours(select_hours(@hours, @columns, period.to_s)); total += sum -%> |
|
56 | <% sum = sum_hours(select_hours(@hours, @columns, period.to_s)); total += sum -%> | |
56 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> |
|
57 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> | |
57 | <% end -%> |
|
58 | <% end -%> | |
58 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> |
|
59 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> | |
59 | </tr> |
|
60 | </tr> | |
60 | </tbody> |
|
61 | </tbody> | |
61 | </table> |
|
62 | </table> | |
|
63 | </div> | |||
62 |
|
64 | |||
63 | <% other_formats_links do |f| %> |
|
65 | <% other_formats_links do |f| %> | |
64 | <%= f.link_to 'CSV', :url => params %> |
|
66 | <%= f.link_to 'CSV', :url => params %> | |
65 | <% end %> |
|
67 | <% end %> | |
66 | <% end %> |
|
68 | <% end %> | |
67 | <% end %> |
|
69 | <% end %> | |
68 |
|
70 | |||
69 | <% html_title l(:label_spent_time), l(:label_report) %> |
|
71 | <% html_title l(:label_spent_time), l(:label_report) %> | |
70 |
|
72 |
@@ -1,53 +1,55 | |||||
1 | <% form_tag({}) do -%> |
|
1 | <% form_tag({}) do -%> | |
2 | <%= hidden_field_tag 'back_url', url_for(params) %> |
|
2 | <%= hidden_field_tag 'back_url', url_for(params) %> | |
|
3 | <div class="autoscroll"> | |||
3 | <table class="list time-entries"> |
|
4 | <table class="list time-entries"> | |
4 | <thead> |
|
5 | <thead> | |
5 | <tr> |
|
6 | <tr> | |
6 | <th class="checkbox hide-when-print"> |
|
7 | <th class="checkbox hide-when-print"> | |
7 | <%= link_to image_tag('toggle_check.png'), |
|
8 | <%= link_to image_tag('toggle_check.png'), | |
8 | {}, |
|
9 | {}, | |
9 | :onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;', |
|
10 | :onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;', | |
10 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> |
|
11 | :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> | |
11 | </th> |
|
12 | </th> | |
12 | <%= sort_header_tag('spent_on', :caption => l(:label_date), :default_order => 'desc') %> |
|
13 | <%= sort_header_tag('spent_on', :caption => l(:label_date), :default_order => 'desc') %> | |
13 | <%= sort_header_tag('user', :caption => l(:label_member)) %> |
|
14 | <%= sort_header_tag('user', :caption => l(:label_member)) %> | |
14 | <%= sort_header_tag('activity', :caption => l(:label_activity)) %> |
|
15 | <%= sort_header_tag('activity', :caption => l(:label_activity)) %> | |
15 | <%= sort_header_tag('project', :caption => l(:label_project)) %> |
|
16 | <%= sort_header_tag('project', :caption => l(:label_project)) %> | |
16 | <%= sort_header_tag('issue', :caption => l(:label_issue), :default_order => 'desc') %> |
|
17 | <%= sort_header_tag('issue', :caption => l(:label_issue), :default_order => 'desc') %> | |
17 | <th><%= l(:field_comments) %></th> |
|
18 | <th><%= l(:field_comments) %></th> | |
18 | <%= sort_header_tag('hours', :caption => l(:field_hours)) %> |
|
19 | <%= sort_header_tag('hours', :caption => l(:field_hours)) %> | |
19 | <th></th> |
|
20 | <th></th> | |
20 | </tr> |
|
21 | </tr> | |
21 | </thead> |
|
22 | </thead> | |
22 | <tbody> |
|
23 | <tbody> | |
23 | <% entries.each do |entry| -%> |
|
24 | <% entries.each do |entry| -%> | |
24 | <tr class="time-entry <%= cycle("odd", "even") %> hascontextmenu"> |
|
25 | <tr class="time-entry <%= cycle("odd", "even") %> hascontextmenu"> | |
25 | <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td> |
|
26 | <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td> | |
26 | <td class="spent_on"><%= format_date(entry.spent_on) %></td> |
|
27 | <td class="spent_on"><%= format_date(entry.spent_on) %></td> | |
27 | <td class="user"><%= link_to_user(entry.user) %></td> |
|
28 | <td class="user"><%= link_to_user(entry.user) %></td> | |
28 | <td class="activity"><%=h entry.activity %></td> |
|
29 | <td class="activity"><%=h entry.activity %></td> | |
29 | <td class="project"><%= link_to_project(entry.project) %></td> |
|
30 | <td class="project"><%= link_to_project(entry.project) %></td> | |
30 | <td class="subject"> |
|
31 | <td class="subject"> | |
31 | <% if entry.issue -%> |
|
32 | <% if entry.issue -%> | |
32 | <%= entry.issue.visible? ? link_to_issue(entry.issue, :truncate => 50) : "##{entry.issue.id}" -%> |
|
33 | <%= entry.issue.visible? ? link_to_issue(entry.issue, :truncate => 50) : "##{entry.issue.id}" -%> | |
33 | <% end -%> |
|
34 | <% end -%> | |
34 | </td> |
|
35 | </td> | |
35 | <td class="comments"><%=h entry.comments %></td> |
|
36 | <td class="comments"><%=h entry.comments %></td> | |
36 | <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td> |
|
37 | <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td> | |
37 | <td align="center"> |
|
38 | <td align="center"> | |
38 | <% if entry.editable_by?(User.current) -%> |
|
39 | <% if entry.editable_by?(User.current) -%> | |
39 | <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry, :project_id => nil}, |
|
40 | <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry, :project_id => nil}, | |
40 | :title => l(:button_edit) %> |
|
41 | :title => l(:button_edit) %> | |
41 | <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry, :project_id => nil}, |
|
42 | <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry, :project_id => nil}, | |
42 | :confirm => l(:text_are_you_sure), |
|
43 | :confirm => l(:text_are_you_sure), | |
43 | :method => :delete, |
|
44 | :method => :delete, | |
44 | :title => l(:button_delete) %> |
|
45 | :title => l(:button_delete) %> | |
45 | <% end -%> |
|
46 | <% end -%> | |
46 | </td> |
|
47 | </td> | |
47 | </tr> |
|
48 | </tr> | |
48 | <% end -%> |
|
49 | <% end -%> | |
49 | </tbody> |
|
50 | </tbody> | |
50 | </table> |
|
51 | </table> | |
|
52 | </div> | |||
51 | <% end -%> |
|
53 | <% end -%> | |
52 |
|
54 | |||
53 | <%= context_menu time_entries_context_menu_path %> |
|
55 | <%= context_menu time_entries_context_menu_path %> |
General Comments 0
You need to be logged in to leave comments.
Login now