From e691f4c2f0a34c42a42b5a8ddb4b23b1604fa2c7 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 4 Jun 2008 18:20:41 -0700 Subject: [PATCH] Fixing the Journal display on the issue list. #1276 --- init.rb | 2 ++ lib/budget_issue_hook.rb | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/init.rb b/init.rb index bb24f7c..184dd73 100644 --- a/init.rb +++ b/init.rb @@ -36,4 +36,6 @@ Redmine::Plugin.register :budget_plugin do add_hook(:project_member_list_header, Proc.new { |context| BudgetProjectHook.member_list_header(context) }) add_hook(:project_member_list_column_three, Proc.new { |context| BudgetProjectHook.member_list_column_three(context) }) + + add_hook(:issues_helper_show_details, Proc.new { |context| BudgetIssueHook.issue_helper_show_details(context) }) end diff --git a/lib/budget_issue_hook.rb b/lib/budget_issue_hook.rb index c4aa519..1caed72 100644 --- a/lib/budget_issue_hook.rb +++ b/lib/budget_issue_hook.rb @@ -37,4 +37,16 @@ class BudgetIssueHook context[:issue].deliverable = Deliverable.find(context[:params][:deliverable_id]) unless context[:params][:deliverable_id].blank? return '' end + + # TODO Later: Overwritting the caller is bad juju + def self.issue_helper_show_details(context = { }) + if context[:detail].prop_key == 'deliverable_id' + d = Deliverable.find_by_id(context[:detail].value) + context[:detail].value = d.subject unless d.nil? || d.subject.nil? + + d = Deliverable.find_by_id(context[:detail].old_value) + context[:detail].old_value = d.subject unless d.nil? || d.subject.nil? + end + '' + end end