class TaskJuggler::RTFReportLink

This class is a specialized RichTextFunctionHandler that generates a link to another report. It's not available on all output formats.

Public Class Methods

new(project, sourceFileInfo = nil) click to toggle source
Calls superclass method
# File lib/taskjuggler/RichText/RTFReportLink.rb, line 24
def initialize(project, sourceFileInfo = nil)
  @project = project
  super('reportlink', sourceFileInfo)
  @blockFunction = false
  @query = nil
end

Public Instance Methods

to_html(args) click to toggle source

Return a HTML tree for the report.

# File lib/taskjuggler/RichText/RTFReportLink.rb, line 39
def to_html(args)
  report = checkArgs(args)

  # The URL for interactive reports is different than for static reports.
  if report.interactive?
    # The project and report ID must be provided as query.
    url = "taskjuggler?project=#{@project['projectid']};" +
          "report=#{report.fullId}"

    if args['attributes']
      qEx = SimpleQueryExpander.new(args['attributes'], @query,
                                    @sourceFileInfo)
      url += ";attributes=" + URLParameter.encode(qEx.expand)
    end
  else
    # The report name just gets a '.html' extension.
    url = report.name + ".html"
  end
  a = XMLElement.new('a', 'href'=> url)
  a << XMLText.new(report.name)
  a
end
to_s(args) click to toggle source

Not supported for this function

# File lib/taskjuggler/RichText/RTFReportLink.rb, line 32
def to_s(args)
  report = checkArgs(args)

  report.name
end
to_tagged(args) click to toggle source

Not supported for this function.

# File lib/taskjuggler/RichText/RTFReportLink.rb, line 63
def to_tagged(args)
  nil
end