Fixed some display quirks in cost object view

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@486 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent 90ad8ed805
commit 17120dcc14
  1. 2
      app/models/cost_object.rb
  2. 2
      app/views/cost_objects/_form.rhtml
  3. 2
      app/views/cost_objects/_labor_budget_item.rhtml
  4. 8
      app/views/cost_objects/_show_variable_cost_object.rhtml
  5. 5
      lib/costs_user_patch.rb

@ -144,7 +144,7 @@ class CostObject < ActiveRecord::Base
end end
def css_classes def css_classes
return "issue" return "issue cost_object"
end end
end end

@ -34,7 +34,6 @@
<th><%= l(:label_comment) %></th> <th><%= l(:label_comment) %></th>
<% if User.current.allowed_to?(:view_cost_rates, @project)%><th class="currency" id="material_budget_items_price"><%= l(:caption_budget) %></th><%end%> <% if User.current.allowed_to?(:view_cost_rates, @project)%><th class="currency" id="material_budget_items_price"><%= l(:caption_budget) %></th><%end%>
<th></th> <th></th>
<th></th>
</tr></thead> </tr></thead>
<tbody id="material_budget_items_body"> <tbody id="material_budget_items_body">
<%- @cost_object.material_budget_items.each_with_index do |material_budget_item, index| -%> <%- @cost_object.material_budget_items.each_with_index do |material_budget_item, index| -%>
@ -56,7 +55,6 @@
<th class="currency" id="labor_budget_items_price"><%= l(:caption_budget) %></th> <th class="currency" id="labor_budget_items_price"><%= l(:caption_budget) %></th>
<% end %> <% end %>
<th></th> <th></th>
<th></th>
</tr></thead> </tr></thead>
<tbody id="labor_budget_items_body"> <tbody id="labor_budget_items_body">
<%- @cost_object.labor_budget_items.each_with_index do |labor_budget_item, index| -%> <%- @cost_object.labor_budget_items.each_with_index do |labor_budget_item, index| -%>

@ -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}_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}'") %> <%= 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}'") %>
</td> </td>
<td class="delete" rowspan="2"> <td class="delete">
<%= link_to_function image_tag('delete.png'), "deleteLaborBudgetItem('#{id_prefix}')" %> <%= link_to_function image_tag('delete.png'), "deleteLaborBudgetItem('#{id_prefix}')" %>
</td> </td>
</tr> </tr>

@ -2,7 +2,7 @@
<div style="float: left; width: 100%"> <div style="float: left; width: 100%">
<div class="splitcontentleft"> <div class="splitcontentleft">
<h4><%= l(:caption_material_budget)%></h4> <h4><%= l(:caption_material_budget)%></h4>
<table class="material_budget_items"> <table class="material_budget_items list">
<thead><tr> <thead><tr>
<th><%= l(:caption_cost_unit_plural)%></th> <th><%= l(:caption_cost_unit_plural)%></th>
<th><%= l(:caption_cost_type) %></th> <th><%= l(:caption_cost_type) %></th>
@ -24,7 +24,7 @@
</div> </div>
<div class="splitcontentright"> <div class="splitcontentright">
<h4><%= l(:caption_material_costs) %></h4> <h4><%= l(:caption_material_costs) %></h4>
<table class="material_budget_items"> <table class="material_budget_items list">
<thead><tr> <thead><tr>
<th><%= l(:caption_issue)%></th> <th><%= l(:caption_issue)%></th>
<th><%= l(:caption_cost_unit_plural) %></th> <th><%= l(:caption_cost_unit_plural) %></th>
@ -65,7 +65,7 @@
<div class="splitcontentleft"> <div class="splitcontentleft">
<h4><%= l(:caption_labor_budget)%></h4> <h4><%= l(:caption_labor_budget)%></h4>
<table class="labor_budget_items"> <table class="labor_budget_items list">
<thead><tr> <thead><tr>
<th><%= l(:field_hours)%></th> <th><%= l(:field_hours)%></th>
<th><%= l(:label_user) %></th> <th><%= l(:label_user) %></th>
@ -90,7 +90,7 @@
<div class="splitcontentright"> <div class="splitcontentright">
<h4><%= l(:caption_labor_costs) %></h4> <h4><%= l(:caption_labor_costs) %></h4>
<table class="labor_budget_items"> <table class="labor_budget_items list">
<thead><tr> <thead><tr>
<th><%= l(:caption_issue)%></th> <th><%= l(:caption_issue)%></th>
<th><%= l(:field_hours)%></th> <th><%= l(:field_hours)%></th>

@ -76,6 +76,11 @@ module CostsUserPatch
self.allowed_for_role(action, project, role, users, options) self.allowed_for_role(action, project, role, users, options)
end 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) options[:for] = self unless options.has_key?(:for)
if project if project

Loading…
Cancel
Save