### Home Classes Methods

### In Files

- lib/taskjuggler/Journal.rb

### Parent

Object

### Methods

- ::new
- #addEntry
- #alertEntries
- #alertLevel
- #currentEntries
- #currentEntriesR
- #delete_if
- #entries
- #entriesByResource
- #entriesByTask
- #entriesByTaskR
- #getEntries
- #to_rti

### Included Modules

- TaskJuggler::MessageHandler

### Files

- CHANGELOG
- COPYING
- README.rdoc

### Class/Module Index

Quicksearch

- TaskJuggler
- TaskJuggler::Account
- TaskJuggler::AccountAttribute
- TaskJuggler::AccountCredit
- TaskJuggler::AccountCreditListAttribute
- TaskJuggler::AccountListRE
- TaskJuggler::AccountScenario
- TaskJuggler::AlertLevelDefinition
- TaskJuggler::AlertLevelDefinitions
- TaskJuggler::Allocation
- TaskJuggler::AllocationAttribute
- TaskJuggler::AttributeBase
- TaskJuggler::AttributeDefinition
- TaskJuggler::AttributeOverwrite
- TaskJuggler::BatchProcessor
- TaskJuggler::Booking
- TaskJuggler::BookingListAttribute
- TaskJuggler::BooleanAttribute
- TaskJuggler::CSVFile
- TaskJuggler::CellSettingPattern
- TaskJuggler::CellSettingPatternList
- TaskJuggler::Charge
- TaskJuggler::ChargeListAttribute
- TaskJuggler::ChargeSet
- TaskJuggler::ChargeSetListAttribute
- TaskJuggler::ChartPlotter
- TaskJuggler::ChartPlotterError
- TaskJuggler::CollisionDetector
- TaskJuggler::ColumnListAttribute
- TaskJuggler::ColumnTable
- TaskJuggler::Daemon
- TaskJuggler::DaemonConnector
- TaskJuggler::DaemonConnectorMixin
- TaskJuggler::DataCache
- TaskJuggler::DataCacheEntry
- TaskJuggler::DateAttribute
- TaskJuggler::DefinitionListAttribute
- TaskJuggler::DependencyListAttribute
- TaskJuggler::DurationAttribute
- TaskJuggler::ExportRE
- TaskJuggler::FileList
- TaskJuggler::FileRecord
- TaskJuggler::FixnumAttribute
- TaskJuggler::FlagListAttribute
- TaskJuggler::FloatAttribute
- TaskJuggler::FormatListAttribute
- TaskJuggler::GanttChart
- TaskJuggler::GanttContainer
- TaskJuggler::GanttHeader
- TaskJuggler::GanttHeaderScaleItem
- TaskJuggler::GanttLine
- TaskJuggler::GanttLoadStack
- TaskJuggler::GanttMilestone
- TaskJuggler::GanttRouter
- TaskJuggler::GanttTaskBar
- TaskJuggler::HTMLDocument
- TaskJuggler::HTMLElements
- TaskJuggler::HTMLGraphics
- TaskJuggler::ICalReport
- TaskJuggler::ICalendar
- TaskJuggler::ICalendar::Component
- TaskJuggler::ICalendar::Event
- TaskJuggler::ICalendar::Journal
- TaskJuggler::ICalendar::Person
- TaskJuggler::ICalendar::Todo
- TaskJuggler::Interval
- TaskJuggler::IntervalList
- TaskJuggler::JobInfo
- TaskJuggler::Journal
- TaskJuggler::JournalEntry
- TaskJuggler::JournalEntryList
- TaskJuggler::JournalSortListAttribute
- TaskJuggler::KateSyntax
- TaskJuggler::KeywordArray
- TaskJuggler::KeywordDocumentation
- TaskJuggler::Leave
- TaskJuggler::LeaveAllowance
- TaskJuggler::LeaveAllowanceList
- TaskJuggler::LeaveAllowanceListAttribute
- TaskJuggler::LeaveList
- TaskJuggler::LeaveListAttribute
- TaskJuggler::Limits
- TaskJuggler::Limits::Limit
- TaskJuggler::LimitsAttribute
- TaskJuggler::ListAttributeBase
- TaskJuggler::Log
- TaskJuggler::LogicalAttribute
- TaskJuggler::LogicalExpression
- TaskJuggler::LogicalExpressionAttribute
- TaskJuggler::LogicalExpressionListAttribute
- TaskJuggler::LogicalFlag
- TaskJuggler::LogicalFunction
- TaskJuggler::LogicalOperation
- TaskJuggler::ManagerResponsibilities
- TaskJuggler::ManagerStatusRecord
- TaskJuggler::Message
- TaskJuggler::MessageHandler
- TaskJuggler::MessageHandlerInstance
- TaskJuggler::MspXmlRE
- TaskJuggler::Navigator
- TaskJuggler::NavigatorElement
- TaskJuggler::NikuProject
- TaskJuggler::NikuReport
- TaskJuggler::NikuResource
- TaskJuggler::NodeListAttribute
- TaskJuggler::PTNProxy
- TaskJuggler::Painter
- TaskJuggler::Painter::Circle
- TaskJuggler::Painter::Color
- TaskJuggler::Painter::Element
- TaskJuggler::Painter::Ellipse
- TaskJuggler::Painter::FontMetrics
- TaskJuggler::Painter::FontMetricsData
- TaskJuggler::Painter::Group
- TaskJuggler::Painter::Line
- TaskJuggler::Painter::Points
- TaskJuggler::Painter::PolyLine
- TaskJuggler::Painter::Primitives
- TaskJuggler::Painter::Rect
- TaskJuggler::Painter::SVGSupport
- TaskJuggler::Painter::Text
- TaskJuggler::PlaceHolderCell
- TaskJuggler::ProcessIntercom
- TaskJuggler::ProcessIntercomIface
- TaskJuggler::Project
- TaskJuggler::ProjectBroker
- TaskJuggler::ProjectBrokerIface
- TaskJuggler::ProjectFileParser
- TaskJuggler::ProjectFileScanner
- TaskJuggler::ProjectRecord
- TaskJuggler::ProjectServer
- TaskJuggler::ProjectServerIface
- TaskJuggler::PropertyAttribute
- TaskJuggler::PropertyList
- TaskJuggler::PropertySet
- TaskJuggler::PropertyTreeNode
- TaskJuggler::Query
- TaskJuggler::RTFHandlers
- TaskJuggler::RTFNavigator
- TaskJuggler::RTFQuery
- TaskJuggler::RTFReport
- TaskJuggler::RTFReportLink
- TaskJuggler::RTFWithQuerySupport
- TaskJuggler::RealFormat
- TaskJuggler::RealFormatAttribute
- TaskJuggler::ReferenceAttribute
- TaskJuggler::Report
- TaskJuggler::ReportBase
- TaskJuggler::ReportContext
- TaskJuggler::ReportScenario
- TaskJuggler::ReportServer
- TaskJuggler::ReportServerIface
- TaskJuggler::ReportServerRecord
- TaskJuggler::ReportServlet
- TaskJuggler::ReportTable
- TaskJuggler::ReportTableCell
- TaskJuggler::ReportTableColumn
- TaskJuggler::ReportTableLegend
- TaskJuggler::ReportTableLine
- TaskJuggler::Resource
- TaskJuggler::ResourceListAttribute
- TaskJuggler::ResourceListRE
- TaskJuggler::ResourceScenario
- TaskJuggler::RichText
- TaskJuggler::RichTextAttribute
- TaskJuggler::RichTextDocument
- TaskJuggler::RichTextElement
- TaskJuggler::RichTextFunctionExample
- TaskJuggler::RichTextFunctionHandler
- TaskJuggler::RichTextImage
- TaskJuggler::RichTextIntermediate
- TaskJuggler::RichTextParser
- TaskJuggler::RichTextScanner
- TaskJuggler::RichTextSnip
- TaskJuggler::RichTextSyntaxRules
- TaskJuggler::Scenario
- TaskJuggler::ScenarioData
- TaskJuggler::ScenarioListAttribute
- TaskJuggler::Scoreboard
- TaskJuggler::ScoreboardInterval
- TaskJuggler::SheetHandlerBase
- TaskJuggler::SheetReceiver
- TaskJuggler::SheetSender
- TaskJuggler::Shift
- TaskJuggler::ShiftAssignment
- TaskJuggler::ShiftAssignments
- TaskJuggler::ShiftAssignmentsAttribute
- TaskJuggler::ShiftScenario
- TaskJuggler::SimpleQueryExpander
- TaskJuggler::SortListAttribute
- TaskJuggler::StatusSheetReceiver
- TaskJuggler::StatusSheetReport
- TaskJuggler::StatusSheetSender
- TaskJuggler::StdIoWrapper
- TaskJuggler::StringAttribute
- TaskJuggler::SymbolAttribute
- TaskJuggler::SymbolListAttribute
- TaskJuggler::SyntaxReference
- TaskJuggler::TOCEntry
- TaskJuggler::TSResourceRecord
- TaskJuggler::TSTaskRecord
- TaskJuggler::TableColumnDefinition
- TaskJuggler::TableColumnSorter
- TaskJuggler::TableOfContents
- TaskJuggler::TableReport
- TaskJuggler::TableReportColumn
- TaskJuggler::TagFile
- TaskJuggler::TagFile::TagFileEntry
- TaskJuggler::Task
- TaskJuggler::TaskDepListAttribute
- TaskJuggler::TaskDependency
- TaskJuggler::TaskListAttribute
- TaskJuggler::TaskListRE
- TaskJuggler::TaskScenario
- TaskJuggler::TernarySearchTree
- TaskJuggler::TextFormatter
- TaskJuggler::TextParser
- TaskJuggler::TextParser::Macro
- TaskJuggler::TextParser::MacroTable
- TaskJuggler::TextParser::Pattern
- TaskJuggler::TextParser::Rule
- TaskJuggler::TextParser::Scanner
- TaskJuggler::TextParser::Scanner::BufferStreamHandle
- TaskJuggler::TextParser::Scanner::FileStreamHandle
- TaskJuggler::TextParser::Scanner::MacroStackEntry
- TaskJuggler::TextParser::Scanner::StreamHandle
- TaskJuggler::TextParser::SourceFileInfo
- TaskJuggler::TextParser::StackElement
- TaskJuggler::TextParser::State
- TaskJuggler::TextParser::StateTransition
- TaskJuggler::TextParser::TextParserResultArray
- TaskJuggler::TextParser::TokenDoc
- TaskJuggler::TextReport
- TaskJuggler::TimeInterval
- TaskJuggler::TimeIntervalListAttribute
- TaskJuggler::TimeSheet
- TaskJuggler::TimeSheetReceiver
- TaskJuggler::TimeSheetRecord
- TaskJuggler::TimeSheetReport
- TaskJuggler::TimeSheetSender
- TaskJuggler::TimeSheetSummary
- TaskJuggler::TimeSheets
- TaskJuggler::Tj3
- TaskJuggler::Tj3AppBase
- TaskJuggler::Tj3Client
- TaskJuggler::Tj3Daemon
- TaskJuggler::Tj3Man
- TaskJuggler::Tj3SheetAppBase
- TaskJuggler::Tj3SsReceiver
- TaskJuggler::Tj3SsSender
- TaskJuggler::Tj3TsReceiver
- TaskJuggler::Tj3TsSender
- TaskJuggler::Tj3TsSummary
- TaskJuggler::Tj3WebD
- TaskJuggler::TjException
- TaskJuggler::TjRuntimeError
- TaskJuggler::TjTime
- TaskJuggler::TjpExample
- TaskJuggler::TjpExportRE
- TaskJuggler::TjpSyntaxRules
- TaskJuggler::TraceReport
- TaskJuggler::URLParameter
- TaskJuggler::UserManual
- TaskJuggler::VimSyntax
- TaskJuggler::WebServer
- TaskJuggler::WelcomePage
- TaskJuggler::WorkingHours
- TaskJuggler::WorkingHoursAttribute
- TaskJuggler::XMLBlob
- TaskJuggler::XMLComment
- TaskJuggler::XMLDocument
- TaskJuggler::XMLElement
- TaskJuggler::XMLNamedText
- TaskJuggler::XMLText
- Diff
- Diff::Hunk
- AppConfig
- Diffable
- DiffableString
- Object
- RuntimeConfig
- String

No matching classes.

# TaskJuggler::Journal

A Journal is a list of JournalEntry objects. It provides methods to add JournalEntry objects and retrieve specific entries or other processed information.

### Public Class Methods

new() click to toggle source

Create a new Journal object.

    # File lib/taskjuggler/Journal.rb, line 348
    def initialize
      # This list holds all entries.
      @entries = JournalEntryList.new
      # This hash holds a list of entries for each property.
      @propertyToEntries = {}
    end

### Public Instance Methods

addEntry(entry) click to toggle source

Add a new JournalEntry to the Journal.

    # File lib/taskjuggler/Journal.rb, line 356
    def addEntry(entry)
      return if @entries.include?(entry)
      @entries << entry

      return if entry.property.nil?

      # When we store the property into the @propertyToEntries hash, we need
      # to make sure that we store the PropertyTreeNode object and not a
      # PTNProxy object.
      unless @propertyToEntries.include?(entry.property.ptn)
        @propertyToEntries[entry.property.ptn] = JournalEntryList.new
      end
      @propertyToEntries[entry.property.ptn] << entry
    end

alertEntries(date, property, minLevel, minDate, query) click to toggle source

Return the list of JournalEntry objects that are dated at or before date, are for property or any of its childs, have at least level alert and are after minDate. We only return those entries with the highest overall alert level.

    # File lib/taskjuggler/Journal.rb, line 595
    def alertEntries(date, property, minLevel, minDate, query)
      maxLevel = 0
      entries = []
      # Gather all the current (as of the specified _date_) JournalEntry
      # objects for the property and than find the highest level.
      currentEntriesR(date, property, minLevel, minDate, query).each do |e|
        if maxLevel < e.alertLevel
          maxLevel = e.alertLevel
          entries = [ e ]
        elsif maxLevel == e.alertLevel
          entries << e
        end
      end
      entries
    end

alertLevel(date, property, query) click to toggle source

Determine the alert level for the given property at the given date. If the property does not have any JournalEntry objects or they are out of date compared to the child properties, the level is computed based on the highest level of the children. Only take the entries that are not filtered by query.hideJournalEntry into account.

    # File lib/taskjuggler/Journal.rb, line 581
    def alertLevel(date, property, query)
      maxLevel = 0
      # Gather all the current (as of the specified _date_) JournalEntry
      # objects for the property and than find the highest level.
      currentEntriesR(date, property, 0, nil, query).each do |e|
        maxLevel = e.alertLevel if maxLevel < e.alertLevel
      end
      maxLevel
    end

currentEntries(date, property, minLevel, minDate, logExp) click to toggle source

This function returns a list of entries that have all the exact same date and are the last entries before the deadline date. Only messages with at least the required alert level minLevel are returned. Messages with alert level minLevel must be newer than minDate.

    # File lib/taskjuggler/Journal.rb, line 615
    def currentEntries(date, property, minLevel, minDate, logExp)
      pEntries = getEntries(property) ?  getEntries(property).last(date) :
                 JournalEntryList.new
      # Remove entries below the minium alert level or before the timeout
      # date.
      pEntries.delete_if do |e|
        e.headline.empty? || e.alertLevel < minLevel ||
        (e.alertLevel == minLevel && minDate && e.date < minDate)
      end

      unless pEntries.empty?
        # Check parents for a more important or more up-to-date message.
        p = property.parent
        while p do
          ppEntries = getEntries(p) ?
                      getEntries(p).last(date) : JournalEntryList.new

          # A parent has a more up-to-date message.
          if !ppEntries.empty? && ppEntries.first.date >= pEntries.first.date
            return JournalEntryList.new
          end

          p = p.parent
        end
      end

      # Remove all entries that are filtered by logExp.
      if logExp
        pEntries.delete_if { |e| hidden(e, logExp) }
      end

      pEntries
    end

currentEntriesR(date, property, minLevel, minDate, query) click to toggle source

This function recursively traverses a tree of PropertyTreeNode objects from bottom to top. It returns the last entries before date for each property unless there is a property in the sub-tree specified by the root property with more up-to-date entries. The result is a JournalEntryList.

    # File lib/taskjuggler/Journal.rb, line 654
    def currentEntriesR(date, property, minLevel, minDate, query)
      DataCache.instance.cached(self, :currentEntriesR, date, property,
                                minLevel, minDate, query) do
        # See if this property has any current JournalEntry objects.
        pEntries = getEntries(property) ? getEntries(property).last(date) :
                   JournalEntryList.new
        # Remove entries below the minium alert level or before the timeout
        # date.
        pEntries.delete_if do |e|
          e.headline.empty? || e.alertLevel < minLevel ||
          (e.alertLevel == minLevel && minDate && e.date < minDate)
        end

        # Determine the highest alert level of the pEntries.
        maxPAlertLevel = 0
        pEntries.each do |e|
          maxPAlertLevel = e.alertLevel if e.alertLevel > maxPAlertLevel
        end

        cEntries = JournalEntryList.new
        latestDate = nil
        maxAlertLevel = 0
        # If we have an entry from this property, we only care about child
        # entries that are from a later date.
        minDate = pEntries.first.date + 1 unless pEntries.empty?

        # Now gather all current entries of the child properties and find the
        # date that is closest to and right before the given _date_.
        property.kids.each do |p|
          currentEntriesR(date, p, minLevel, minDate, query).each do |e|
            # Find the date of the most recent entry.
            latestDate = e.date if latestDate.nil? || e.date > latestDate
            # Find the highest alert level.
            maxAlertLevel = e.alertLevel if e.alertLevel > maxAlertLevel
            cEntries << e unless cEntries.include?(e)
          end
        end

        # Only Task properties have dependencies.
        if (query.journalMode == :status_dep ||
            query.journalMode == :alerts_dep) && property.is_a?(Task)
          # Now gather all current entries of the dependency properties and find
          # the date that is closest to and right before the given _date_.
          property['startpreds', query.scenarioIdx].each do |p, onEnd|
            # We only follow end->start dependencies.
            next unless onEnd

            currentEntriesR(date, p, minLevel, minDate, query).each do |e|
              # Find the date of the most recent entry.
              latestDate = e.date if latestDate.nil? || e.date > latestDate
              # Find the highest alert level.
              maxAlertLevel = e.alertLevel if e.alertLevel > maxAlertLevel
              cEntries << e unless cEntries.include?(e)
            end
          end
        end

        if !pEntries.empty? && (maxPAlertLevel > maxAlertLevel ||
                                latestDate.nil? ||
                                pEntries.first.date >= latestDate)
          # If no child property has a more current JournalEntry or one with a
          # higher alert level than this property and this property has
          # JournalEntry objects, than those are taken.
          entries = pEntries
        else
          # Otherwise we take the entries from the kids.
          entries = cEntries
        end

        # Remove all entries that are filtered by query.hideJournalEntry.
        if query.hideJournalEntry
          entries.delete_if { |e| hidden(e, query.hideJournalEntry) }
        end

        # Otherwise return the list provided by the childen.
        entries
      end
    end

delete_if() click to toggle source

Delete all entries of the Journal for which the block yields true.

    # File lib/taskjuggler/Journal.rb, line 376
    def delete_if
      @entries.delete_if do |e|
        res = yield(e)
        @propertyToEntries[e.property.ptn].delete(e) if res
        res
      end
    end

entries(startDate = nil, endDate = nil, logExp = nil, property = nil, alertLevel = nil) click to toggle source

    # File lib/taskjuggler/Journal.rb, line 560
    def entries(startDate = nil, endDate = nil, logExp = nil, property = nil,
                alertLevel = nil)
      list = JournalEntryList.new
      @entries.each do |entry|
        if (startDate.nil? || startDate <= entry.date) &&
           (endDate.nil? || endDate >= entry.date) &&
           (property.nil? || property.ptn == entry.property ||
                             entry.property.isChildOf?(property.ptn)) &&
           (alertLevel.nil? || alertLevel == entry.alertLevel) &&
           !hidden(entry, logExp)
          list << entry
        end
      end
      list
    end

entriesByResource(resource, startDate = nil, endDate = nil, logExp = nil, task = nil, alertLevel = nil) click to toggle source

Return a list of all JournalEntry objects for the given resource that are dated between startDate and endDate, are not hidden by their flags matching logExp, are for Task task and have at least the alert level _alertLevel. If an optional parameter is nil, it always matches the entry.

    # File lib/taskjuggler/Journal.rb, line 505
    def entriesByResource(resource, startDate = nil, endDate = nil,
                          logExp = nil, task = nil, alertLevel = nil)
      list = JournalEntryList.new
      @entries.each do |entry|
        if entry.author == resource.ptn &&
           (startDate.nil? || entry.date > startDate) &&
           (endDate.nil? || entry.date <= endDate) &&
           (task.nil? || entry.property == task.ptn) &&
           (alertLevel.nil? || entry.alertLevel >= alertLevel) &&
           !entry.headline.empty? && !hidden(entry, logExp)
          list << entry
        end
      end
      list
    end

entriesByTask(task, startDate = nil, endDate = nil, logExp = nil, resource = nil, alertLevel = nil) click to toggle source

Return a list of all JournalEntry objects for the given task that are dated between startDate and endDate (end date not included), are not hidden by their flags matching logExp are from Author resource and have at least the alert level _alertLevel. If an optional parameter is nil, it always matches the entry.

    # File lib/taskjuggler/Journal.rb, line 526
    def entriesByTask(task, startDate = nil, endDate = nil, logExp = nil,
                      resource = nil, alertLevel = nil)
      list = JournalEntryList.new
      @entries.each do |entry|
        if entry.property == task.ptn &&
           (startDate.nil? || entry.date >= startDate) &&
           (endDate.nil? || entry.date < endDate) &&
           (resource.nil? || entry.author == resource) &&
           (alertLevel.nil? || entry.alertLevel >= alertLevel) &&
           !entry.headline.empty? && !hidden(entry, logExp)
          list << entry
        end
      end
      list
    end

entriesByTaskR(task, startDate = nil, endDate = nil, logExp = nil, resource = nil, alertLevel = nil) click to toggle source

Return a list of all JournalEntry objects for the given task or any of its sub tasks that are dated between startDate and endDate, are not hidden by their flags matching logExp, are from Author resource and have at least the alert level _alertLevel. If an optional parameter is nil, it always matches the entry.

    # File lib/taskjuggler/Journal.rb, line 547
    def entriesByTaskR(task, startDate = nil, endDate = nil, logExp = nil,
                       resource = nil, alertLevel = nil)
      list = entriesByTask(task, startDate, endDate, logExp, resource,
                           alertLevel)

      task.kids.each do |t|
        list += entriesByTaskR(t, startDate, endDate, logExp, resource,
                               alertLevel)
      end

      list
    end

getEntries(property) click to toggle source

    # File lib/taskjuggler/Journal.rb, line 371
    def getEntries(property)
      @propertyToEntries[property.ptn]
    end

to_rti(query) click to toggle source

    # File lib/taskjuggler/Journal.rb, line 386
    def to_rti(query)
      entries = JournalEntryList.new

      case query.journalMode
      when :journal
        # This is the regular journal. It contains all journal entries that
        # are dated in the query interval. If a property is given, only
        # entries of this property are included.
        if query.property
          if query.property.is_a?(Task)
            entries = entriesByTask(query.property, query.start, query.end,
                                    query.hideJournalEntry)
          elsif query.property.is_a?(Resource)
            entries = entriesByResource(query.property, query.start, query.end,
                                        query.hideJournalEntry)
          end
        else
          entries = self.entries(query.start, query.end, query.hideJournalEntry)
        end
      when :journal_sub
        # This mode also contains all journal entries that are dated in the
        # query interval. A property must be given and only entries of this
        # property and all its children are included.
        if query.property.is_a?(Task)
          entries = entriesByTaskR(query.property, query.start, query.end,
                                   query.hideJournalEntry)
        end
      when :status_up
        # In this mode only the last entries before the query end date for
        # each task are included. An entry is not included if any of the
        # parent tasks has a more recent entry that is still before the query
        # end date.
        if query.property
          if query.property.is_a?(Task)
            entries += currentEntries(query.end, query.property, 0, query.start,
                                      query.hideJournalEntry)
          end
        else
          query.project.tasks.each do |task|
            # We only care about top-level tasks.
            next if task.parent

            entries += currentEntries(query.end, task, 0, query.start,
                                      query.hideJournalEntry)
            # Eliminate duplicates due to entries from adopted tasks
            entries.uniq!
          end
        end
      when :status_down, :status_dep
        # In this mode only the last entries before the query end date for
        # each task (incl. sub tasks) are included.
        if query.property
          if query.property.is_a?(Task)
            entries += currentEntriesR(query.end, query.property, 0,
                                       query.start, query)
          end
        else
          query.project.tasks.each do |task|
            # We only care about top-level tasks.
            next if task.parent

            entries += currentEntriesR(query.end, task, 0, query.start, query)
            # Eliminate duplicates due to entries from adopted tasks
            entries.uniq!
          end
        end
      when :alerts_down, :alerts_dep
        # In this mode only the last entries before the query end date for
        # each task (incl. sub tasks) and only the ones with the highest alert
        # level are included.
        if query.property
          if query.property.is_a?(Task)
            entries += alertEntries(query.end, query.property, 1, query.start,
                                    query)
          end
        else
          query.project.tasks.each do |task|
            # We only care about top-level tasks.
            next if task.parent

            entries += alertEntries(query.end, task, 1, query.start, query)
            # Eliminate duplicates due to entries from adopted tasks
            entries.uniq!
          end
        end
      else
        raise "Unknown jourmal mode: #{query.journalMode}"
      end
      # Sort entries according to the user specified sorting criteria.
      entries.setSorting(query.sortJournalEntries)
      entries.sort!

      # The components of the message are either UTF-8 text or RichText. For
      # the RichText components, we use the originally provided markup since
      # we compose the result as RichText markup first.
      rText = ''
      entries.each do |entry|
        rText += entry.to_rText(query)
      end

      # Now convert the RichText markup String into RichTextIntermediate
      # format.
      unless (rti = RichText.new(rText, RTFHandlers.create(query.project)).
                                 generateIntermediateFormat)
        warning('ptn_journal', "Syntax error in journal: #{rText}")
        return nil
      end
      # No section numbers, please!
      rti.sectionNumbers = false
      # We use a special class to allow CSS formating.
      rti.cssClass = 'tj_journal'
      query.rti = rti
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.