|
|
|
@ -5,31 +5,36 @@ |
|
|
|
|
<table class="list cost_entries"> |
|
|
|
|
<thead><tr> |
|
|
|
|
<th></th> |
|
|
|
|
<%= sort_header_tag("entry__spent_on", :caption => l(:caption_spent), :default_order => 'desc') %> |
|
|
|
|
<%= sort_header_tag("entry__user_id", :caption => l(:label_user), :default_order => 'asc') %> |
|
|
|
|
<%= sort_header_tag("entry__activity_id", :caption => l(:label_activity), :default_order => 'asc') %> |
|
|
|
|
<%= sort_header_tag("entry__issue_id", :caption => l(:caption_issue), :default_order => 'desc') %> |
|
|
|
|
<th><%= l(:field_comments) %></th> |
|
|
|
|
<th><%= l(:caption_cost_unit_plural) %></th> |
|
|
|
|
<%= sort_header_tag("entry__cost_type_id", :caption => l(:caption_cost_type), :default_order => 'asc') %> |
|
|
|
|
<%= sort_header_tag("entry__activity_id", :caption => l(:label_activity), :default_order => 'asc') %> |
|
|
|
|
<%= sort_header_tag("entry__spent_on", :caption => l(:caption_spent), :default_order => 'desc') %> |
|
|
|
|
<%= sort_header_tag("entry__user_id", :caption => l(:label_user), :default_order => 'asc') %> |
|
|
|
|
<%= sort_header_tag("entry__costs", :caption => l(:caption_costs), :default_order => 'asc', :class => "currency") %> |
|
|
|
|
<th></th> |
|
|
|
|
</tr></thead> |
|
|
|
|
<tbody> |
|
|
|
|
|
|
|
|
|
<% p @entries.inject({"costs" => [], "time" => []}){|result, e| result[e.is_a?(CostEntry) ? "costs" : "time"] << e.id; result} %> |
|
|
|
|
|
|
|
|
|
<% @entries.each do |entry| %> |
|
|
|
|
<% page_costs += entry.real_costs if entry.costs_visible_by?(User.current)%> |
|
|
|
|
<tr class="<%= cycle('odd', 'even') %>"> |
|
|
|
|
<td><span class="<%= entry.is_a?(CostEntry) ? "icon-pieces" : "icon-time" %> icon"> </span></td> |
|
|
|
|
<td class="subject"><%= entry.issue ? link_to_issue(entry.issue) : "<em>#{l(:caption_booked_on_project)}</em>" %></td> |
|
|
|
|
<td> |
|
|
|
|
<%= (link_to pluralize(entry.units, entry.cost_type.unit, entry.cost_type.unit_plural), |
|
|
|
|
{:controller => "costlog", :action => "details", |
|
|
|
|
:cost_type_id => entry.cost_type, :issue_id => entry.issue}) if entry.is_a?(CostEntry) %> |
|
|
|
|
<%= l_hours(entry.hours) if entry.is_a?(TimeEntry)%> |
|
|
|
|
</td> |
|
|
|
|
<td><%= entry.is_a?(CostEntry) ? entry.cost_type : l(:caption_labor_costs) %></td> |
|
|
|
|
<td><%= entry.activity if entry.is_a?(TimeEntry) %></td> |
|
|
|
|
<td><%= format_date entry.spent_on %></td> |
|
|
|
|
<td><%= link_to_user entry.user %></td> |
|
|
|
|
<td><%= entry.activity if entry.is_a?(TimeEntry) %></td> |
|
|
|
|
<td class="subject"><%= entry.issue ? link_to_issue(entry.issue) : "<em>#{l(:caption_booked_on_project)}</em>" %></td> |
|
|
|
|
<td class="comments"><%=h entry.comments %> |
|
|
|
|
<td> |
|
|
|
|
<%= (link_to pluralize(entry.units, entry.cost_type.unit, entry.cost_type.unit_plural), |
|
|
|
|
{:controller => "costlog", :action => "details", |
|
|
|
|
:cost_type_id => entry.cost_type, :issue_id => entry.issue}) if entry.is_a?(CostEntry) %> |
|
|
|
|
<%= l_hours(entry.hours) if entry.is_a?(TimeEntry)%> |
|
|
|
|
</td> |
|
|
|
|
<td><%= entry.is_a?(CostEntry) ? entry.cost_type : l(:caption_labor_costs) %></td> |
|
|
|
|
<td class="currency"><%= number_to_currency(entry.real_costs) if entry.display_costs %></td> |
|
|
|
|
<td style="width: 40px"> |
|
|
|
|
<% if entry.editable_by?(User.current) -%> |
|
|
|
|