summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-10 17:38:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-10 17:38:17 +0000
commit83bcc1f043511d85414ca3cafc1e10dc84b9da24 (patch)
treead4f5fb681005732796c43266467c2e59228db79 /app/helpers
parentb0013d9f68a0ce4347f568b7f8809ea8ef9f1d8b (diff)
downloadredmine-83bcc1f043511d85414ca3cafc1e10dc84b9da24.tar.gz
redmine-83bcc1f043511d85414ca3cafc1e10dc84b9da24.zip
Adds a setting to allow subtasks to belong to other projects (#5487).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10587 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/issues_helper.rb4
-rw-r--r--app/helpers/settings_helper.rb12
2 files changed, 14 insertions, 2 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 1ba4c4635..2cc387ff8 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -65,7 +65,7 @@ module IssuesHelper
s = ''
ancestors = issue.root? ? [] : issue.ancestors.visible.all
ancestors.each do |ancestor|
- s << '<div>' + content_tag('p', link_to_issue(ancestor))
+ s << '<div>' + content_tag('p', link_to_issue(ancestor, :project => (issue.project_id != ancestor.project_id)))
end
s << '<div>'
subject = h(issue.subject)
@@ -82,7 +82,7 @@ module IssuesHelper
issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
s << content_tag('tr',
content_tag('td', check_box_tag("ids[]", child.id, false, :id => nil), :class => 'checkbox') +
- content_tag('td', link_to_issue(child, :truncate => 60), :class => 'subject') +
+ content_tag('td', link_to_issue(child, :truncate => 60, :project => (issue.project_id != child.project_id)), :class => 'subject') +
content_tag('td', h(child.status)) +
content_tag('td', link_to_user(child.assigned_to)) +
content_tag('td', progress_bar(child.done_ratio, :width => '80px')),
diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb
index dd20f24c6..c1fa8ea64 100644
--- a/app/helpers/settings_helper.rb
+++ b/app/helpers/settings_helper.rb
@@ -91,4 +91,16 @@ module SettingsHelper
l_or_humanize(notifiable.name, :prefix => 'label_').html_safe,
:class => notifiable.parent.present? ? "parent" : '').html_safe
end
+
+ def cross_project_subtasks_options
+ options = [
+ [:label_disabled, ''],
+ [:label_cross_project_system, 'system'],
+ [:label_cross_project_tree, 'tree'],
+ [:label_cross_project_hierarchy, 'hierarchy'],
+ [:label_cross_project_descendants, 'descendants']
+ ]
+
+ options.map {|label, value| [l(label), value.to_s]}
+ end
end