mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-15 15:46:08 +10:00
fixed redmine<->gitlab integration
- when a proect configures "Lightweight issue tracking system for this project" to be "Issues tracker" = "Redmine", Wiki-Markdown text like "lorem ipsum #123" should be rendered to a hyperlink to Redmine - without this patch/enhancment this did not work - internal bugtracker id = redmine 16693
This commit is contained in:
@@ -338,6 +338,10 @@ class Project < ActiveRecord::Base
|
||||
self.issues_tracker == "jira"
|
||||
end
|
||||
|
||||
def redmine_tracker?
|
||||
self.issues_tracker == "redmine"
|
||||
end
|
||||
|
||||
# For compatibility with old code
|
||||
def code
|
||||
path
|
||||
|
||||
+15
-2
@@ -192,8 +192,10 @@ module Gitlab
|
||||
|
||||
link_to("##{identifier}", url, options)
|
||||
end
|
||||
else
|
||||
reference_jira_issue(identifier, project) if project.jira_tracker?
|
||||
elsif project.redmine_tracker?
|
||||
reference_redmine_issue(identifier, project)
|
||||
elsif project.jira_tracker?
|
||||
reference_jira_issue(identifier, project)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -239,5 +241,16 @@ module Gitlab
|
||||
)
|
||||
link_to("#{identifier}", url, options)
|
||||
end
|
||||
|
||||
def reference_redmine_issue(identifier, project = @project)
|
||||
url = url_for_issue(identifier)
|
||||
title = Gitlab.config.issues_tracker[project.issues_tracker]["title"]
|
||||
|
||||
options = html_options.merge(
|
||||
title: "Issue in #{title}",
|
||||
class: "gfm gfm-issue #{html_options[:class]}"
|
||||
)
|
||||
link_to("rm##{identifier}", url, options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user