[#4390] Add the Contract name as an issue column.
This commit is contained in:
@@ -20,6 +20,8 @@ class Deliverable < ActiveRecord::Base
|
||||
|
||||
# Accessors
|
||||
|
||||
delegate :name, :to => :contract, :prefix => true, :allow_nil => true
|
||||
|
||||
def short_type
|
||||
''
|
||||
end
|
||||
|
||||
@@ -58,3 +58,4 @@ en:
|
||||
text_save_contract: "Save Contract"
|
||||
enumeration_payment_term: "Payment Terms"
|
||||
field_deliverable_title: "Deliverable"
|
||||
field_contract_name: "Contract"
|
||||
|
||||
4
init.rb
4
init.rb
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user