Adapted to renaming of core method

pull/6827/head
Sebastian Schuster 11 years ago
parent bd22ecf3a0
commit e395a01c4c
  1. 2
      app/helpers/costlog_helper.rb
  2. 4
      app/models/variable_cost_object.rb
  3. 2
      app/views/cost_objects/_labor_budget_item.html.erb

@ -42,7 +42,7 @@ module CostlogHelper
end
def user_collection_for_select_options(options = {})
users = @project.assignable_users
users = @project.possible_assignees
collection = []
users.each { |u| collection << [u.name, u.id] }
collection

@ -125,7 +125,7 @@ class VariableCostObject < CostObject
labor_budget_item_attributes.each do |index, attributes|
if attributes[:hours].to_i > 0 &&
attributes[:user_id].to_i > 0 &&
project.assignable_users.map(&:id).include?(attributes[:user_id].to_i)
project.possible_assignees.map(&:id).include?(attributes[:user_id].to_i)
item = labor_budget_items.build(attributes)
item.cost_object = self # to please the labor_budget_item validation
@ -137,7 +137,7 @@ class VariableCostObject < CostObject
labor_budget_items.reject(&:new_record?).each do |labor_budget_item|
attributes = labor_budget_item_attributes[labor_budget_item.id.to_s]
if User.current.allowed_to? :edit_cost_objects, labor_budget_item.cost_object.project
if attributes && attributes[:hours].to_i > 0 && attributes[:user_id].to_i > 0 && project.assignable_users.map(&:id).include?(attributes[:user_id].to_i)
if attributes && attributes[:hours].to_i > 0 && attributes[:user_id].to_i > 0 && project.possible_assignees.map(&:id).include?(attributes[:user_id].to_i)
attributes[:budget] = Rate.clean_currency(attributes[:budget])
labor_budget_item.attributes = attributes
else

@ -40,7 +40,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</td>
<td class="user">
<label class="hidden-for-sighted" for="<%= id_prefix %>_user_id"><%= l(:label_user) %></label>
<%= cost_form.select :user_id, @project.assignable_users.sort.collect{|u| [u.name, u.id]}, {:prompt => true}, {:index => id_or_index} %>
<%= cost_form.select :user_id, @project.possible_assignees.sort.collect{|u| [u.name, u.id]}, {:prompt => true}, {:index => id_or_index} %>
</td>
<td class="comment">
<label class="hidden-for-sighted" for="<%= id_prefix %>_comments"><%= LaborBudgetItem.human_attribute_name(:comments) %></label>

Loading…
Cancel
Save