OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/views/cost_reports/_cost_entry_table.rhtml

42 lines
1.8 KiB

<% list = [:project_id, :issue_id, :spent_on, :user_id, :activity_id] %>
<table class="list report">
<thead>
<% list.each do |field| %><th class="right"><%= label_for(field) %></th class="right"><% end %>
<th class="right"><%= @cost_type.try(:unit_plural) || l(:units) %></th>
<th class="right"><%= l(:field_costs) %></th>
<th></th>
</thead>
<tfoot>
<% if show_result(@query, 0) != show_result(@query) %>
<th class="inner right" colspan='<%= list.size + 1 %>'><%= show_result @query %></th>
<th class="result right"><%= show_result @query, 0 %></th>
<% else %>
<th class="result right" colspan='<%= list.size + 2 %>'><%= show_result @query %></th>
<% end %>
<th></th>
</tfoot>
<tbody>
<% @query.each_direct_result do |result| %>
<tr class='<%= cycle("odd", "even") %>'>
<% list.each do |field| %><td><%= show_field field, result.fields[field.to_s] %></td><% end %>
<td class="units"><%= show_result(result, result.fields['cost_type_id'].to_i) %></td>
<td class="currency"><%= show_result(result, 0) %></td>
<td style="width: 40px">
<%= link_to_if_authorized image_tag('edit.png'),
action_for(result, :action => 'edit'), :title => l(:button_edit) %>
<%= link_to_if_authorized image_tag('delete.png'), action_for(result, :action => 'destroy'),
:title => l(:button_edit), :confirm => l(:text_are_you_sure),
:method => :post, :title => l(:button_delete) %>
</td>
</tr>
<% if params[:debug] %>
<tr>
<td colspan='<%= list.size + 3 %>'>
<%= result.fields.reject {|k,v| list.include? k.to_sym }.inspect %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>