Index: lib/redmine/helpers/gantt.rb =================================================================== --- lib/redmine/helpers/gantt.rb (Revision 13036) +++ lib/redmine/helpers/gantt.rb (Arbeitskopie) @@ -15,13 +15,16 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +require 'context_menus_helper' + module Redmine module Helpers # Simple class to handle gantt chart data - class Gantt + class Gantt # FIXME: inherit < Redmine::Hook::ViewListener include ERB::Util include Redmine::I18n include Redmine::Utils::DateCalculation + include ContextMenusHelper # Relation types that are rendered DRAW_TYPES = { @@ -361,7 +364,7 @@ end output = case options[:format] when :html - css_classes = '' + css_classes = 'hascontextmenu' css_classes << ' issue-overdue' if issue.overdue? css_classes << ' issue-behind-schedule' if issue.behind_schedule? css_classes << ' icon icon-issue' unless Setting.gravatar_enabled? && issue.assigned_to @@ -381,6 +384,8 @@ :title => assigned_string).to_s.html_safe end s << view.link_to_issue(issue).html_safe +# FIXME: causes undefined method error in ContextMenuHelper -> due to Gantt class not inherited from Redmine::Hook::ViewListener ??? +# s << context_menu_link("##{issue.id}", {:controller => "issues", :action => "show", :id => issue}, :class => issue.css_classes, :title => "").html_safe subject = view.content_tag(:span, s, :class => css_classes).html_safe html_subject(options, subject, :css => "issue-subject", :title => issue.subject, :id => "issue-#{issue.id}") + "\n" Index: app/views/gantts/show.html.erb =================================================================== --- app/views/gantts/show.html.erb (Revision 13036) +++ app/views/gantts/show.html.erb (Arbeitskopie) @@ -261,8 +261,12 @@ <% end %> <% end %> +<%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %> + <%= @gantt.lines.html_safe %> +<%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %> + <% ###### Today red line (excluded from cache) ###### %> <% if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> <% @@ -330,3 +334,6 @@ $("#draw_progress_line").change(drawGanttHandler); }); <% end %> + +<%= context_menu issues_context_menu_path %> +