[#6441] Add a manual Deliverable#status

This commit is contained in:
Eric Davis
2011-08-08 12:08:46 -07:00
parent 9453b52c10
commit 5e2e309304
7 changed files with 36 additions and 4 deletions
+5 -1
View File
@@ -19,6 +19,7 @@ class Deliverable < ActiveRecord::Base
validates_presence_of :title
validates_presence_of :type
validates_presence_of :manager
validates_inclusion_of :status, :in => ["open","locked","closed"], :allow_blank => true, :allow_nil => true
# Accessors
include DollarizedAttribute
@@ -27,7 +28,10 @@ class Deliverable < ActiveRecord::Base
delegate :name, :to => :contract, :prefix => true, :allow_nil => true
# Callbacks
def after_initialize
self.status = "open" unless self.status.present?
end
# Register callbacks here, on new records the class isn't set so class-specific
# callbacks don't fire.
def after_save
+1 -1
View File
@@ -130,7 +130,7 @@
<td width="10%" class="arrow end-date"><span><%= h format_date(deliverable.end_date) %></span></td>
<td width="2%" class="type"><%= h deliverable.short_type %></td>
<td width="25%" class="title"><%= h deliverable.title %></td>
<td width="15%"><%= release(5, "Deliverable status") %></td>
<td width="15%" class="status"><%= h deliverable.status %></td>
<td width="15%" class="manager"><%= h deliverable.manager.try(:name) %></td>
<%= format_budget_for_deliverable(deliverable, deliverable.labor_budget_spent, deliverable.labor_budget_total, :class => 'labor') %>
<%= format_budget_for_deliverable(deliverable, deliverable.overhead_spent, deliverable.overhead_budget_total, :class => 'overhead') %>
+1
View File
@@ -19,6 +19,7 @@
</li>
<%= form.input :type, :as => :hidden, :class => 'type' %>
<% end %>
<%= form.input :status, :required => true, :collection => [["Open","open"],["Locked","locked"],["Closed","closed"]] %>
<%= form.input :manager, :required => true, :collection => @project.users.sort %>
<%= form.input :start_date, :as => :string, :input_html => {:size => 10, :class => 'start-date', :id => 'deliverable_start_date'}, :hint => calendar_for('deliverable_start_date') %>