[#6574] Add a TimeEntryActivity to OverheadBudgets

This commit is contained in:
Eric Davis
2011-09-15 10:38:16 -07:00
parent b3b7fa11b0
commit 33e07ee10b
8 changed files with 35 additions and 4 deletions
+2 -1
View File
@@ -31,7 +31,8 @@ class Deliverable < ActiveRecord::Base
delegate "open?", :to => :contract, :prefix => true, :allow_nil => true
delegate "closed?", :to => :contract, :prefix => true, :allow_nil => true
delegate "locked?", :to => :contract, :prefix => true, :allow_nil => true
delegate :project, :to => :contract, :allow_nil => true
# Callbacks
before_destroy :block_on_locked_contracts
before_destroy :block_on_closed_contracts
+2
View File
@@ -3,8 +3,10 @@ class OverheadBudget < ActiveRecord::Base
# Associations
belongs_to :deliverable
belongs_to :time_entry_activity
# Validations
validates_presence_of :time_entry_activity_id
# Accessors
include DollarizedAttribute
@@ -41,7 +41,8 @@
<%= overhead_budget.hidden_field(:month) %>
<tr>
<td>
<%= release(3, "Select field for the Time Entry Activity in a td") %>
<%= overhead_budget.label(:time_entry_activity_id, :class => "hidden") %>
<%= overhead_budget.select(:time_entry_activity_id, options_from_collection_for_select(@project.non_billable_activities, :id, :name, overhead_budget.object.time_entry_activity_id), {:include_blank => false}, {:class => 'financial'}) %>
</td>
<td>
<p class="inline-hints"><%= overhead_budget.label(:hours, l(:text_short_hours)) %></p>