redmine-graphs-plugin/lib/issues_sidebar_graph_hook.rb
Magnus Bergmark 603ca8d986 Fixed problem with URL linking outside Request-cycle
This seems to happen on some versions of Rails and/or some configuration
combinations on the server. It is a simple fix to make all links relative
instead of absolute in all cases.
2009-05-08 11:50:01 +02:00

14 lines
967 B
Ruby

# Provides a link to the issue age graph on the issue index page
class IssuesSidebarGraphHook < Redmine::Hook::ViewListener
def view_issues_sidebar_issues_bottom(context = { })
output = "<h3>#{l(:label_graphs)}</h3>"
output << link_to(l(:label_graphs_old_issues), {:controller => 'graphs', :action => 'old_issues', :only_path => true}) if context[:project].nil?
output << link_to(l(:label_graphs_old_issues), {:controller => 'graphs', :action => 'old_issues', :project_id => context[:project], :only_path => true}) unless context[:project].nil?
output << "<br/>"
output << link_to(l(:label_graphs_issue_growth), {:controller => 'graphs', :action => 'issue_growth', :only_path => true}) if context[:project].nil?
output << link_to(l(:label_graphs_issue_growth), {:controller => 'graphs', :action => 'issue_growth', :project_id => context[:project], :only_path => true}) unless context[:project].nil?
output << "<br/>"
return output
end
end