# File lib/taskjuggler/Task.rb, line 21 21: def initialize(project, id, name, parent) 22: super(project.tasks, id, name, parent) 23: project.addTask(self) 24: 25: @data = Array.new(@project.scenarioCount, nil) 26: @project.scenarioCount.times do |i| 27: @data[i] = TaskScenario.new(self, i, @scenarioAttributes[i]) 28: end 29: end
# File lib/taskjuggler/Task.rb, line 35 35: def query_journal(query) 36: journalText(query, true, false) 37: end
Create a blog-style list of all alert messages that match the Query.
# File lib/taskjuggler/Task.rb, line 46 46: def journalText(query, longVersion, recursive) 47: # The components of the message are either UTF-8 text or RichText. For 48: # the RichText components, we use the originally provided markup since 49: # we compose the result as RichText markup first. 50: rText = '' 51: if recursive 52: list = @project['journal'].entriesByTaskR(self, query.start, query.end, 53: query.hideJournalEntry) 54: else 55: list = @project['journal'].entriesByTask(self, query.start, query.end, 56: query.hideJournalEntry) 57: end 58: list.reverse.each do |entry| 59: tsRecord = entry.timeSheetRecord 60: 61: if entry.property.is_a?(Task) 62: levelRecord = @project['alertLevels'][entry.alertLevel] 63: if query.selfContained 64: alertName = "<nowiki>[#{levelRecord[1]}]</nowiki>" 65: else 66: alertName = "[[File:icons/flag-#{levelRecord[0]}.png|" + 67: "alt=[#{levelRecord[1]}]|text-bottom]]" 68: end 69: rText += "== #{alertName} <nowiki>#{entry.headline}</nowiki> ==\n" + 70: "''Reported on #{entry.date.to_s(query.timeFormat)}'' " 71: if entry.author 72: rText += "''by <nowiki>#{entry.author.name}</nowiki>''" 73: end 74: rText += "\n\n" 75: unless entry.flags.empty? 76: rText += "'''Flags:''' #{entry.flags.join(', ')}\n\n" 77: end 78: if tsRecord 79: rText += "'''Work:''' #{tsRecord.actualWorkPercent.to_i}% " 80: if tsRecord.remaining 81: rText += "'''Remaining:''' #{tsRecord.actualRemaining}d " 82: else 83: rText += "'''End:''' " + 84: "#{tsRecord.actualEnd.to_s(query.timeFormat)} " 85: end 86: rText += "\n\n" 87: end 88: end 89: unless entry.headline.empty? 90: rText += "'''<nowiki>#{entry.headline}</nowiki>'''\n\n" 91: end 92: if entry.summary 93: rText += entry.summary.richText.inputText + "\n\n" 94: end 95: if longVersion && entry.details 96: rText += entry.details.richText.inputText + "\n\n" 97: end 98: end 99: 100: # Don't generate a RichText object for an empty String. 101: return if rText.empty? 102: 103: # Now convert the RichText markup String into RichTextIntermediate 104: # format. 105: unless (rti = RichText.new(rText, RTFHandlers.create(@project), 106: @project.messageHandler). 107: generateIntermediateFormat) 108: @project.messageHandler.warning( 109: 'task_journal_text', 'Syntax error in journal text') 110: return nil 111: end 112: 113: # No section numbers, please! 114: rti.sectionNumbers = false 115: # We use a special class to allow CSS formating. 116: rti.cssClass = 'tj_journal' 117: query.rti = rti 118: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.