From 17120dcc14666a7541776b4f80d32123131efe1f Mon Sep 17 00:00:00 2001 From: hjust Date: Thu, 28 Jan 2010 18:19:33 +0000 Subject: [PATCH] Fixed some display quirks in cost object view git-svn-id: https://dev.finn.de/svn/cockpit/trunk@486 7926756e-e54e-46e6-9721-ed318f58905e --- app/models/cost_object.rb | 2 +- app/views/cost_objects/_form.rhtml | 2 -- app/views/cost_objects/_labor_budget_item.rhtml | 2 +- app/views/cost_objects/_show_variable_cost_object.rhtml | 8 ++++---- lib/costs_user_patch.rb | 5 +++++ 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/models/cost_object.rb b/app/models/cost_object.rb index 4e0356b797..7f4543812f 100644 --- a/app/models/cost_object.rb +++ b/app/models/cost_object.rb @@ -144,7 +144,7 @@ class CostObject < ActiveRecord::Base end def css_classes - return "issue" + return "issue cost_object" end end \ No newline at end of file diff --git a/app/views/cost_objects/_form.rhtml b/app/views/cost_objects/_form.rhtml index 46397bba60..c9e06228d5 100644 --- a/app/views/cost_objects/_form.rhtml +++ b/app/views/cost_objects/_form.rhtml @@ -34,7 +34,6 @@ <%= l(:label_comment) %> <% if User.current.allowed_to?(:view_cost_rates, @project)%><%= l(:caption_budget) %><%end%> - <%- @cost_object.material_budget_items.each_with_index do |material_budget_item, index| -%> @@ -56,7 +55,6 @@ <%= l(:caption_budget) %> <% end %> - <%- @cost_object.labor_budget_items.each_with_index do |labor_budget_item, index| -%> diff --git a/app/views/cost_objects/_labor_budget_item.rhtml b/app/views/cost_objects/_labor_budget_item.rhtml index 0ff0dde8a7..d79e271e43 100644 --- a/app/views/cost_objects/_labor_budget_item.rhtml +++ b/app/views/cost_objects/_labor_budget_item.rhtml @@ -34,7 +34,7 @@ <%= observe_field( "#{id_prefix}_user_id", :url => {:action => :update_labor_budget_item}, :with => "'user_id=' + encodeURIComponent(value) + '&hours=' + encodeURIComponent(document.getElementById('#{id_prefix}_hours').value) + '&fixed_date=' + encodeURIComponent(document.getElementById('cost_object_fixed_date').value) + '&element_id=#{id_prefix}'") %> <%= observe_field( "#{id_prefix}_hours", :frequency => 1, :url => {:action => :update_labor_budget_item}, :with => "'user_id=' + encodeURIComponent(document.getElementById('#{id_prefix}_user_id').value) + '&hours=' + encodeURIComponent(value) + '&fixed_date=' + encodeURIComponent(document.getElementById('cost_object_fixed_date').value) + '&element_id=#{id_prefix}'") %> - + <%= link_to_function image_tag('delete.png'), "deleteLaborBudgetItem('#{id_prefix}')" %> diff --git a/app/views/cost_objects/_show_variable_cost_object.rhtml b/app/views/cost_objects/_show_variable_cost_object.rhtml index 4f5309d2b5..d4e2d732f7 100644 --- a/app/views/cost_objects/_show_variable_cost_object.rhtml +++ b/app/views/cost_objects/_show_variable_cost_object.rhtml @@ -2,7 +2,7 @@

<%= l(:caption_material_budget)%>

- +
@@ -24,7 +24,7 @@

<%= l(:caption_material_costs) %>

-
<%= l(:caption_cost_unit_plural)%> <%= l(:caption_cost_type) %>
+
@@ -65,7 +65,7 @@

<%= l(:caption_labor_budget)%>

-
<%= l(:caption_issue)%> <%= l(:caption_cost_unit_plural) %>
+
@@ -90,7 +90,7 @@

<%= l(:caption_labor_costs) %>

-
<%= l(:field_hours)%> <%= l(:label_user) %>
+
diff --git a/lib/costs_user_patch.rb b/lib/costs_user_patch.rb index 3daec0ad1e..880c2e15f9 100644 --- a/lib/costs_user_patch.rb +++ b/lib/costs_user_patch.rb @@ -76,6 +76,11 @@ module CostsUserPatch self.allowed_for_role(action, project, role, users, options) end + require 'ruby-debug' + if action == :view_issues && self.id == 9 && !Role.non_member.permissions.include?(:view_issues) + debugger + end + options[:for] = self unless options.has_key?(:for) if project
<%= l(:caption_issue)%> <%= l(:field_hours)%>