# File lib/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/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/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: else 54: list = @project['journal'].entriesByTask(self, query.start, query.end) 55: end 56: list.reverse.each do |entry| 57: tsRecord = entry.timeSheetRecord 58: 59: if entry.property.is_a?(Task) 60: levelRecord = @project['alertLevels'][entry.alertLevel] 61: if query.selfContained 62: alertName = "<nowiki>[#{levelRecord[1]}]</nowiki>" 63: else 64: alertName = "[[File:icons/flag-#{levelRecord[0]}.png|" + 65: "alt=[#{levelRecord[1]}]|text-bottom]]" 66: end 67: rText += "== #{alertName} <nowiki>#{entry.headline}</nowiki> ==\n" + 68: "''Reported on #{entry.date.to_s(query.timeFormat)}'' " 69: if entry.author 70: rText += "''by <nowiki>#{entry.author.name}</nowiki>''" 71: end 72: rText += "\n\n" 73: if tsRecord 74: rText += "'''Work:''' #{tsRecord.actualWorkPercent.to_i}% " 75: if tsRecord.remaining 76: rText += "'''Remaining:''' #{tsRecord.actualRemaining}d " 77: else 78: rText += "'''End:''' " + 79: "#{tsRecord.actualEnd.to_s(query.timeFormat)} " 80: end 81: rText += "\n\n" 82: end 83: end 84: unless entry.headline.empty? 85: rText += "'''<nowiki>#{entry.headline}</nowiki>'''\n\n" 86: end 87: if entry.summary 88: rText += entry.summary.richText.inputText + "\n\n" 89: end 90: if longVersion && entry.details 91: rText += entry.details.richText.inputText + "\n\n" 92: end 93: end 94: 95: # Don't generate a RichText object for an empty String. 96: return if rText.empty? 97: 98: # Now convert the RichText markup String into RichTextIntermediate 99: # format. 100: unless (rti = RichText.new(rText, RTFHandlers.create(@project), 101: @project.messageHandler). 102: generateIntermediateFormat) 103: @project.messageHandler.warning( 104: 'task_journal_text', 'Syntax error in journal text') 105: return nil 106: end 107: 108: # No section numbers, please! 109: rti.sectionNumbers = false 110: # We use a special class to allow CSS formating. 111: rti.cssClass = 'tj_journal' 112: query.rti = rti 113: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.