This class is a specialized RichTextFunctionHandler that generates a link to another report. It's not available on all output formats.
# File lib/taskjuggler/RichText/RTFReportLink.rb, line 23 def initialize(project, sourceFileInfo = nil) @project = project super('reportlink', sourceFileInfo) @blockFunction = false @query = nil end
Return a HTML tree for the report.
# File lib/taskjuggler/RichText/RTFReportLink.rb, line 36 def to_html(args) if args.nil? || (id = args['id']).nil? error('rtp_report_id', "Argument 'id' missing to specify the report to be used.") return nil end unless (report = @project.report(id)) error('rtp_report_unknown_id', "Unknown report #{id}") return nil end # 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
Not supported for this function
# File lib/taskjuggler/RichText/RTFReportLink.rb, line 31 def to_s(args) '' end
Not supported for this function.
# File lib/taskjuggler/RichText/RTFReportLink.rb, line 68 def to_tagged(args) nil end