gantt_context_menu.diff

Christian Dähn, 2014-04-04 16:43

Download (2.58 KB)

View differences:

lib/redmine/helpers/gantt.rb (Arbeitskopie)
15 15
# along with this program; if not, write to the Free Software
16 16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 17

  
18
require 'context_menus_helper'
19

  
18 20
module Redmine
19 21
  module Helpers
20 22
    # Simple class to handle gantt chart data
21
    class Gantt
23
    class Gantt # FIXME: inherit  < Redmine::Hook::ViewListener
22 24
      include ERB::Util
23 25
      include Redmine::I18n
24 26
      include Redmine::Utils::DateCalculation
27
      include ContextMenusHelper
25 28

  
26 29
      # Relation types that are rendered
27 30
      DRAW_TYPES = {
......
361 364
        end
362 365
        output = case options[:format]
363 366
        when :html
364
          css_classes = ''
367
          css_classes = 'hascontextmenu'
365 368
          css_classes << ' issue-overdue' if issue.overdue?
366 369
          css_classes << ' issue-behind-schedule' if issue.behind_schedule?
367 370
          css_classes << ' icon icon-issue' unless Setting.gravatar_enabled? && issue.assigned_to
......
381 384
                             :title => assigned_string).to_s.html_safe
382 385
          end
383 386
          s << view.link_to_issue(issue).html_safe
387
# FIXME: causes undefined method error in ContextMenuHelper -> due to Gantt class not inherited from Redmine::Hook::ViewListener ???
388
#          s << context_menu_link("##{issue.id}", {:controller => "issues", :action => "show", :id => issue}, :class => issue.css_classes, :title => "").html_safe
384 389
          subject = view.content_tag(:span, s, :class => css_classes).html_safe
385 390
          html_subject(options, subject, :css => "issue-subject",
386 391
                       :title => issue.subject, :id => "issue-#{issue.id}") + "\n"
app/views/gantts/show.html.erb (Arbeitskopie)
261 261
  <% end %>
262 262
<% end %>
263 263

  
264
<%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %>
265

  
264 266
<%= @gantt.lines.html_safe %>
265 267

  
268
<%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
269

  
266 270
<% ###### Today red line (excluded from cache) ###### %>
267 271
<% if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
268 272
  <%
......
330 334
    $("#draw_progress_line").change(drawGanttHandler);
331 335
  });
332 336
<% end %>
337

  
338
<%= context_menu issues_context_menu_path %>
339