[#6441] Add a manual Deliverable#status
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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') %>
|
||||
|
||||
@@ -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') %>
|
||||
|
||||
Reference in New Issue
Block a user