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/hooks/_view_issues_context_menu_e...

24 lines
958 B

<% if not project.nil? and project.module_enabled? :costs_module %>
<%
cost_objects_any = false
possible_cost_objects = issues.inject(issues.first.project.cost_objects) do |intersect, issue|
cost_objects_any |= issue.project.cost_objects.any?
issue.project.cost_objects & intersect
end
%>
<li class="folder">
<a href="#" class="submenu"><%= l(:label_cost_object) %></a>
<ul>
<% unless possible_cost_objects.empty? -%>
<% possible_cost_objects.each do |co| -%>
<li>
<%= context_menu_link co.subject, {:controller => '/issues', :action => 'bulk_edit', :ids => issues.collect(&:id), 'cost_object_id' => co, :back_url => back}, :method => :post,
:selected => (@issue && co == @issue.cost_object), :disabled => !can[:edit] %>
</li>
<% end -%>
<% else -%>
<li><%= l(cost_objects_any ? :notice_cost_object_conflict : :notice_no_cost_objects_available)%></li>
<% end -%>
</ul>
</li>
<% end %>