parent
e69bc0c389
commit
547897b52c
@ -1,47 +0,0 @@ |
||||
<%#-- copyright |
||||
OpenProject Costs Plugin |
||||
|
||||
Copyright (C) 2009 - 2014 the OpenProject Foundation (OPF) |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
version 3. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program; if not, write to the Free Software |
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
|
||||
++#%> |
||||
|
||||
<% if @project && @project.module_enabled?(:costs_module) %> |
||||
<% |
||||
cost_objects_any = false |
||||
possible_cost_objects = issues.inject(issues.first.project.cost_objects) do |intersect, work_package| |
||||
cost_objects_any |= work_package.project.cost_objects.any? |
||||
work_package.project.cost_objects & intersect |
||||
end |
||||
%> |
||||
|
||||
<% unless possible_cost_objects.empty? -%> |
||||
<%= context_menu_entry title: l(:label_cost_object), |
||||
back_url: back, |
||||
updated_object_ids: issues.collect(&:id), |
||||
collection: possible_cost_objects, |
||||
attribute: 'cost_object', |
||||
selected: lambda { |cost_object| @work_package && cost_object == @work_package.cost_object }, |
||||
disabled: lambda { |cost_object| !can[:edit] } %> |
||||
|
||||
<% else -%> |
||||
<li class="folder"> |
||||
<a href="#" class="submenu"><%= l(:label_cost_object) %></a> |
||||
<ul> |
||||
<li><%= l(cost_objects_any ? :notice_cost_object_conflict : :notice_no_cost_objects_available)%></li> |
||||
</ul> |
||||
</li> |
||||
<% end -%> |
||||
<% end %> |
Loading…
Reference in new issue