taskjuggler 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +280 -0
- data/README +31 -0
- data/Rakefile +20 -0
- data/benchmarks/UTF-8-Strings.rb +58 -0
- data/benchmarks/allocate.tjp +30 -0
- data/benchmarks/booking.tjp +62 -0
- data/benchmarks/depends.tjp +112 -0
- data/benchmarks/htmltaskreport.tjp +45 -0
- data/benchmarks/runbench.rb +24 -0
- data/bin/tj3 +3 -0
- data/bin/tj3man +3 -0
- data/doc/classes/AppConfig.html +808 -0
- data/doc/classes/Arguments.html +226 -0
- data/doc/classes/String.html +395 -0
- data/doc/classes/TaskJuggler.html +1358 -0
- data/doc/classes/TaskJuggler/Account.html +257 -0
- data/doc/classes/TaskJuggler/AccountScenario.html +218 -0
- data/doc/classes/TaskJuggler/Allocation.html +419 -0
- data/doc/classes/TaskJuggler/AllocationAttribute.html +291 -0
- data/doc/classes/TaskJuggler/AttributeBase.html +608 -0
- data/doc/classes/TaskJuggler/AttributeDefinition.html +259 -0
- data/doc/classes/TaskJuggler/Booking.html +307 -0
- data/doc/classes/TaskJuggler/BookingListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/BooleanAttribute.html +261 -0
- data/doc/classes/TaskJuggler/CSVFile.html +325 -0
- data/doc/classes/TaskJuggler/Charge.html +279 -0
- data/doc/classes/TaskJuggler/ChargeListAttribute.html +229 -0
- data/doc/classes/TaskJuggler/ChargeSet.html +440 -0
- data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +276 -0
- data/doc/classes/TaskJuggler/ColumnTable.html +260 -0
- data/doc/classes/TaskJuggler/DateAttribute.html +194 -0
- data/doc/classes/TaskJuggler/DependencyListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/DurationAttribute.html +229 -0
- data/doc/classes/TaskJuggler/FixnumAttribute.html +194 -0
- data/doc/classes/TaskJuggler/FlagListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/FloatAttribute.html +229 -0
- data/doc/classes/TaskJuggler/GanttChart.html +667 -0
- data/doc/classes/TaskJuggler/GanttContainer.html +441 -0
- data/doc/classes/TaskJuggler/GanttHeader.html +280 -0
- data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +245 -0
- data/doc/classes/TaskJuggler/GanttLine.html +398 -0
- data/doc/classes/TaskJuggler/GanttLoadStack.html +327 -0
- data/doc/classes/TaskJuggler/GanttMilestone.html +415 -0
- data/doc/classes/TaskJuggler/GanttRouter.html +425 -0
- data/doc/classes/TaskJuggler/GanttTaskBar.html +429 -0
- data/doc/classes/TaskJuggler/HTMLDocument.html +240 -0
- data/doc/classes/TaskJuggler/HTMLGraphics.html +231 -0
- data/doc/classes/TaskJuggler/Interval.html +552 -0
- data/doc/classes/TaskJuggler/IntervalListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/KeywordDocumentation.html +796 -0
- data/doc/classes/TaskJuggler/Limits.html +416 -0
- data/doc/classes/TaskJuggler/Limits/Limit.html +381 -0
- data/doc/classes/TaskJuggler/LimitsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/Log.html +613 -0
- data/doc/classes/TaskJuggler/LogicalAttribute.html +226 -0
- data/doc/classes/TaskJuggler/LogicalExpression.html +251 -0
- data/doc/classes/TaskJuggler/LogicalFlag.html +229 -0
- data/doc/classes/TaskJuggler/LogicalFunction.html +324 -0
- data/doc/classes/TaskJuggler/LogicalOperation.html +299 -0
- data/doc/classes/TaskJuggler/Macro.html +194 -0
- data/doc/classes/TaskJuggler/MacroParser.html +360 -0
- data/doc/classes/TaskJuggler/MacroTable.html +366 -0
- data/doc/classes/TaskJuggler/Message.html +281 -0
- data/doc/classes/TaskJuggler/MessageHandler.html +215 -0
- data/doc/classes/TaskJuggler/Project.html +1606 -0
- data/doc/classes/TaskJuggler/ProjectFileParser.html +412 -0
- data/doc/classes/TaskJuggler/PropertyList.html +597 -0
- data/doc/classes/TaskJuggler/PropertySet.html +1200 -0
- data/doc/classes/TaskJuggler/PropertyTreeNode.html +1449 -0
- data/doc/classes/TaskJuggler/Query.html +600 -0
- data/doc/classes/TaskJuggler/RealFormat.html +252 -0
- data/doc/classes/TaskJuggler/ReferenceAttribute.html +194 -0
- data/doc/classes/TaskJuggler/Report.html +528 -0
- data/doc/classes/TaskJuggler/ReportElement.html +1070 -0
- data/doc/classes/TaskJuggler/ReportTable.html +497 -0
- data/doc/classes/TaskJuggler/ReportTableCell.html +518 -0
- data/doc/classes/TaskJuggler/ReportTableColumn.html +364 -0
- data/doc/classes/TaskJuggler/ReportTableElement.html +644 -0
- data/doc/classes/TaskJuggler/ReportTableLegend.html +343 -0
- data/doc/classes/TaskJuggler/ReportTableLine.html +431 -0
- data/doc/classes/TaskJuggler/Resource.html +211 -0
- data/doc/classes/TaskJuggler/ResourceListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/ResourceListRE.html +249 -0
- data/doc/classes/TaskJuggler/ResourceScenario.html +1137 -0
- data/doc/classes/TaskJuggler/RichText.html +537 -0
- data/doc/classes/TaskJuggler/RichTextAttribute.html +229 -0
- data/doc/classes/TaskJuggler/RichTextDocument.html +418 -0
- data/doc/classes/TaskJuggler/RichTextElement.html +829 -0
- data/doc/classes/TaskJuggler/RichTextException.html +212 -0
- data/doc/classes/TaskJuggler/RichTextParser.html +317 -0
- data/doc/classes/TaskJuggler/RichTextProtocolExample.html +303 -0
- data/doc/classes/TaskJuggler/RichTextProtocolHandler.html +194 -0
- data/doc/classes/TaskJuggler/RichTextScanner.html +561 -0
- data/doc/classes/TaskJuggler/RichTextSnip.html +364 -0
- data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +883 -0
- data/doc/classes/TaskJuggler/Scenario.html +163 -0
- data/doc/classes/TaskJuggler/ScenarioData.html +354 -0
- data/doc/classes/TaskJuggler/Scoreboard.html +638 -0
- data/doc/classes/TaskJuggler/Shift.html +255 -0
- data/doc/classes/TaskJuggler/ShiftAssignment.html +488 -0
- data/doc/classes/TaskJuggler/ShiftAssignments.html +715 -0
- data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/ShiftScenario.html +282 -0
- data/doc/classes/TaskJuggler/SourceFileInfo.html +247 -0
- data/doc/classes/TaskJuggler/StringAttribute.html +229 -0
- data/doc/classes/TaskJuggler/SymbolAttribute.html +194 -0
- data/doc/classes/TaskJuggler/SyntaxReference.html +516 -0
- data/doc/classes/TaskJuggler/TOCEntry.html +242 -0
- data/doc/classes/TaskJuggler/TableColumnDefinition.html +273 -0
- data/doc/classes/TaskJuggler/TableOfContents.html +256 -0
- data/doc/classes/TaskJuggler/Task.html +203 -0
- data/doc/classes/TaskJuggler/TaskDependency.html +251 -0
- data/doc/classes/TaskJuggler/TaskListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/TaskListRE.html +250 -0
- data/doc/classes/TaskJuggler/TaskScenario.html +2206 -0
- data/doc/classes/TaskJuggler/TextParser.html +670 -0
- data/doc/classes/TaskJuggler/TextParser/Pattern.html +923 -0
- data/doc/classes/TaskJuggler/TextParser/Rule.html +779 -0
- data/doc/classes/TaskJuggler/TextParser/StackElement.html +267 -0
- data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +212 -0
- data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +221 -0
- data/doc/classes/TaskJuggler/TextScanner.html +708 -0
- data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +355 -0
- data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +341 -0
- data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +260 -0
- data/doc/classes/TaskJuggler/TjException.html +185 -0
- data/doc/classes/TaskJuggler/TjTime.html +1845 -0
- data/doc/classes/TaskJuggler/TjpExample.html +310 -0
- data/doc/classes/TaskJuggler/TjpExportRE.html +329 -0
- data/doc/classes/TaskJuggler/TjpSyntaxRules.html +8928 -0
- data/doc/classes/TaskJuggler/UserManual.html +606 -0
- data/doc/classes/TaskJuggler/WorkingHours.html +582 -0
- data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +284 -0
- data/doc/classes/TaskJuggler/XMLBlob.html +207 -0
- data/doc/classes/TaskJuggler/XMLComment.html +206 -0
- data/doc/classes/TaskJuggler/XMLDocument.html +293 -0
- data/doc/classes/TaskJuggler/XMLElement.html +341 -0
- data/doc/classes/TaskJuggler/XMLNamedText.html +174 -0
- data/doc/classes/TaskJuggler/XMLText.html +221 -0
- data/doc/files/COPYING.html +448 -0
- data/doc/files/README.html +134 -0
- data/doc/files/lib/AccountScenario_rb.html +116 -0
- data/doc/files/lib/Account_rb.html +118 -0
- data/doc/files/lib/Allocation_rb.html +118 -0
- data/doc/files/lib/AppConfig_rb.html +116 -0
- data/doc/files/lib/AttributeBase_rb.html +106 -0
- data/doc/files/lib/AttributeDefinition_rb.html +106 -0
- data/doc/files/lib/Attributes_rb.html +130 -0
- data/doc/files/lib/Booking_rb.html +106 -0
- data/doc/files/lib/ChargeSet_rb.html +116 -0
- data/doc/files/lib/Charge_rb.html +116 -0
- data/doc/files/lib/HTMLDocument_rb.html +116 -0
- data/doc/files/lib/Interval_rb.html +116 -0
- data/doc/files/lib/KeywordDocumentation_rb.html +122 -0
- data/doc/files/lib/Limits_rb.html +116 -0
- data/doc/files/lib/Log_rb.html +116 -0
- data/doc/files/lib/LogicalExpression_rb.html +122 -0
- data/doc/files/lib/LogicalFlag_rb.html +116 -0
- data/doc/files/lib/LogicalFunction_rb.html +116 -0
- data/doc/files/lib/LogicalOperation_rb.html +116 -0
- data/doc/files/lib/MacroParser_rb.html +118 -0
- data/doc/files/lib/MacroTable_rb.html +122 -0
- data/doc/files/lib/MessageHandler_rb.html +106 -0
- data/doc/files/lib/Message_rb.html +116 -0
- data/doc/files/lib/ProjectFileParser_rb.html +122 -0
- data/doc/files/lib/Project_rb.html +148 -0
- data/doc/files/lib/PropertyList_rb.html +106 -0
- data/doc/files/lib/PropertySet_rb.html +118 -0
- data/doc/files/lib/PropertyTreeNode_rb.html +106 -0
- data/doc/files/lib/Query_rb.html +116 -0
- data/doc/files/lib/RealFormat_rb.html +106 -0
- data/doc/files/lib/ResourceScenario_rb.html +116 -0
- data/doc/files/lib/Resource_rb.html +118 -0
- data/doc/files/lib/RichTextDocument_rb.html +120 -0
- data/doc/files/lib/RichTextElement_rb.html +120 -0
- data/doc/files/lib/RichTextParser_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolExample_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolHandler_rb.html +106 -0
- data/doc/files/lib/RichTextScanner_rb.html +116 -0
- data/doc/files/lib/RichTextSnip_rb.html +118 -0
- data/doc/files/lib/RichTextSyntaxRules_rb.html +106 -0
- data/doc/files/lib/RichText_rb.html +118 -0
- data/doc/files/lib/ScenarioData_rb.html +118 -0
- data/doc/files/lib/Scenario_rb.html +116 -0
- data/doc/files/lib/Scoreboard_rb.html +106 -0
- data/doc/files/lib/ShiftAssignments_rb.html +116 -0
- data/doc/files/lib/ShiftScenario_rb.html +116 -0
- data/doc/files/lib/Shift_rb.html +118 -0
- data/doc/files/lib/SourceFileInfo_rb.html +106 -0
- data/doc/files/lib/SyntaxReference_rb.html +122 -0
- data/doc/files/lib/TOCEntry_rb.html +118 -0
- data/doc/files/lib/TableColumnDefinition_rb.html +106 -0
- data/doc/files/lib/TableOfContents_rb.html +118 -0
- data/doc/files/lib/TaskDependency_rb.html +106 -0
- data/doc/files/lib/TaskJuggler_rb.html +120 -0
- data/doc/files/lib/TaskScenario_rb.html +116 -0
- data/doc/files/lib/Task_rb.html +118 -0
- data/doc/files/lib/TextParser/Pattern_rb.html +116 -0
- data/doc/files/lib/TextParser/Rule_rb.html +106 -0
- data/doc/files/lib/TextParser/StackElement_rb.html +106 -0
- data/doc/files/lib/TextParser/TokenDoc_rb.html +106 -0
- data/doc/files/lib/TextParser_rb.html +124 -0
- data/doc/files/lib/TextScanner_rb.html +128 -0
- data/doc/files/lib/Tj3Config_rb.html +118 -0
- data/doc/files/lib/TjException_rb.html +106 -0
- data/doc/files/lib/TjTime_rb.html +118 -0
- data/doc/files/lib/TjpExample_rb.html +116 -0
- data/doc/files/lib/TjpSyntaxRules_rb.html +106 -0
- data/doc/files/lib/UTF8String_rb.html +132 -0
- data/doc/files/lib/UserManual_rb.html +124 -0
- data/doc/files/lib/WorkingHours_rb.html +116 -0
- data/doc/files/lib/XMLDocument_rb.html +116 -0
- data/doc/files/lib/XMLElement_rb.html +116 -0
- data/doc/files/lib/reports/CSVFile_rb.html +116 -0
- data/doc/files/lib/reports/ColumnTable_rb.html +116 -0
- data/doc/files/lib/reports/GanttChart_rb.html +122 -0
- data/doc/files/lib/reports/GanttContainer_rb.html +116 -0
- data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +106 -0
- data/doc/files/lib/reports/GanttHeader_rb.html +116 -0
- data/doc/files/lib/reports/GanttLine_rb.html +126 -0
- data/doc/files/lib/reports/GanttLoadStack_rb.html +116 -0
- data/doc/files/lib/reports/GanttMilestone_rb.html +116 -0
- data/doc/files/lib/reports/GanttRouter_rb.html +106 -0
- data/doc/files/lib/reports/GanttTaskBar_rb.html +116 -0
- data/doc/files/lib/reports/HTMLGraphics_rb.html +106 -0
- data/doc/files/lib/reports/ReportElement_rb.html +118 -0
- data/doc/files/lib/reports/ReportTableCell_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableColumn_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableElement_rb.html +122 -0
- data/doc/files/lib/reports/ReportTableLegend_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableLine_rb.html +116 -0
- data/doc/files/lib/reports/ReportTable_rb.html +118 -0
- data/doc/files/lib/reports/Report_rb.html +126 -0
- data/doc/files/lib/reports/ResourceListRE_rb.html +122 -0
- data/doc/files/lib/reports/TaskListRE_rb.html +122 -0
- data/doc/files/lib/reports/TjpExportRE_rb.html +116 -0
- data/doc/files/lib/taskjuggler3_rb.html +276 -0
- data/doc/files/lib/tj3man_rb.html +189 -0
- data/doc/fr_class_index.html +285 -0
- data/doc/fr_file_index.html +223 -0
- data/doc/fr_method_index.html +1953 -0
- data/doc/index.html +21 -0
- data/doc/rdoc-style.css +299 -0
- data/examples/tutorial.tjp +361 -0
- data/gem_spec.rb +30 -0
- data/lib/Account.rb +50 -0
- data/lib/AccountScenario.rb +39 -0
- data/lib/Allocation.rb +102 -0
- data/lib/AppConfig.rb +134 -0
- data/lib/AttributeBase.rb +131 -0
- data/lib/AttributeDefinition.rb +47 -0
- data/lib/Attributes.rb +478 -0
- data/lib/BatchProcessor.rb +209 -0
- data/lib/Booking.rb +59 -0
- data/lib/Charge.rb +71 -0
- data/lib/ChargeSet.rb +126 -0
- data/lib/HTMLDocument.rb +59 -0
- data/lib/Interval.rb +127 -0
- data/lib/KeywordDocumentation.rb +560 -0
- data/lib/Limits.rb +219 -0
- data/lib/Log.rb +160 -0
- data/lib/LogicalExpression.rb +71 -0
- data/lib/LogicalFlag.rb +34 -0
- data/lib/LogicalFunction.rb +102 -0
- data/lib/LogicalOperation.rb +118 -0
- data/lib/MacroParser.rb +77 -0
- data/lib/MacroTable.rb +84 -0
- data/lib/Message.rb +56 -0
- data/lib/MessageHandler.rb +34 -0
- data/lib/Project.rb +662 -0
- data/lib/ProjectFileParser.rb +333 -0
- data/lib/PropertyList.rb +181 -0
- data/lib/PropertySet.rb +304 -0
- data/lib/PropertyTreeNode.rb +461 -0
- data/lib/Query.rb +227 -0
- data/lib/RealFormat.rb +73 -0
- data/lib/Resource.rb +42 -0
- data/lib/ResourceScenario.rb +511 -0
- data/lib/RichText.rb +147 -0
- data/lib/RichTextDocument.rb +139 -0
- data/lib/RichTextElement.rb +391 -0
- data/lib/RichTextParser.rb +66 -0
- data/lib/RichTextProtocolExample.rb +65 -0
- data/lib/RichTextProtocolHandler.rb +35 -0
- data/lib/RichTextScanner.rb +390 -0
- data/lib/RichTextSnip.rb +104 -0
- data/lib/RichTextSyntaxRules.rb +265 -0
- data/lib/Scenario.rb +27 -0
- data/lib/ScenarioData.rb +65 -0
- data/lib/Scoreboard.rb +141 -0
- data/lib/Shift.rb +48 -0
- data/lib/ShiftAssignments.rb +291 -0
- data/lib/ShiftScenario.rb +46 -0
- data/lib/SourceFileInfo.rb +37 -0
- data/lib/SyntaxReference.rb +284 -0
- data/lib/TOCEntry.rb +76 -0
- data/lib/TableColumnDefinition.rb +54 -0
- data/lib/TableOfContents.rb +46 -0
- data/lib/Task.rb +37 -0
- data/lib/TaskDependency.rb +39 -0
- data/lib/TaskJuggler.rb +84 -0
- data/lib/TaskScenario.rb +1622 -0
- data/lib/TextParser.rb +416 -0
- data/lib/TextParser/Pattern.rb +263 -0
- data/lib/TextParser/Rule.rb +171 -0
- data/lib/TextParser/StackElement.rb +45 -0
- data/lib/TextParser/TokenDoc.rb +38 -0
- data/lib/TextScanner.rb +682 -0
- data/lib/Tj3Config.rb +27 -0
- data/lib/TjException.rb +27 -0
- data/lib/TjTime.rb +395 -0
- data/lib/TjpExample.rb +119 -0
- data/lib/TjpSyntaxRules.rb +4022 -0
- data/lib/UTF8String.rb +100 -0
- data/lib/UserManual.rb +282 -0
- data/lib/WorkingHours.rb +323 -0
- data/lib/XMLDocument.rb +54 -0
- data/lib/XMLElement.rb +175 -0
- data/lib/reports/CSVFile.rb +146 -0
- data/lib/reports/ColumnTable.rb +66 -0
- data/lib/reports/GanttChart.rb +308 -0
- data/lib/reports/GanttContainer.rb +107 -0
- data/lib/reports/GanttHeader.rb +141 -0
- data/lib/reports/GanttHeaderScaleItem.rb +42 -0
- data/lib/reports/GanttLine.rb +329 -0
- data/lib/reports/GanttLoadStack.rb +113 -0
- data/lib/reports/GanttMilestone.rb +80 -0
- data/lib/reports/GanttRouter.rb +375 -0
- data/lib/reports/GanttTaskBar.rb +95 -0
- data/lib/reports/HTMLGraphics.rb +65 -0
- data/lib/reports/Report.rb +344 -0
- data/lib/reports/ReportElement.rb +427 -0
- data/lib/reports/ReportTable.rb +144 -0
- data/lib/reports/ReportTableCell.rb +142 -0
- data/lib/reports/ReportTableColumn.rb +82 -0
- data/lib/reports/ReportTableElement.rb +852 -0
- data/lib/reports/ReportTableLegend.rb +167 -0
- data/lib/reports/ReportTableLine.rb +87 -0
- data/lib/reports/ResourceListRE.rb +72 -0
- data/lib/reports/TaskListRE.rb +73 -0
- data/lib/reports/TjpExportRE.rb +394 -0
- data/lib/taskjuggler3.rb +106 -0
- data/lib/tj3man.rb +88 -0
- data/manual/Day_To_Day_Juggling +168 -0
- data/manual/Getting_Started +61 -0
- data/manual/How_To_Contribute +185 -0
- data/manual/Installation +68 -0
- data/manual/Intro +102 -0
- data/manual/Reporting_Bugs +26 -0
- data/manual/Rich_Text_Attributes +90 -0
- data/manual/TaskJuggler_2x_Migration +40 -0
- data/manual/Tutorial +579 -0
- data/manual/fdl +450 -0
- data/prj_cfg.rb +43 -0
- data/setup.rb +1585 -0
- data/tasks/csts.rake +72 -0
- data/tasks/gem.rake +14 -0
- data/tasks/manual.rake +10 -0
- data/tasks/missing.rake +21 -0
- data/tasks/rcov.rake +14 -0
- data/tasks/rdoc.rake +17 -0
- data/tasks/rexml_fix.rb +16 -0
- data/tasks/rexml_fix_19.rb +49 -0
- data/tasks/show.rake +21 -0
- data/tasks/stats.rake +25 -0
- data/tasks/test.rake +11 -0
- data/test/MessageChecker.rb +53 -0
- data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/celltext.tjp +7 -0
- data/test/TestSuite/CSV-Reports/genrefs +6 -0
- data/test/TestSuite/CSV-Reports/project-1.tji +57 -0
- data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -0
- data/test/TestSuite/CSV-Reports/resourcereport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks.tjp +11 -0
- data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortByTree.tjp +8 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/taskreport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +24 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources.tjp +11 -0
- data/test/TestSuite/Scheduler/Correct/Allocate.tjp +86 -0
- data/test/TestSuite/Scheduler/Correct/AutomaticMilestones.tjp +63 -0
- data/test/TestSuite/Scheduler/Correct/Booking.tjp +161 -0
- data/test/TestSuite/Scheduler/Correct/Depends.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Duration.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/InheritStartEnd.tjp +129 -0
- data/test/TestSuite/Scheduler/Correct/Limits.tjp +81 -0
- data/test/TestSuite/Scheduler/Correct/MultipleMandatories.tjp +43 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-1.tjp +28 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-2.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-3.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-4.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-5.tjp +62 -0
- data/test/TestSuite/Scheduler/Correct/Precedes.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Shift.tjp +102 -0
- data/test/TestSuite/Scheduler/Errors/account_no_leaf.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/booking_conflict.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/booking_no_duty.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/booking_on_vacation.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/container_booking.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/container_duration.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/effort_no_allocations.tjp +7 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_1.tjp +19 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_10.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_11.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_12.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_13.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_14.tjp +26 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_2.tjp +24 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_3.tjp +18 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_4.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_5.tjp +37 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_6.tjp +35 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_7.tjp +46 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_8.tjp +51 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_9.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/maxend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/maxstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_booking.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/milestone_duration.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_start_end.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/multiple_durations.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/no_tasks.tjp +6 -0
- data/test/TestSuite/Scheduler/Errors/not_scheduled.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_child.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_multi.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_parent.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_self.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_unknown.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_1.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_2.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_3.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_1.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_2.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_3.tjp +9 -0
- data/test/TestSuite/Syntax/Correct/Account.tjp +53 -0
- data/test/TestSuite/Syntax/Correct/Allocate-1.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/Alternative.tjp +13 -0
- data/test/TestSuite/Syntax/Correct/AutoMacros.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Booking.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Caption.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Celltext.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Comments.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Complete.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/CompletedWork.tji +20 -0
- data/test/TestSuite/Syntax/Correct/CriticalPath.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Currencyformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/CustomAttributes.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Depends1.tjp +22 -0
- data/test/TestSuite/Syntax/Correct/Durations.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Efficiency.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Export.tjp +40 -0
- data/test/TestSuite/Syntax/Correct/Flags.tjp +32 -0
- data/test/TestSuite/Syntax/Correct/Freeze.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Gap.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/HtmlTaskReport.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Limits-1.tjp +71 -0
- data/test/TestSuite/Syntax/Correct/LoadUnits.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Macro-1.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Mandatory.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Milestone.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/MinMax.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Numberformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Period.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Persistent.tjp +11 -0
- data/test/TestSuite/Syntax/Correct/Precedes1.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Priority.tjp +30 -0
- data/test/TestSuite/Syntax/Correct/Project.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/ProjectIDs.tjp +23 -0
- data/test/TestSuite/Syntax/Correct/RawHTML.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Reports.tjp +54 -0
- data/test/TestSuite/Syntax/Correct/Resource.tjp +20 -0
- data/test/TestSuite/Syntax/Correct/Responsible.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Scenario.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/Scheduling.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Select.tjp +27 -0
- data/test/TestSuite/Syntax/Correct/Shift.tjp +55 -0
- data/test/TestSuite/Syntax/Correct/Simple.tjp +25 -0
- data/test/TestSuite/Syntax/Correct/String.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Supplement.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +34 -0
- data/test/TestSuite/Syntax/Correct/TimeFrame.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Timezone.tjp +8 -0
- data/test/TestSuite/Syntax/Correct/Vacation.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/csvtest +16 -0
- data/test/TestSuite/Syntax/Correct/manual2example.rb +24 -0
- data/test/TestSuite/Syntax/Correct/tutorial.tjp +485 -0
- data/test/TestSuite/Syntax/Errors/bad_include.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/booking_group.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/booking_milestone.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/booking_no_leaf.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/chargeset.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/chargeset_master.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/container_attribute.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/cost_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/cost_rev_same.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/date_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/effort_zero.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/empty.tjp +1 -0
- data/test/TestSuite/Syntax/Errors/export_bad_extn.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/extend_id_cap.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_end_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_start_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/leaf_resource_id_expected.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/misaligned_date.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/no_csv_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/no_html_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/operand_attribute.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_flag.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/overtime_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/purge_no_list.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/purge_unknown_id.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/report_end.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_redifinition.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_start.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/resource_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/resource_id_expected.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/rev_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/scenario_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_assignment_overlap.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/shift_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_id_expected.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/sloppy_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/sort_direction.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sort_unknown_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd1.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd2.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_wbs.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/start_before_end1.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/start_before_end2.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/task_complete.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/task_priority.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_without_chargeset.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/time_interval.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/too_many_bangs.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/undecl_flag.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_projectid.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_id.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_idx.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/unknown_task.tjp +10 -0
- data/test/all.rb +31 -0
- data/test/test_BatchProcessor.rb +54 -0
- data/test/test_CSV-Reports.rb +101 -0
- data/test/test_Limits.rb +104 -0
- data/test/test_LogicalExpression.rb +110 -0
- data/test/test_MacroTable.rb +51 -0
- data/test/test_Project.rb +57 -0
- data/test/test_PropertySet.rb +71 -0
- data/test/test_Query.rb +83 -0
- data/test/test_RealFormat.rb +83 -0
- data/test/test_RichText.rb +869 -0
- data/test/test_Scheduler.rb +42 -0
- data/test/test_ShiftAssignments.rb +77 -0
- data/test/test_Syntax.rb +41 -0
- data/test/test_TextScanner.rb +95 -0
- data/test/test_TjTime.rb +114 -0
- data/test/test_TjpExample.rb +169 -0
- data/test/test_UTF8String.rb +84 -0
- data/test/test_WorkingHours.rb +56 -0
- metadata +649 -0
@@ -0,0 +1,427 @@
|
|
1
|
+
#!/usr/bin/env ruby -w
|
2
|
+
# encoding: UTF-8
|
3
|
+
#
|
4
|
+
# = ReportElement.rb -- The TaskJuggler III Project Management Software
|
5
|
+
#
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
7
|
+
#
|
8
|
+
# This program is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of version 2 of the GNU General Public License as
|
10
|
+
# published by the Free Software Foundation.
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'TableColumnDefinition'
|
14
|
+
require 'LogicalExpression'
|
15
|
+
|
16
|
+
class TaskJuggler
|
17
|
+
|
18
|
+
# A report can be composed of multiple report elements. The ReportElement
|
19
|
+
# class is the base class for all types of report elements. It holds a number
|
20
|
+
# of attributes that may or may not be used by the derived classes to modify
|
21
|
+
# the output or filter the displayed data. The class also provides functions
|
22
|
+
# that are used by many reports.
|
23
|
+
class ReportElement
|
24
|
+
|
25
|
+
attr_reader :start, :end, :userDefinedPeriod
|
26
|
+
attr_accessor :caption, :costAccount, :currencyFormat,
|
27
|
+
:epilog, :headline, :columns,
|
28
|
+
:scenarios, :taskRoot, :resourceRoot,
|
29
|
+
:timeFormat, :loadUnit, :now, :numberFormat, :weekStartsMonday,
|
30
|
+
:hideTask, :prolog, :revenueAccount,
|
31
|
+
:rollupTask, :hideResource, :rollupResource,
|
32
|
+
:sortTasks, :sortResources,
|
33
|
+
:ganttBars,
|
34
|
+
:rawHead, :rawTail,
|
35
|
+
:propertiesById, :propertiesByType
|
36
|
+
|
37
|
+
def initialize(report)
|
38
|
+
@report = report
|
39
|
+
@report.addElement(self)
|
40
|
+
@project = report.project
|
41
|
+
|
42
|
+
# The following attributes affect the report content and look.
|
43
|
+
@caption = nil
|
44
|
+
@columns = []
|
45
|
+
@costAccount = @report.costAccount
|
46
|
+
@currencyFormat = @report.currencyformat
|
47
|
+
@end = @report.end
|
48
|
+
@epilog = nil
|
49
|
+
@ganttBars = true
|
50
|
+
@headline = nil
|
51
|
+
@hideResource = nil
|
52
|
+
@hideTask = nil
|
53
|
+
@loadUnit = @report.loadUnit
|
54
|
+
@now = @report.now
|
55
|
+
@numberFormat = @report.numberformat
|
56
|
+
@prolog = nil
|
57
|
+
@rawHead = nil
|
58
|
+
@rawTail = nil
|
59
|
+
@resourceRoot = @report.resourceRoot
|
60
|
+
@revenueAccount = @report.revenueAccount
|
61
|
+
@rollupResource = nil
|
62
|
+
@rollupTask = nil
|
63
|
+
@scenarios = [ 0 ]
|
64
|
+
@shorttimeformat = @report.shorttimeformat
|
65
|
+
@sortResources = [[ 'seqno', true, -1 ]]
|
66
|
+
@sortTasks = [[ 'seqno', true, -1 ]]
|
67
|
+
@start = @report.start
|
68
|
+
@taskRoot = @report.taskRoot
|
69
|
+
@timeFormat = @report.timeformat
|
70
|
+
@timezone = @report.timezone
|
71
|
+
@userDefinedPeriod = @report.userDefinedPeriod
|
72
|
+
@weekStartsMonday = @report.weekstartsmonday
|
73
|
+
|
74
|
+
@propertiesById = {
|
75
|
+
# ID Header Indent Align Calced. Scen Spec.
|
76
|
+
'complete' => [ 'Completion', false, :right, true, true ],
|
77
|
+
'cost' => [ 'Cost', true, :right, true, true ],
|
78
|
+
'duration' => [ 'Duration', true, :right, true, true ],
|
79
|
+
'effort' => [ 'Effort', true, :right, true, true ],
|
80
|
+
'id' => [ 'Id', false, :left, true, false ],
|
81
|
+
'line' => [ 'Line No.', false, :right, true, false ],
|
82
|
+
'name' => [ 'Name', true, :left, false, false ],
|
83
|
+
'no' => [ 'No.', false, :right, true, false ],
|
84
|
+
'rate' => [ 'Rate', true, :right, true, true ],
|
85
|
+
'revenue' => [ 'Revenue', true, :right, true, true ],
|
86
|
+
'wbs' => [ 'WBS', false, :left, true, false ]
|
87
|
+
}
|
88
|
+
@propertiesByType = {
|
89
|
+
# Type Indent Align
|
90
|
+
DateAttribute => [ false, :left ],
|
91
|
+
FixnumAttribute => [ false, :right ],
|
92
|
+
FloatAttribute => [ false, :right ],
|
93
|
+
RichTextAttribute => [ false, :left ],
|
94
|
+
StringAttribute => [ false, :left ]
|
95
|
+
}
|
96
|
+
end
|
97
|
+
|
98
|
+
# Set the start _date_ of the report period and mark it as user defined.
|
99
|
+
def start=(date)
|
100
|
+
@start = date
|
101
|
+
@userDefinedPeriod = true
|
102
|
+
end
|
103
|
+
|
104
|
+
# Set the end _date_ of the report period and mark it as user defined.
|
105
|
+
def end=(date)
|
106
|
+
@end = date
|
107
|
+
@userDefinedPeriod = true
|
108
|
+
end
|
109
|
+
|
110
|
+
# Take the complete task list and remove all tasks that are matching the
|
111
|
+
# hide expression, the rollup Expression or are not a descendent of
|
112
|
+
# @taskRoot. In case resource is not nil, a task is only included if
|
113
|
+
# the resource is allocated to it in any of the reported scenarios.
|
114
|
+
def filterTaskList(list_, resource, hideExpr, rollupExpr)
|
115
|
+
list = TaskJuggler::PropertyList.new(list_)
|
116
|
+
if @taskRoot
|
117
|
+
# Remove all tasks that are not descendents of the @taskRoot.
|
118
|
+
list.delete_if { |task| !task.isChildOf?(@taskRoot) }
|
119
|
+
end
|
120
|
+
|
121
|
+
if resource
|
122
|
+
# If we have a resource we need to check that the resource is allocated
|
123
|
+
# to the tasks in any of the reported scenarios.
|
124
|
+
list.delete_if do |task|
|
125
|
+
delete = true
|
126
|
+
scenarios.each do |scenarioIdx|
|
127
|
+
if task['assignedresources', scenarioIdx].include?(resource)
|
128
|
+
delete = false
|
129
|
+
break;
|
130
|
+
end
|
131
|
+
end
|
132
|
+
delete
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
# Remove all tasks that don't overlap with the reported interval.
|
137
|
+
list.delete_if do |task|
|
138
|
+
delete = true
|
139
|
+
scenarios.each do |scenarioIdx|
|
140
|
+
iv = Interval.new(task['start', scenarioIdx].nil? ?
|
141
|
+
@project['start'] : task['start', scenarioIdx],
|
142
|
+
task['end', scenarioIdx].nil? ?
|
143
|
+
@project['end'] : task['end', scenarioIdx])
|
144
|
+
# Special case to include milestones at the report end.
|
145
|
+
if iv.start == iv.end && iv.end == @end
|
146
|
+
iv.start = iv.end = iv.start - 1
|
147
|
+
end
|
148
|
+
if iv.overlaps?(Interval.new(@start, @end))
|
149
|
+
delete = false
|
150
|
+
break;
|
151
|
+
end
|
152
|
+
end
|
153
|
+
delete
|
154
|
+
end
|
155
|
+
|
156
|
+
standardFilterOps(list, hideExpr, rollupExpr, resource, taskRoot)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Take the complete resource list and remove all resources that are matching
|
160
|
+
# the hide expression, the rollup Expression or are not a descendent of
|
161
|
+
# @resourceRoot. In case task is not nil, a resource is only included if
|
162
|
+
# it is assigned to the task in any of the reported scenarios.
|
163
|
+
def filterResourceList(list_, task, hideExpr, rollupExpr)
|
164
|
+
list = TaskJuggler::PropertyList.new(list_)
|
165
|
+
if @resourceRoot
|
166
|
+
# Remove all resources that are not descendents of the @resourceRoot.
|
167
|
+
list.delete_if { |resource| !resource.isChildOf?(@resourceRoot) }
|
168
|
+
end
|
169
|
+
|
170
|
+
if task
|
171
|
+
# If we have a task we need to check that the resources are assigned
|
172
|
+
# to the task in any of the reported scenarios.
|
173
|
+
iv = Interval.new(@start, @end)
|
174
|
+
list.delete_if do |resource|
|
175
|
+
delete = true
|
176
|
+
scenarios.each do |scenarioIdx|
|
177
|
+
if resource.allocated?(scenarioIdx, iv, task)
|
178
|
+
delete = false
|
179
|
+
break;
|
180
|
+
end
|
181
|
+
end
|
182
|
+
delete
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
standardFilterOps(list, hideExpr, rollupExpr, task, resourceRoot)
|
187
|
+
end
|
188
|
+
|
189
|
+
# This is the default attribute value to text converter. It is used
|
190
|
+
# whenever we need no special treatment.
|
191
|
+
def cellText(property, scenarioIdx, colId)
|
192
|
+
if property.is_a?(Resource)
|
193
|
+
propertyList = @project.resources
|
194
|
+
elsif property.is_a?(Task)
|
195
|
+
propertyList = @project.tasks
|
196
|
+
else
|
197
|
+
raise "Fatal Error: Unknown property #{property.class}"
|
198
|
+
end
|
199
|
+
|
200
|
+
begin
|
201
|
+
# Get the value no matter if it's scenario specific or not.
|
202
|
+
if propertyList.scenarioSpecific?(colId)
|
203
|
+
value = property[colId, scenarioIdx]
|
204
|
+
else
|
205
|
+
value = property.get(colId)
|
206
|
+
end
|
207
|
+
|
208
|
+
type = propertyList.attributeType(colId)
|
209
|
+
if value.nil?
|
210
|
+
if type == TaskJuggler::DateAttribute
|
211
|
+
nil
|
212
|
+
else
|
213
|
+
''
|
214
|
+
end
|
215
|
+
else
|
216
|
+
# Certain attribute types need special treatment.
|
217
|
+
if type == TaskJuggler::DateAttribute
|
218
|
+
value.to_s(timeFormat)
|
219
|
+
elsif type == TaskJuggler::RichTextAttribute
|
220
|
+
value
|
221
|
+
else
|
222
|
+
value.to_s
|
223
|
+
end
|
224
|
+
end
|
225
|
+
rescue TjException
|
226
|
+
''
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
# This function returns true if the values for the _colId_ column need to be
|
231
|
+
# calculated.
|
232
|
+
def calculated?(colId)
|
233
|
+
if @propertiesById.has_key?(colId)
|
234
|
+
return @propertiesById[colId][3]
|
235
|
+
end
|
236
|
+
return false
|
237
|
+
end
|
238
|
+
|
239
|
+
# This functions returns true if the values for the _col_id_ column are
|
240
|
+
# scenario specific.
|
241
|
+
def scenarioSpecific?(colId)
|
242
|
+
if @propertiesById.has_key?(colId)
|
243
|
+
return @propertiesById[colId][4]
|
244
|
+
end
|
245
|
+
return false
|
246
|
+
end
|
247
|
+
|
248
|
+
# Return if the column values should be indented based on the _colId_ or the
|
249
|
+
# _propertyType_.
|
250
|
+
def indent(colId, propertyType)
|
251
|
+
if @propertiesById.has_key?(colId)
|
252
|
+
return @propertiesById[colId][1]
|
253
|
+
elsif @propertiesByType.has_key?(propertyType)
|
254
|
+
return @propertiesByType[propertyType][0]
|
255
|
+
else
|
256
|
+
false
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
# Return the alignment of the column based on the _colId_ or the
|
261
|
+
# _propertyType_.
|
262
|
+
def alignment(colId, propertyType)
|
263
|
+
if @propertiesById.has_key?(colId)
|
264
|
+
return @propertiesById[colId][2]
|
265
|
+
elsif @propertiesByType.has_key?(propertyType)
|
266
|
+
return @propertiesByType[propertyType][1]
|
267
|
+
else
|
268
|
+
:center
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
# Returns the default column title for the columns _id_.
|
273
|
+
def defaultColumnTitle(id)
|
274
|
+
# Return an empty string for some special columns that don't have a fixed
|
275
|
+
# title.
|
276
|
+
specials = %w( chart hourly daily weekly monthly quarterly yearly)
|
277
|
+
return '' if specials.include?(id)
|
278
|
+
|
279
|
+
# Return the title for build-in hardwired columns.
|
280
|
+
return @propertiesById[id][0] if @propertiesById.include?(id)
|
281
|
+
|
282
|
+
# Otherwise we have to see if the column id is a task or resource
|
283
|
+
# attribute and return it's value.
|
284
|
+
(name = @project.tasks.attributeName(id)).nil? &&
|
285
|
+
(name = @project.resources.attributeName(id)).nil?
|
286
|
+
name
|
287
|
+
end
|
288
|
+
|
289
|
+
def supportedColumns
|
290
|
+
@propertiesById.keys
|
291
|
+
end
|
292
|
+
|
293
|
+
protected
|
294
|
+
|
295
|
+
# In case the user has not specified the report period, we try to fit all
|
296
|
+
# the _tasks_ in and add an extra 5% time at both ends. _scenarios_ is a
|
297
|
+
# list of scenario indexes.
|
298
|
+
def adjustReportPeriod(tasks, scenarios)
|
299
|
+
return if tasks.empty?
|
300
|
+
|
301
|
+
@start = @end = nil
|
302
|
+
scenarios.each do |scenarioIdx|
|
303
|
+
tasks.each do |task|
|
304
|
+
date = task['start', scenarioIdx] || @project['start']
|
305
|
+
@start = date if @start.nil? || date < @start
|
306
|
+
date = task['end', scenarioIdx] || @project['end']
|
307
|
+
@end = date if @end.nil? || date > @end
|
308
|
+
end
|
309
|
+
end
|
310
|
+
# Make sure we have a minimum width of 1 day
|
311
|
+
@end = @start + 60 * 60 * 24 if @end < @start + 60 * 60 * 24
|
312
|
+
padding = ((@end - @start) * 0.10).to_i
|
313
|
+
@start -= padding
|
314
|
+
@end += padding
|
315
|
+
end
|
316
|
+
|
317
|
+
private
|
318
|
+
|
319
|
+
# This function implements the generic filtering functionality for all kinds
|
320
|
+
# of lists.
|
321
|
+
def standardFilterOps(list, hideExpr, rollupExpr, scopeProperty, root)
|
322
|
+
# Remove all properties that the user wants to have hidden.
|
323
|
+
if hideExpr
|
324
|
+
list.delete_if do |property|
|
325
|
+
hideExpr.eval(property, scopeProperty)
|
326
|
+
end
|
327
|
+
end
|
328
|
+
|
329
|
+
# Remove all children of properties that the user has rolled-up.
|
330
|
+
if rollupExpr
|
331
|
+
list.delete_if do |property|
|
332
|
+
parent = property.parent
|
333
|
+
delete = false
|
334
|
+
while (parent)
|
335
|
+
if rollupExpr.eval(parent, scopeProperty)
|
336
|
+
delete = true
|
337
|
+
break
|
338
|
+
end
|
339
|
+
parent = parent.parent
|
340
|
+
end
|
341
|
+
delete
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
# Re-add parents in tree mode
|
346
|
+
if list.treeMode?
|
347
|
+
parents = []
|
348
|
+
list.each do |property|
|
349
|
+
parent = property
|
350
|
+
while (parent = parent.parent)
|
351
|
+
parents << parent unless list.include?(parent) ||
|
352
|
+
parents.include?(parent)
|
353
|
+
break if parent == root
|
354
|
+
end
|
355
|
+
end
|
356
|
+
list.append(parents)
|
357
|
+
end
|
358
|
+
|
359
|
+
list
|
360
|
+
end
|
361
|
+
|
362
|
+
# This function converts number to strings that may include a unit. The
|
363
|
+
# unit is determined by @loadUnit. In the automatic modes, the shortest
|
364
|
+
# possible result is shown and the unit is always appended. _value_ is the
|
365
|
+
# value to convert. _factors_ determines the conversion factors for the
|
366
|
+
# different units.
|
367
|
+
# TODO: Delete when all users have been migrated to use Query!
|
368
|
+
def scaleValue(value, factors)
|
369
|
+
if @loadUnit == :shortauto || @loadUnit == :longauto
|
370
|
+
# We try all possible units and store the resulting strings here.
|
371
|
+
options = []
|
372
|
+
# For each of the units we can define a maximum value that the value
|
373
|
+
# should not exceed. A maximum of 0 means no limit.
|
374
|
+
max = [ 60, 48, 0, 8, 24, 0 ]
|
375
|
+
|
376
|
+
i = 0
|
377
|
+
shortest = nil
|
378
|
+
factors.each do |factor|
|
379
|
+
scaledValue = value * factor
|
380
|
+
str = @numberFormat.format(scaledValue)
|
381
|
+
# We ignore results that are 0 or exceed the maximum. To ensure that
|
382
|
+
# we have at least one result the unscaled value is always taken.
|
383
|
+
if (factor != 1.0 && scaledValue == 0) ||
|
384
|
+
(max[i] != 0 && scaledValue > max[i])
|
385
|
+
options << nil
|
386
|
+
else
|
387
|
+
options << str
|
388
|
+
end
|
389
|
+
i += 1
|
390
|
+
end
|
391
|
+
|
392
|
+
# Default to days in case they are all the same.
|
393
|
+
shortest = 2
|
394
|
+
# Find the shortest option.
|
395
|
+
6.times do |j|
|
396
|
+
shortest = j if options[j] &&
|
397
|
+
options[j].length < options[shortest].length
|
398
|
+
end
|
399
|
+
|
400
|
+
str = options[shortest]
|
401
|
+
if @loadUnit == :longauto
|
402
|
+
# For the long units we handle singular and plural properly. For
|
403
|
+
# English we just need to append an 's', but this code will work for
|
404
|
+
# other languages as well.
|
405
|
+
units = []
|
406
|
+
if str == "1"
|
407
|
+
units = %w( minute hour day week month year )
|
408
|
+
else
|
409
|
+
units = %w( minutes hours days weeks months years )
|
410
|
+
end
|
411
|
+
str += ' ' + units[shortest]
|
412
|
+
else
|
413
|
+
str += %w( min h d w m y )[shortest]
|
414
|
+
end
|
415
|
+
else
|
416
|
+
# For fixed units we just need to do the conversion. No unit is
|
417
|
+
# included.
|
418
|
+
units = [ :minutes, :hours, :days, :weeks, :months, :years ]
|
419
|
+
str = @numberFormat.format(value * factors[units.index(@loadUnit)])
|
420
|
+
end
|
421
|
+
str
|
422
|
+
end
|
423
|
+
|
424
|
+
end
|
425
|
+
|
426
|
+
end
|
427
|
+
|
@@ -0,0 +1,144 @@
|
|
1
|
+
#!/usr/bin/env ruby -w
|
2
|
+
# encoding: UTF-8
|
3
|
+
#
|
4
|
+
# = ReportTable.rb -- The TaskJuggler III Project Management Software
|
5
|
+
#
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
7
|
+
#
|
8
|
+
# This program is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of version 2 of the GNU General Public License as
|
10
|
+
# published by the Free Software Foundation.
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'reports/ReportTableColumn'
|
14
|
+
require 'reports/ReportTableLine'
|
15
|
+
|
16
|
+
class TaskJuggler
|
17
|
+
|
18
|
+
# This class models the intermediate format of all report tables. The
|
19
|
+
# generators for all the table reports create the report in this intermediate
|
20
|
+
# format. The to_* member functions can then output the table in the
|
21
|
+
# appropriate format.
|
22
|
+
class ReportTable
|
23
|
+
|
24
|
+
attr_reader :maxIndent, :headerLineHeight, :headerFontSize
|
25
|
+
attr_accessor :equiLines
|
26
|
+
|
27
|
+
# Create a new ReportTable object.
|
28
|
+
def initialize
|
29
|
+
# The height if the header lines in screen pixels.
|
30
|
+
@headerLineHeight = 19
|
31
|
+
# Size of the font used in the header
|
32
|
+
@headerFontSize = 15
|
33
|
+
# Array of ReportTableColumn objects.
|
34
|
+
@columns = []
|
35
|
+
# Array of ReportTableLine objects.
|
36
|
+
@lines = []
|
37
|
+
@maxIndent = 0
|
38
|
+
# Whether or not all table lines must have same height.
|
39
|
+
@equiLines = false
|
40
|
+
end
|
41
|
+
|
42
|
+
# This function should only be called by the ReportTableColumn constructor.
|
43
|
+
def addColumn(col)
|
44
|
+
@columns << col
|
45
|
+
end
|
46
|
+
|
47
|
+
# This function should only be called by the ReportTableLine constructor.
|
48
|
+
def addLine(line)
|
49
|
+
@lines << line
|
50
|
+
end
|
51
|
+
|
52
|
+
# Return the number of registered lines for this table.
|
53
|
+
def lines
|
54
|
+
@lines.length
|
55
|
+
end
|
56
|
+
|
57
|
+
# Return the minimum required width for the table. If we don't have a
|
58
|
+
# mininum with, nil is returned.
|
59
|
+
def minWidth
|
60
|
+
width = 1
|
61
|
+
@columns.each do |column|
|
62
|
+
cw = column.minWidth
|
63
|
+
width += cw + 1 if cw
|
64
|
+
end
|
65
|
+
width
|
66
|
+
end
|
67
|
+
|
68
|
+
# Output the table as HTML.
|
69
|
+
def to_html
|
70
|
+
determineMaxIndents
|
71
|
+
|
72
|
+
table = XMLElement.new('table', 'align' => 'center', 'cellspacing' => '1',
|
73
|
+
'cellpadding' => '2', 'width' => '100%',
|
74
|
+
'class' => 'tabback')
|
75
|
+
table << (tbody = XMLElement.new('tbody'))
|
76
|
+
|
77
|
+
# Generate the 1st table header line.
|
78
|
+
tbody << (tr =
|
79
|
+
XMLElement.new('tr', 'class' => 'tabhead',
|
80
|
+
'style' => "height:#{@headerLineHeight}px; " +
|
81
|
+
"font-size:#{@headerFontSize}px;"))
|
82
|
+
@columns.each { |col| tr << col.to_html(1) }
|
83
|
+
|
84
|
+
# Generate the 2nd table header line.
|
85
|
+
tbody << (tr =
|
86
|
+
XMLElement.new('tr', 'class' => 'tabhead',
|
87
|
+
'style' => "height:#{@headerLineHeight}px; " +
|
88
|
+
"font-size:#{@headerFontSize}px;"))
|
89
|
+
@columns.each { |col| tr << col.to_html(2) }
|
90
|
+
|
91
|
+
# Generate the rest of the table.
|
92
|
+
@lines.each { |line| tbody << line.to_html }
|
93
|
+
|
94
|
+
# In case we have columns with scrollbars, we generate an extra line with
|
95
|
+
# cells for all columns that don't have a scrollbar. The scrollbar must
|
96
|
+
# have a height of 18 pixels or less.
|
97
|
+
if hasScrollbar?
|
98
|
+
tbody << (tr = XMLElement.new('tr', 'style' => 'height:18px'))
|
99
|
+
@columns.each do |column|
|
100
|
+
unless column.scrollbar
|
101
|
+
tr << XMLElement.new('td')
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
table
|
107
|
+
end
|
108
|
+
|
109
|
+
# Convert the intermediate representation into an Array of Arrays. _csv_ is
|
110
|
+
# the destination Array of Arrays. It may contain columns already.
|
111
|
+
def to_csv()
|
112
|
+
csv = [ [ ] ]
|
113
|
+
@columns.each { |col| col.to_csv(csv) }
|
114
|
+
|
115
|
+
@lines.each do |line|
|
116
|
+
# Insert a new Array for each line.
|
117
|
+
csv << []
|
118
|
+
line.to_csv(csv)
|
119
|
+
end
|
120
|
+
csv
|
121
|
+
end
|
122
|
+
|
123
|
+
private
|
124
|
+
|
125
|
+
# Some columns need to be indented when the data is sorted in tree mode.
|
126
|
+
# This function determines the largest needed indentation of all lines. The
|
127
|
+
# result is stored in the _@maxIndent_ variable.
|
128
|
+
def determineMaxIndents
|
129
|
+
@maxIndent = 0
|
130
|
+
@lines.each do |line|
|
131
|
+
@maxIndent = line.indentation if line.indentation > @maxIndent
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# Returns true if any of the columns has a scrollbar.
|
136
|
+
def hasScrollbar?
|
137
|
+
@columns.each { |col| return true if col.scrollbar }
|
138
|
+
false
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
144
|
+
|