[#4390] Add the Contract name as an issue column.

This commit is contained in:
Eric Davis
2010-08-12 10:38:48 -07:00
parent b83696f49a
commit 6924b32048
4 changed files with 8 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ class Deliverable < ActiveRecord::Base
# Accessors
delegate :name, :to => :contract, :prefix => true, :allow_nil => true
def short_type
''
end

View File

@@ -58,3 +58,4 @@ en:
text_save_contract: "Save Contract"
enumeration_payment_term: "Payment Terms"
field_deliverable_title: "Deliverable"
field_contract_name: "Contract"

View File

@@ -69,6 +69,10 @@ Dispatcher.to_prepare :redmine_contracts do
unless Query.available_columns.collect(&:name).include?(:deliverable_title)
Query.add_available_column(QueryColumn.new(:deliverable_title, :sortable => "#{Deliverable.table_name}.title"))
end
unless Query.available_columns.collect(&:name).include?(:contract_name)
Query.add_available_column(QueryColumn.new(:contract_name, :sortable => "#{Contract.table_name}.name"))
end
end
require 'redmine_contracts/hooks/view_layouts_base_html_head_hook'

View File

@@ -10,6 +10,7 @@ module RedmineContracts
belongs_to :deliverable
delegate :title, :to => :deliverable, :prefix => true, :allow_nil => true
delegate :contract_name, :to => :deliverable, :allow_nil => true
end
end