* Allow display of cost log form if no cost type is defined yet.

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@116 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent caf493b3ff
commit 6f81ff70b8
  1. 2
      app/views/costlog/edit.rhtml

@ -13,7 +13,7 @@
<p><%= f.select :cost_type_id, cost_types_collection_for_select_options, :required => true %></p>
<p>
<%= f.text_field :units, :size => 6, :required => true %>
<span id="cost_entry_unit_name"><%= @cost_entry.units == 1 ? @cost_entry.cost_type.unit : @cost_entry.cost_type.unit_plural %></span>
<span id="cost_entry_unit_name"><%= (@cost_entry.units == 1 ? @cost_entry.cost_type.unit : @cost_entry.cost_type.unit_plural) if @cost_entry.cost_type %></span>
<%= observe_field( "cost_entry_cost_type_id", :url => {:controller => :deliverables, :action => :update_deliverable_cost, :project_id => @cost_entry.project}, :with => "'cost_type_id=' + encodeURIComponent(value) + '&units=' + encodeURIComponent(document.getElementById('cost_entry_units').value) + '&fixed_date=' + encodeURIComponent(document.getElementById('cost_entry_spent_on').value) + '&element_id=cost_entry'") %>
<%= observe_field( "cost_entry_units", :frequency => 1, :url => {:controller => :deliverables, :action => :update_deliverable_cost, :project_id => @cost_entry.project}, :with => "'cost_type_id=' + encodeURIComponent(document.getElementById('cost_entry_cost_type_id').value) + '&units=' + encodeURIComponent(value) + '&fixed_date=' + encodeURIComponent(document.getElementById('cost_entry_spent_on').value) + '&element_id=cost_entry'") %>
<%= observe_field( "cost_entry_spent_on", :frequency => 1, :url => {:controller => :deliverables, :action => :update_deliverable_cost, :project_id => @cost_entry.project}, :with => "'cost_type_id=' + encodeURIComponent(document.getElementById('cost_entry_cost_type_id').value) + '&units=' + encodeURIComponent(document.getElementById('cost_entry_units').value) + '&fixed_date=' + encodeURIComponent(value) + '&element_id=cost_entry'") %>

Loading…
Cancel
Save