Fixed magic link in the note added when closing an issue by a commit from a subproject (#10284).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8917 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-02-20 21:58:57 +00:00
parent 5b48e4ae58
commit 77287d1f0b
2 changed files with 46 additions and 4 deletions
+8 -4
View File
@@ -151,12 +151,16 @@ class Changeset < ActiveRecord::Base
@long_comments || split_comments.last
end
def text_tag
if scmid?
def text_tag(ref_project=nil)
tag = if scmid?
"commit:#{scmid}"
else
"r#{revision}"
end
if ref_project && project && ref_project != project
tag = "#{project.identifier}:#{tag}"
end
tag
end
# Returns the previous changeset
@@ -215,7 +219,7 @@ class Changeset < ActiveRecord::Base
# don't change the status is the issue is closed
return if issue.status && issue.status.is_closed?
journal = issue.init_journal(user || User.anonymous, ll(Setting.default_language, :text_status_changed_by_changeset, text_tag))
journal = issue.init_journal(user || User.anonymous, ll(Setting.default_language, :text_status_changed_by_changeset, text_tag(issue.project)))
issue.status = status
unless Setting.commit_fix_done_ratio.blank?
issue.done_ratio = Setting.commit_fix_done_ratio.to_i
@@ -234,7 +238,7 @@ class Changeset < ActiveRecord::Base
:hours => hours,
:issue => issue,
:spent_on => commit_date,
:comments => l(:text_time_logged_by_changeset, :value => text_tag,
:comments => l(:text_time_logged_by_changeset, :value => text_tag(issue.project),
:locale => Setting.default_language)
)
time_entry.activity = log_time_activity unless log_time_activity.nil?