Removed unsed templates and context menu stuff and fixed cukes.

pull/6827/head
Richard 11 years ago
parent e69bc0c389
commit 547897b52c
  1. 1
      app/assets/javascripts/costs/costs.js
  2. 47
      app/views/hooks/costs/_view_work_packages_context_menu_end.html.erb
  3. 3
      features/view_own_rates.feature
  4. 3
      lib/open_project/costs/hooks/work_package_hook.rb

@ -22,4 +22,3 @@
//= require costs/subform
//= require costs/rates
//= require costs/editinplace
//= require context_menu

@ -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 %>

@ -67,7 +67,8 @@ Feature: Permission View Own hourly and cost rates
And I should not see "43.00 EUR" # labour costs of me and Manager
And I should not see "49.00 EUR" # material costs of me and Manager
And I am on the work_packages page for the project called "Standard Project"
And I toggle the Options fieldset
And I click the toolbar button named "Filter"
And I click "Options"
And I select to see column "Overall costs"
And I select to see column "Labor costs"
And I select to see column "Unit costs"

@ -30,9 +30,6 @@ class OpenProject::Costs::Hooks::WorkPackageHook < Redmine::Hook::ViewListener
render_on :view_work_packages_move_bottom, :partial => 'hooks/costs/view_work_packages_move_bottom'
render_on :view_work_packages_context_menu_end, :partial => 'hooks/costs/view_work_packages_context_menu_end'
# Updates the cost object after a move
#
# Context:

Loading…
Cancel
Save