taskjuggler 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/benchmarks/UTF-8-Strings.rb +58 -0
- data/data/css/tjmanual.css +52 -0
- data/data/css/tjreport.css +195 -0
- data/data/icons/details.png +0 -0
- data/data/icons/flag-green.png +0 -0
- data/data/icons/flag-red.png +0 -0
- data/data/icons/flag-yellow.png +0 -0
- data/data/icons/resource.png +0 -0
- data/data/icons/resourcegroup.png +0 -0
- data/data/icons/task.png +0 -0
- data/data/icons/taskgroup.png +0 -0
- data/data/icons/trend-down.png +0 -0
- data/data/icons/trend-flat.png +0 -0
- data/data/icons/trend-up.png +0 -0
- data/data/scripts/wz_tooltip.js +1301 -0
- data/doc/classes/AppConfig.html +298 -230
- data/doc/classes/Arguments.html +8 -8
- data/doc/classes/Object.html +7 -7
- data/doc/classes/String.html +89 -89
- data/doc/classes/TaskJuggler.html +396 -264
- data/doc/classes/TaskJuggler/Account.html +18 -18
- data/doc/classes/TaskJuggler/AccountAttribute.html +26 -26
- data/doc/classes/TaskJuggler/AccountScenario.html +12 -12
- data/doc/classes/TaskJuggler/Allocation.html +30 -30
- data/doc/classes/TaskJuggler/AllocationAttribute.html +26 -26
- data/doc/classes/TaskJuggler/AttributeBase.html +227 -115
- data/doc/classes/TaskJuggler/AttributeDefinition.html +6 -6
- data/doc/classes/TaskJuggler/BatchProcessor.html +117 -83
- data/doc/classes/TaskJuggler/Booking.html +18 -18
- data/doc/classes/TaskJuggler/BookingListAttribute.html +26 -26
- data/doc/classes/TaskJuggler/BooleanAttribute.html +26 -26
- data/doc/classes/TaskJuggler/CSVFile.html +24 -24
- data/doc/classes/TaskJuggler/CellSettingPattern.html +201 -0
- data/doc/classes/TaskJuggler/CellSettingPatternList.html +253 -0
- data/doc/classes/TaskJuggler/Charge.html +18 -18
- data/doc/classes/TaskJuggler/ChargeListAttribute.html +20 -20
- data/doc/classes/TaskJuggler/ChargeSet.html +37 -37
- data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +26 -26
- data/doc/classes/TaskJuggler/ColumnListAttribute.html +20 -20
- data/doc/classes/TaskJuggler/ColumnTable.html +40 -40
- data/doc/classes/TaskJuggler/DateAttribute.html +54 -15
- data/doc/classes/TaskJuggler/DefinitionListAttribute.html +10 -10
- data/doc/classes/TaskJuggler/DependencyListAttribute.html +47 -47
- data/doc/classes/TaskJuggler/DurationAttribute.html +30 -30
- data/doc/classes/TaskJuggler/FixnumAttribute.html +20 -20
- data/doc/classes/TaskJuggler/FlagListAttribute.html +43 -43
- data/doc/classes/TaskJuggler/FloatAttribute.html +30 -30
- data/doc/classes/TaskJuggler/FormatListAttribute.html +21 -21
- data/doc/classes/TaskJuggler/GanttChart.html +48 -48
- data/doc/classes/TaskJuggler/GanttContainer.html +42 -42
- data/doc/classes/TaskJuggler/GanttHeader.html +12 -12
- data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +12 -12
- data/doc/classes/TaskJuggler/GanttLine.html +24 -24
- data/doc/classes/TaskJuggler/GanttLoadStack.html +18 -18
- data/doc/classes/TaskJuggler/GanttMilestone.html +42 -42
- data/doc/classes/TaskJuggler/GanttRouter.html +24 -24
- data/doc/classes/TaskJuggler/GanttTaskBar.html +42 -42
- data/doc/classes/TaskJuggler/HTMLDocument.html +13 -13
- data/doc/classes/TaskJuggler/HTMLGraphics.html +12 -12
- data/doc/classes/TaskJuggler/Interval.html +57 -57
- data/doc/classes/TaskJuggler/IntervalListAttribute.html +47 -47
- data/doc/classes/TaskJuggler/JobInfo.html +68 -12
- data/doc/classes/TaskJuggler/Journal.html +266 -20
- data/doc/classes/TaskJuggler/JournalEntry.html +79 -23
- data/doc/classes/TaskJuggler/JournalEntryList.html +454 -0
- data/doc/classes/TaskJuggler/KeywordArray.html +10 -10
- data/doc/classes/TaskJuggler/KeywordDocumentation.html +171 -170
- data/doc/classes/TaskJuggler/Limits.html +36 -36
- data/doc/classes/TaskJuggler/Limits/Limit.html +30 -30
- data/doc/classes/TaskJuggler/LimitsAttribute.html +40 -40
- data/doc/classes/TaskJuggler/ListAttributeBase.html +20 -20
- data/doc/classes/TaskJuggler/Log.html +145 -107
- data/doc/classes/TaskJuggler/LogicalAttribute.html +65 -36
- data/doc/classes/TaskJuggler/LogicalExpression.html +61 -24
- data/doc/classes/TaskJuggler/LogicalExpressionAttribute.html +20 -20
- data/doc/classes/TaskJuggler/LogicalFlag.html +31 -51
- data/doc/classes/TaskJuggler/LogicalFunction.html +64 -53
- data/doc/classes/TaskJuggler/LogicalOperation.html +103 -55
- data/doc/classes/TaskJuggler/Macro.html +6 -6
- data/doc/classes/TaskJuggler/MacroParser.html +36 -36
- data/doc/classes/TaskJuggler/MacroTable.html +37 -37
- data/doc/classes/TaskJuggler/Message.html +12 -12
- data/doc/classes/TaskJuggler/MessageHandler.html +32 -20
- data/doc/classes/TaskJuggler/Navigator.html +110 -46
- data/doc/classes/TaskJuggler/NavigatorElement.html +449 -0
- data/doc/classes/TaskJuggler/OnShiftCache.html +24 -24
- data/doc/classes/TaskJuggler/Project.html +1158 -893
- data/doc/classes/TaskJuggler/ProjectFileParser.html +94 -91
- data/doc/classes/TaskJuggler/PropertyAttribute.html +20 -20
- data/doc/classes/TaskJuggler/PropertyList.html +225 -155
- data/doc/classes/TaskJuggler/PropertySet.html +375 -332
- data/doc/classes/TaskJuggler/PropertyTreeNode.html +750 -510
- data/doc/classes/TaskJuggler/Query.html +404 -139
- data/doc/classes/TaskJuggler/{RTPNavigator.html → RTFNavigator.html} +57 -56
- data/doc/classes/TaskJuggler/RTFQuery.html +343 -0
- data/doc/classes/TaskJuggler/{RTPReport.html → RTFReport.html} +70 -67
- data/doc/classes/TaskJuggler/RealFormat.html +18 -18
- data/doc/classes/TaskJuggler/RealFormatAttribute.html +10 -10
- data/doc/classes/TaskJuggler/ReferenceAttribute.html +107 -40
- data/doc/classes/TaskJuggler/RemoteServiceManager.html +335 -0
- data/doc/classes/TaskJuggler/Report.html +66 -64
- data/doc/classes/TaskJuggler/ReportBase.html +112 -123
- data/doc/classes/TaskJuggler/ReportContext.html +43 -38
- data/doc/classes/TaskJuggler/ReportServer.html +320 -0
- data/doc/classes/TaskJuggler/ReportTable.html +42 -42
- data/doc/classes/TaskJuggler/ReportTableCell.html +221 -129
- data/doc/classes/TaskJuggler/ReportTableColumn.html +27 -27
- data/doc/classes/TaskJuggler/ReportTableLegend.html +24 -24
- data/doc/classes/TaskJuggler/ReportTableLine.html +126 -80
- data/doc/classes/TaskJuggler/Resource.html +12 -12
- data/doc/classes/TaskJuggler/ResourceListAttribute.html +82 -47
- data/doc/classes/TaskJuggler/ResourceListRE.html +43 -39
- data/doc/classes/TaskJuggler/ResourceScenario.html +413 -321
- data/doc/classes/TaskJuggler/RichText.html +64 -248
- data/doc/classes/TaskJuggler/RichTextAttribute.html +94 -30
- data/doc/classes/TaskJuggler/RichTextDocument.html +87 -85
- data/doc/classes/TaskJuggler/RichTextElement.html +456 -363
- data/doc/classes/TaskJuggler/RichTextException.html +13 -13
- data/doc/classes/TaskJuggler/{RichTextProtocolExample.html → RichTextFunctionExample.html} +64 -63
- data/doc/classes/TaskJuggler/{RichTextProtocolHandler.html → RichTextFunctionHandler.html} +42 -36
- data/doc/classes/TaskJuggler/RichTextIntermediate.html +563 -0
- data/doc/classes/TaskJuggler/RichTextParser.html +54 -51
- data/doc/classes/TaskJuggler/RichTextScanner.html +94 -92
- data/doc/classes/TaskJuggler/RichTextSnip.html +96 -60
- data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +369 -227
- data/doc/classes/TaskJuggler/Scenario.html +6 -6
- data/doc/classes/TaskJuggler/ScenarioData.html +37 -37
- data/doc/classes/TaskJuggler/ScenarioListAttribute.html +31 -31
- data/doc/classes/TaskJuggler/Scoreboard.html +66 -66
- data/doc/classes/TaskJuggler/Shift.html +18 -18
- data/doc/classes/TaskJuggler/ShiftAssignment.html +54 -54
- data/doc/classes/TaskJuggler/ShiftAssignments.html +78 -78
- data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +40 -40
- data/doc/classes/TaskJuggler/ShiftScenario.html +24 -24
- data/doc/classes/TaskJuggler/SortListAttribute.html +22 -22
- data/doc/classes/TaskJuggler/SourceFileInfo.html +12 -12
- data/doc/classes/TaskJuggler/StringAttribute.html +30 -30
- data/doc/classes/TaskJuggler/SymbolAttribute.html +20 -20
- data/doc/classes/TaskJuggler/SyntaxReference.html +42 -42
- data/doc/classes/TaskJuggler/TOCEntry.html +12 -12
- data/doc/classes/TaskJuggler/TSResourceRecord.html +197 -0
- data/doc/classes/TaskJuggler/TSTaskRecord.html +215 -0
- data/doc/classes/TaskJuggler/TableColumnDefinition.html +64 -43
- data/doc/classes/TaskJuggler/TableOfContents.html +18 -18
- data/doc/classes/TaskJuggler/TableReport.html +447 -468
- data/doc/classes/TaskJuggler/Task.html +12 -12
- data/doc/classes/TaskJuggler/TaskDependency.html +12 -12
- data/doc/classes/TaskJuggler/TaskListAttribute.html +47 -47
- data/doc/classes/TaskJuggler/TaskListRE.html +43 -39
- data/doc/classes/TaskJuggler/TaskScenario.html +529 -282
- data/doc/classes/TaskJuggler/TextParser.html +215 -194
- data/doc/classes/TaskJuggler/TextParser/Pattern.html +97 -97
- data/doc/classes/TaskJuggler/TextParser/Rule.html +84 -84
- data/doc/classes/TaskJuggler/TextParser/StackElement.html +16 -15
- data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +12 -12
- data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +6 -6
- data/doc/classes/TaskJuggler/TextReport.html +77 -74
- data/doc/classes/TaskJuggler/TextScanner.html +294 -281
- data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +70 -70
- data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +59 -60
- data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +12 -12
- data/doc/classes/TaskJuggler/TimeSheetReport.html +406 -0
- data/doc/classes/TaskJuggler/TjException.html +6 -6
- data/doc/classes/TaskJuggler/TjTime.html +522 -513
- data/doc/classes/TaskJuggler/TjpExample.html +25 -25
- data/doc/classes/TaskJuggler/TjpExportRE.html +21 -24
- data/doc/classes/TaskJuggler/TjpSyntaxRules.html +6177 -4318
- data/doc/classes/TaskJuggler/UserManual.html +212 -213
- data/doc/classes/TaskJuggler/WorkingHours.html +49 -49
- data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +53 -53
- data/doc/classes/TaskJuggler/XMLBlob.html +21 -21
- data/doc/classes/TaskJuggler/XMLComment.html +21 -21
- data/doc/classes/TaskJuggler/XMLDocument.html +27 -26
- data/doc/classes/TaskJuggler/XMLElement.html +86 -50
- data/doc/classes/TaskJuggler/XMLNamedText.html +11 -11
- data/doc/classes/TaskJuggler/XMLText.html +36 -36
- data/doc/files/COPYING.html +1 -1
- data/doc/files/README.html +1 -1
- data/doc/files/lib/AccountScenario_rb.html +3 -2
- data/doc/files/lib/Account_rb.html +3 -2
- data/doc/files/lib/Allocation_rb.html +3 -2
- data/doc/files/lib/AppConfig_rb.html +5 -2
- data/doc/files/lib/AttributeBase_rb.html +3 -2
- data/doc/files/lib/AttributeDefinition_rb.html +3 -2
- data/doc/files/lib/Attributes_rb.html +3 -2
- data/doc/files/lib/BatchProcessor_rb.html +4 -3
- data/doc/files/lib/Booking_rb.html +3 -2
- data/doc/files/lib/ChargeSet_rb.html +3 -2
- data/doc/files/lib/Charge_rb.html +3 -2
- data/doc/files/lib/HTMLDocument_rb.html +3 -2
- data/doc/files/lib/Interval_rb.html +3 -2
- data/doc/files/lib/Journal_rb.html +4 -3
- data/doc/files/lib/KeywordArray_rb.html +3 -2
- data/doc/files/lib/KeywordDocumentation_rb.html +3 -2
- data/doc/files/lib/Limits_rb.html +3 -2
- data/doc/files/lib/Log_rb.html +3 -2
- data/doc/files/lib/LogicalExpression_rb.html +3 -2
- data/doc/files/lib/LogicalFunction_rb.html +3 -2
- data/doc/files/lib/LogicalOperation_rb.html +3 -2
- data/doc/files/lib/MacroParser_rb.html +3 -2
- data/doc/files/lib/MacroTable_rb.html +3 -2
- data/doc/files/lib/MessageHandler_rb.html +3 -2
- data/doc/files/lib/Message_rb.html +3 -2
- data/doc/files/lib/ProjectFileParser_rb.html +7 -4
- data/doc/files/lib/Project_rb.html +3 -2
- data/doc/files/lib/PropertyList_rb.html +3 -2
- data/doc/files/lib/PropertySet_rb.html +3 -2
- data/doc/files/lib/PropertyTreeNode_rb.html +3 -2
- data/doc/files/lib/Query_rb.html +3 -2
- data/doc/files/lib/{RTPNavigator_rb.html → RTFNavigator_rb.html} +8 -7
- data/doc/files/lib/RTFQuery_rb.html +121 -0
- data/doc/files/lib/{RTPReport_rb.html → RTFReport_rb.html} +8 -7
- data/doc/files/lib/RealFormat_rb.html +3 -2
- data/doc/files/lib/RemoteServiceManager_rb.html +117 -0
- data/doc/files/lib/ReportServer_rb.html +107 -0
- data/doc/files/lib/ResourceScenario_rb.html +3 -2
- data/doc/files/lib/Resource_rb.html +3 -2
- data/doc/files/lib/RichTextDocument_rb.html +4 -3
- data/doc/files/lib/RichTextElement_rb.html +3 -2
- data/doc/files/lib/{RichTextProtocolExample_rb.html → RichTextFunctionExample_rb.html} +8 -7
- data/doc/files/lib/{RichTextProtocolHandler_rb.html → RichTextFunctionHandler_rb.html} +7 -6
- data/doc/files/lib/RichTextParser_rb.html +3 -2
- data/doc/files/lib/RichTextScanner_rb.html +3 -2
- data/doc/files/lib/RichTextSnip_rb.html +3 -2
- data/doc/files/lib/RichTextSyntaxRules_rb.html +3 -2
- data/doc/files/lib/RichText_rb.html +3 -2
- data/doc/files/lib/ScenarioData_rb.html +3 -2
- data/doc/files/lib/Scenario_rb.html +3 -2
- data/doc/files/lib/Scoreboard_rb.html +3 -2
- data/doc/files/lib/ShiftAssignments_rb.html +3 -2
- data/doc/files/lib/ShiftScenario_rb.html +3 -2
- data/doc/files/lib/Shift_rb.html +3 -2
- data/doc/files/lib/SourceFileInfo_rb.html +3 -2
- data/doc/files/lib/SyntaxReference_rb.html +3 -2
- data/doc/files/lib/TOCEntry_rb.html +3 -2
- data/doc/files/lib/TableColumnDefinition_rb.html +3 -2
- data/doc/files/lib/TableOfContents_rb.html +3 -2
- data/doc/files/lib/TaskDependency_rb.html +3 -2
- data/doc/files/lib/TaskJuggler_rb.html +7 -2
- data/doc/files/lib/TaskScenario_rb.html +3 -2
- data/doc/files/lib/Task_rb.html +3 -2
- data/doc/files/lib/TextParser/Pattern_rb.html +4 -3
- data/doc/files/lib/TextParser/Rule_rb.html +4 -3
- data/doc/files/lib/TextParser/StackElement_rb.html +4 -3
- data/doc/files/lib/TextParser/TokenDoc_rb.html +4 -3
- data/doc/files/lib/TextParser_rb.html +3 -2
- data/doc/files/lib/TextScanner_rb.html +3 -2
- data/doc/files/lib/Tj3Config_rb.html +3 -2
- data/doc/files/lib/TjException_rb.html +3 -2
- data/doc/files/lib/TjTime_rb.html +3 -2
- data/doc/files/lib/TjpExample_rb.html +3 -2
- data/doc/files/lib/TjpSyntaxRules_rb.html +3 -2
- data/doc/files/lib/UTF8String_rb.html +14 -6
- data/doc/files/lib/UserManual_rb.html +6 -3
- data/doc/files/lib/WorkingHours_rb.html +3 -2
- data/doc/files/lib/XMLDocument_rb.html +3 -2
- data/doc/files/lib/XMLElement_rb.html +3 -2
- data/doc/files/lib/deep_copy_rb.html +3 -2
- data/doc/files/lib/reports/CSVFile_rb.html +3 -2
- data/doc/files/lib/reports/ColumnTable_rb.html +3 -2
- data/doc/files/lib/reports/GanttChart_rb.html +3 -2
- data/doc/files/lib/reports/GanttContainer_rb.html +3 -2
- data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +3 -2
- data/doc/files/lib/reports/GanttHeader_rb.html +3 -2
- data/doc/files/lib/reports/GanttLine_rb.html +3 -2
- data/doc/files/lib/reports/GanttLoadStack_rb.html +3 -2
- data/doc/files/lib/reports/GanttMilestone_rb.html +3 -2
- data/doc/files/lib/reports/GanttRouter_rb.html +3 -2
- data/doc/files/lib/reports/GanttTaskBar_rb.html +3 -2
- data/doc/files/lib/reports/HTMLGraphics_rb.html +3 -2
- data/doc/files/lib/reports/Navigator_rb.html +3 -2
- data/doc/files/lib/reports/ReportBase_rb.html +3 -2
- data/doc/files/lib/reports/ReportContext_rb.html +3 -2
- data/doc/files/lib/reports/ReportTableCell_rb.html +3 -2
- data/doc/files/lib/reports/ReportTableColumn_rb.html +3 -2
- data/doc/files/lib/reports/ReportTableLegend_rb.html +3 -2
- data/doc/files/lib/reports/ReportTableLine_rb.html +3 -2
- data/doc/files/lib/reports/ReportTable_rb.html +3 -2
- data/doc/files/lib/reports/Report_rb.html +7 -2
- data/doc/files/lib/reports/ResourceListRE_rb.html +3 -2
- data/doc/files/lib/reports/TableReport_rb.html +3 -2
- data/doc/files/lib/reports/TaskListRE_rb.html +3 -2
- data/doc/files/lib/reports/TextReport_rb.html +4 -3
- data/doc/files/lib/reports/TimeSheetReport_rb.html +117 -0
- data/doc/files/lib/reports/TjpExportRE_rb.html +3 -2
- data/doc/files/lib/taskjuggler3_rb.html +94 -77
- data/doc/files/lib/tj3client_rb.html +280 -0
- data/doc/files/lib/tj3man_rb.html +10 -9
- data/doc/fr_class_index.html +27 -5
- data/doc/fr_file_index.html +15 -7
- data/doc/fr_method_index.html +1312 -1020
- data/examples/tutorial.tjp +113 -14
- data/gem_spec.rb +2 -1
- data/lib/Account.rb +1 -1
- data/lib/AccountScenario.rb +1 -1
- data/lib/Allocation.rb +1 -1
- data/lib/AppConfig.rb +23 -10
- data/lib/AttributeBase.rb +34 -6
- data/lib/AttributeDefinition.rb +1 -1
- data/lib/Attributes.rb +51 -16
- data/lib/BatchProcessor.rb +204 -77
- data/lib/Booking.rb +1 -1
- data/lib/Charge.rb +1 -1
- data/lib/ChargeSet.rb +1 -1
- data/lib/HTMLDocument.rb +2 -2
- data/lib/Interval.rb +1 -1
- data/lib/Journal.rb +231 -9
- data/lib/KeywordArray.rb +1 -1
- data/lib/KeywordDocumentation.rb +6 -4
- data/lib/Limits.rb +1 -1
- data/lib/Log.rb +8 -1
- data/lib/LogicalExpression.rb +14 -13
- data/lib/LogicalFunction.rb +88 -14
- data/lib/LogicalOperation.rb +124 -53
- data/lib/MacroParser.rb +1 -1
- data/lib/MacroTable.rb +2 -2
- data/lib/Message.rb +1 -1
- data/lib/MessageHandler.rb +7 -3
- data/lib/Project.rb +93 -14
- data/lib/ProjectFileParser.rb +30 -15
- data/lib/PropertyList.rb +103 -36
- data/lib/PropertySet.rb +22 -10
- data/lib/PropertyTreeNode.rb +120 -15
- data/lib/Query.rb +119 -48
- data/lib/{RTPNavigator.rb → RTFNavigator.rb} +11 -10
- data/lib/RTFQuery.rb +166 -0
- data/lib/{RTPReport.rb → RTFReport.rb} +11 -8
- data/lib/RealFormat.rb +1 -1
- data/lib/RemoteServiceManager.rb +80 -0
- data/lib/ReportServer.rb +66 -0
- data/lib/Resource.rb +1 -1
- data/lib/ResourceScenario.rb +48 -19
- data/lib/RichText.rb +98 -41
- data/lib/RichTextDocument.rb +10 -8
- data/lib/RichTextElement.rb +72 -28
- data/lib/{RichTextProtocolExample.rb → RichTextFunctionExample.rb} +8 -7
- data/lib/{RichTextProtocolHandler.rb → RichTextFunctionHandler.rb} +12 -14
- data/lib/RichTextParser.rb +6 -3
- data/lib/RichTextScanner.rb +91 -19
- data/lib/RichTextSnip.rb +8 -3
- data/lib/RichTextSyntaxRules.rb +103 -45
- data/lib/Scenario.rb +1 -1
- data/lib/ScenarioData.rb +2 -2
- data/lib/Scoreboard.rb +1 -1
- data/lib/Shift.rb +1 -1
- data/lib/ShiftAssignments.rb +1 -1
- data/lib/ShiftScenario.rb +1 -1
- data/lib/SourceFileInfo.rb +1 -1
- data/lib/SyntaxReference.rb +2 -2
- data/lib/TOCEntry.rb +1 -1
- data/lib/TableColumnDefinition.rb +59 -16
- data/lib/TableOfContents.rb +1 -1
- data/lib/Task.rb +1 -1
- data/lib/TaskDependency.rb +1 -1
- data/lib/TaskJuggler.rb +31 -8
- data/lib/TaskScenario.rb +165 -16
- data/lib/TextParser.rb +36 -22
- data/lib/TextParser/Pattern.rb +3 -3
- data/lib/TextParser/Rule.rb +2 -2
- data/lib/TextParser/StackElement.rb +4 -3
- data/lib/TextParser/TokenDoc.rb +2 -2
- data/lib/TextScanner.rb +52 -37
- data/lib/Tj3Config.rb +6 -5
- data/lib/TjException.rb +1 -1
- data/lib/TjTime.rb +12 -3
- data/lib/TjpExample.rb +1 -1
- data/lib/TjpSyntaxRules.rb +1044 -150
- data/lib/UTF8String.rb +2 -1
- data/lib/UserManual.rb +18 -70
- data/lib/WorkingHours.rb +3 -3
- data/lib/XMLDocument.rb +3 -2
- data/lib/XMLElement.rb +6 -1
- data/lib/deep_copy.rb +1 -1
- data/lib/reports/CSVFile.rb +1 -1
- data/lib/reports/ColumnTable.rb +9 -9
- data/lib/reports/GanttChart.rb +1 -1
- data/lib/reports/GanttContainer.rb +1 -1
- data/lib/reports/GanttHeader.rb +1 -1
- data/lib/reports/GanttHeaderScaleItem.rb +1 -1
- data/lib/reports/GanttLine.rb +40 -40
- data/lib/reports/GanttLoadStack.rb +1 -1
- data/lib/reports/GanttMilestone.rb +1 -1
- data/lib/reports/GanttRouter.rb +1 -1
- data/lib/reports/GanttTaskBar.rb +1 -1
- data/lib/reports/HTMLGraphics.rb +1 -1
- data/lib/reports/Navigator.rb +149 -22
- data/lib/reports/Report.rb +115 -172
- data/lib/reports/ReportBase.rb +22 -27
- data/lib/reports/ReportContext.rb +29 -15
- data/lib/reports/ReportTable.rb +1 -1
- data/lib/reports/ReportTableCell.rb +120 -27
- data/lib/reports/ReportTableColumn.rb +3 -3
- data/lib/reports/ReportTableLegend.rb +1 -1
- data/lib/reports/ReportTableLine.rb +10 -2
- data/lib/reports/ResourceListRE.rb +5 -1
- data/lib/reports/TableReport.rb +237 -287
- data/lib/reports/TaskListRE.rb +5 -1
- data/lib/reports/TextReport.rb +7 -4
- data/lib/reports/TimeSheetReport.rb +233 -0
- data/lib/reports/TjpExportRE.rb +2 -2
- data/lib/taskjuggler3.rb +27 -11
- data/lib/tj3client.rb +110 -0
- data/lib/tj3man.rb +4 -4
- data/manual/Getting_Started +0 -50
- data/manual/How_To_Contribute +6 -13
- data/manual/Installation +102 -28
- data/manual/Intro +11 -1
- data/manual/Reporting_Bugs +23 -7
- data/manual/Rich_Text_Attributes +59 -6
- data/manual/TaskJuggler_2x_Migration +27 -0
- data/manual/The_TaskJuggler_Syntax +104 -0
- data/manual/Tutorial +10 -9
- data/prj_cfg.rb +8 -2
- data/tasks/csts.rake +1 -1
- data/tasks/manual.rake +5 -3
- data/test/MessageChecker.rb +1 -1
- data/test/TestSuite/HTML-Reports/Alerts.html +172 -0
- data/test/TestSuite/HTML-Reports/Alerts.tjp +77 -0
- data/test/TestSuite/HTML-Reports/CellText.html +758 -0
- data/test/TestSuite/HTML-Reports/CellText.tjp +75 -0
- data/test/TestSuite/HTML-Reports/ColumnPeriods.html +156 -0
- data/test/TestSuite/HTML-Reports/ColumnPeriods.tjp +44 -0
- data/test/TestSuite/HTML-Reports/IsOngoing.html +172 -0
- data/test/TestSuite/HTML-Reports/IsOngoing.tjp +34 -0
- data/test/TestSuite/HTML-Reports/LogicalFunctions.html +80 -0
- data/test/TestSuite/HTML-Reports/LogicalFunctions.tjp +20 -0
- data/test/TestSuite/HTML-Reports/Query.html +31 -0
- data/test/TestSuite/HTML-Reports/Query.tjp +28 -0
- data/test/TestSuite/HTML-Reports/Sorting.tjp +68 -0
- data/test/TestSuite/HTML-Reports/TimeSheet.tjp +69 -0
- data/test/TestSuite/HTML-Reports/UDAQuery.tjp +27 -0
- data/test/TestSuite/HTML-Reports/css/tjmanual.css +52 -0
- data/test/TestSuite/HTML-Reports/css/tjreport.css +195 -0
- data/test/TestSuite/HTML-Reports/depArrows.html +842 -0
- data/test/TestSuite/HTML-Reports/icons/details.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/flag-green.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/flag-red.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/flag-yellow.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/resource.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/resourcegroup.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/task.png +0 -0
- data/test/TestSuite/HTML-Reports/icons/taskgroup.png +0 -0
- data/test/TestSuite/HTML-Reports/reference.tjp +7 -8
- data/test/TestSuite/HTML-Reports/scripts/scripts/wz_tooltip.js +1301 -0
- data/test/TestSuite/HTML-Reports/scripts/wz_tooltip.js +1301 -0
- data/test/TestSuite/Scheduler/Correct/Mandatory.tjp +34 -0
- data/test/TestSuite/Syntax/Correct/Celltext.tjp +2 -1
- data/test/TestSuite/Syntax/Correct/Journal.tjp +2 -2
- data/test/TestSuite/Syntax/Correct/LogicalExpression.tjp +2 -1
- data/test/TestSuite/Syntax/Correct/LogicalFunction.tjp +20 -0
- data/test/TestSuite/Syntax/Correct/Query.tjp +18 -0
- data/test/TestSuite/Syntax/Correct/StatusSheet.tjp +45 -0
- data/test/TestSuite/Syntax/Correct/TimeSheet.tjp +49 -0
- data/test/TestSuite/Syntax/Correct/icons/details.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/flag-green.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/flag-red.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/flag-yellow.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/resource.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/resourcegroup.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/task.png +0 -0
- data/test/TestSuite/Syntax/Correct/icons/taskgroup.png +0 -0
- data/test/TestSuite/Syntax/Correct/scripts/wz_tooltip.js +1301 -0
- data/test/TestSuite/Syntax/Correct/tutorial.tjp +113 -14
- data/test/TestSuite/Syntax/Errors/macro_stack_overflow.tjp +28 -0
- data/test/TestSuite/Syntax/Errors/unsupported_token.tjp +12 -0
- data/test/all.rb +2 -2
- data/test/test_BatchProcessor.rb +42 -13
- data/test/test_CSV-Reports.rb +1 -1
- data/test/test_Journal.rb +176 -0
- data/test/test_Limits.rb +1 -1
- data/test/test_LogicalExpression.rb +14 -5
- data/test/test_MacroTable.rb +1 -1
- data/test/test_Project.rb +1 -1
- data/test/test_PropertySet.rb +1 -1
- data/test/test_Query.rb +1 -1
- data/test/test_RealFormat.rb +1 -1
- data/test/test_RichText.rb +30 -20
- data/test/test_Scheduler.rb +1 -1
- data/test/test_ShiftAssignments.rb +2 -2
- data/test/test_Syntax.rb +1 -1
- data/test/test_TextScanner.rb +1 -1
- data/test/test_TjTime.rb +1 -1
- data/test/test_TjpExample.rb +1 -1
- data/test/test_UTF8String.rb +1 -1
- data/test/test_WorkingHours.rb +1 -1
- data/test/test_deep_copy.rb +2 -2
- metadata +610 -532
- data/doc/files/lib/ms_test_rb.html +0 -90
- data/examples/ContactList.html +0 -1467
- data/examples/Deliveries.html +0 -485
- data/examples/Development.html +0 -2525
- data/examples/Overview.html +0 -747
- data/examples/Resource Graph.html +0 -616
- data/lib/ms_test.rb +0 -27
- data/test/TestSuite/HTML-Reports/reference-export.html +0 -187
data/lib/KeywordArray.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = KeywordArray.rb -- The TaskJuggler III Project Management Software
|
|
5
5
|
#
|
|
6
|
-
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
|
|
7
7
|
#
|
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
|
9
9
|
# it under the terms of version 2 of the GNU General Public License as
|
data/lib/KeywordDocumentation.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = KeywordDocumentation.rb -- The TaskJuggler III Project Management Software
|
|
5
5
|
#
|
|
6
|
-
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
|
|
7
7
|
#
|
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
|
9
9
|
# it under the terms of version 2 of the GNU General Public License as
|
|
@@ -325,7 +325,8 @@ class TaskJuggler
|
|
|
325
325
|
tr1 << (td = XMLElement.new('td', 'width' => '30%'))
|
|
326
326
|
td << XMLText.new("#{arg.name} [")
|
|
327
327
|
td << XMLNamedText.new(
|
|
328
|
-
typeName, 'a', 'href' =>
|
|
328
|
+
typeName, 'a', 'href' =>
|
|
329
|
+
"The_TaskJuggler_Syntax.html\##{typeName}")
|
|
329
330
|
td << XMLText.new(']')
|
|
330
331
|
end
|
|
331
332
|
tr1 << (td = XMLElement.new('td',
|
|
@@ -563,13 +564,14 @@ class TaskJuggler
|
|
|
563
564
|
def newRichText(text)
|
|
564
565
|
begin
|
|
565
566
|
rText = RichText.new(text)
|
|
566
|
-
|
|
567
|
+
rti = rText.generateIntermediateFormat
|
|
568
|
+
@references += rti.internalReferences
|
|
567
569
|
rescue RichTextException => msg
|
|
568
570
|
$stderr.puts "Error in RichText of rule #{@keyword}\n" +
|
|
569
571
|
"Line #{msg.lineNo}: #{msg.text}\n" +
|
|
570
572
|
"#{msg.line}"
|
|
571
573
|
end
|
|
572
|
-
|
|
574
|
+
rti
|
|
573
575
|
end
|
|
574
576
|
|
|
575
577
|
# Utility function to turn a list of keywords into a comma separated list
|
data/lib/Limits.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = Limits.rb -- The TaskJuggler III Project Management Software
|
|
5
5
|
#
|
|
6
|
-
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
|
|
7
7
|
#
|
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
|
9
9
|
# it under the terms of version 2 of the GNU General Public License as
|
data/lib/Log.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = Log.rb -- The TaskJuggler III Project Management Software
|
|
5
5
|
#
|
|
6
|
-
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
|
|
7
7
|
#
|
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
|
9
9
|
# it under the terms of version 2 of the GNU General Public License as
|
|
@@ -101,6 +101,13 @@ class TaskJuggler
|
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
+
# Print out a status message unless we are in silent mode.
|
|
105
|
+
def Log.status(message)
|
|
106
|
+
return if @@silent
|
|
107
|
+
|
|
108
|
+
$stdout.puts message
|
|
109
|
+
end
|
|
110
|
+
|
|
104
111
|
# The progress meter can be a textual progress bar or some animated
|
|
105
112
|
# character sequence that informs the user about ongoing activities. Call
|
|
106
113
|
# this function to start the progress meter display or to change the info
|
data/lib/LogicalExpression.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = LogicalExpression.rb -- The TaskJuggler III Project Management Software
|
|
5
5
|
#
|
|
6
|
-
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
|
|
7
7
|
#
|
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
|
9
9
|
# it under the terms of version 2 of the GNU General Public License as
|
|
@@ -21,7 +21,7 @@ class TaskJuggler
|
|
|
21
21
|
# objects and the context that it should be evaluated in.
|
|
22
22
|
class LogicalExpression
|
|
23
23
|
|
|
24
|
-
attr_reader :
|
|
24
|
+
attr_reader :query, :sourceFileInfo
|
|
25
25
|
|
|
26
26
|
# Create a new LogicalExpression object. _op_ must be a LogicalOperation.
|
|
27
27
|
# _sourceFileInfo_ is the file position where expression started. It may be
|
|
@@ -30,17 +30,23 @@ class TaskJuggler
|
|
|
30
30
|
@operation = op
|
|
31
31
|
@sourceFileInfo = sourceFileInfo
|
|
32
32
|
|
|
33
|
-
@
|
|
33
|
+
@query = nil
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Switch the scopeProperty to property. We need this for the scopeProperty
|
|
37
|
+
# operating functions. The @scopeProperty is set to nil.
|
|
38
|
+
def flipProperties
|
|
39
|
+
@query.property, @query.scopeProperty = @query.scopeProperty, nil
|
|
34
40
|
end
|
|
35
41
|
|
|
36
42
|
# This function triggers the evaluation of the expression. _property_ is the
|
|
37
43
|
# PropertyTreeNode that should be used for the evaluation. _scopeProperty_
|
|
38
44
|
# is the PropertyTreeNode that describes the scope. It may be nil.
|
|
39
|
-
def eval(
|
|
40
|
-
@
|
|
41
|
-
@scopeProperty = scopeProperty
|
|
45
|
+
def eval(query)
|
|
46
|
+
@query = query
|
|
42
47
|
res = @operation.eval(self)
|
|
43
|
-
return res if res.class == TrueClass || res.class == FalseClass
|
|
48
|
+
return res if res.class == TrueClass || res.class == FalseClass ||
|
|
49
|
+
res.class == String
|
|
44
50
|
# In TJP syntax 'non 0' means false.
|
|
45
51
|
return res != 0
|
|
46
52
|
end
|
|
@@ -57,12 +63,7 @@ class TaskJuggler
|
|
|
57
63
|
# This is an internal function. It's called by the LogicalOperation methods
|
|
58
64
|
# in case something went wrong during an evaluation.
|
|
59
65
|
def error(text) # :nodoc:
|
|
60
|
-
|
|
61
|
-
str = "Logical expression error: " + text
|
|
62
|
-
else
|
|
63
|
-
str = "#{@sourceFileInfo} Logical expression error: #{text}\n"
|
|
64
|
-
end
|
|
65
|
-
raise TjException.new, str
|
|
66
|
+
raise TjException.new, "#{to_s}\nLogical expression error: #{text}"
|
|
66
67
|
end
|
|
67
68
|
|
|
68
69
|
end
|
data/lib/LogicalFunction.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = LogicalFunction.rb -- The TaskJuggler III Project Management Software
|
|
5
5
|
#
|
|
6
|
-
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
|
|
7
7
|
#
|
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
|
9
9
|
# it under the terms of version 2 of the GNU General Public License as
|
|
@@ -23,16 +23,26 @@ class TaskJuggler
|
|
|
23
23
|
# A map with the names of the supported functions and the number of
|
|
24
24
|
# arguments they require.
|
|
25
25
|
@@functions = {
|
|
26
|
+
'hasalert' => 1,
|
|
27
|
+
'isactive' => 1,
|
|
28
|
+
'isdependencyof' => 3,
|
|
26
29
|
'isdutyof' => 2,
|
|
27
30
|
'isleaf' => 0,
|
|
28
|
-
'
|
|
29
|
-
'
|
|
31
|
+
'isongoing' => 1,
|
|
32
|
+
'isresource' => 0,
|
|
33
|
+
'istask' => 0,
|
|
30
34
|
'treelevel' => 0
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
# Create a new LogicalFunction. _opnd_ is the name of the function.
|
|
34
38
|
def initialize(opnd)
|
|
35
|
-
|
|
39
|
+
if opnd[-1] == ?_
|
|
40
|
+
@name = opnd[0..-2]
|
|
41
|
+
@invertProperties = true
|
|
42
|
+
else
|
|
43
|
+
@name = opnd
|
|
44
|
+
@invertProperties = false
|
|
45
|
+
end
|
|
36
46
|
@arguments = []
|
|
37
47
|
end
|
|
38
48
|
|
|
@@ -56,8 +66,13 @@ class TaskJuggler
|
|
|
56
66
|
# Evaluate the function by calling it with the arguments.
|
|
57
67
|
def eval(expr)
|
|
58
68
|
args = []
|
|
69
|
+
if @invertProperties
|
|
70
|
+
return true unless expr.query.scopeProperty
|
|
71
|
+
expr = expr.dup
|
|
72
|
+
expr.flipProperties
|
|
73
|
+
end
|
|
59
74
|
# Call the function and return the result.
|
|
60
|
-
send(
|
|
75
|
+
send(name, expr, @arguments)
|
|
61
76
|
end
|
|
62
77
|
|
|
63
78
|
# Return a textual expression of the function call.
|
|
@@ -67,33 +82,92 @@ class TaskJuggler
|
|
|
67
82
|
|
|
68
83
|
private
|
|
69
84
|
|
|
85
|
+
def hasalert(expr, args)
|
|
86
|
+
query = expr.query
|
|
87
|
+
property = query.property
|
|
88
|
+
project = property.project
|
|
89
|
+
date = project.reportContext.report.get('end')
|
|
90
|
+
!project['journal'].currentEntries(query.end, property,
|
|
91
|
+
args[0], query.start).empty?
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def isactive(expr, args)
|
|
95
|
+
# The result can only be true when called for a Task property.
|
|
96
|
+
return false unless (property = expr.query.property).is_a?(Task) ||
|
|
97
|
+
property.is_a?(Resource)
|
|
98
|
+
scopeProperty = expr.query.scopeProperty
|
|
99
|
+
project = property.project
|
|
100
|
+
# 1st arg must be a scenario index.
|
|
101
|
+
if (scenarioIdx = project.scenarioIdx(args[0])).nil?
|
|
102
|
+
expr.error("Unknown scenario '#{args[0]}' used for function isactive()")
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
property.getAllocatedTime(scenarioIdx,
|
|
106
|
+
project.reportContext.report.get('start'),
|
|
107
|
+
project.reportContext.report.get('end'),
|
|
108
|
+
scopeProperty) > 0.0
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def isdependencyof(expr, args)
|
|
112
|
+
# The result can only be true when called for a Task property.
|
|
113
|
+
return false unless expr.query.property.is_a?(Task)
|
|
114
|
+
project = expr.query.property.project
|
|
115
|
+
# 1st arg must be a task ID.
|
|
116
|
+
return false if (task = project.task(args[0])).nil?
|
|
117
|
+
# 2nd arg must be a scenario index.
|
|
118
|
+
return false if (scenarioIdx = project.scenarioIdx(args[1])).nil?
|
|
119
|
+
# 3rd arg must be an integer number.
|
|
120
|
+
return false unless args[2].is_a?(Fixnum)
|
|
121
|
+
|
|
122
|
+
expr.query.property.isDependencyOf(scenarioIdx, task, args[2])
|
|
123
|
+
end
|
|
124
|
+
|
|
70
125
|
def isdutyof(expr, args)
|
|
71
126
|
# The result can only be true when called for a Task property.
|
|
72
|
-
return false unless expr.property.is_a?(Task)
|
|
73
|
-
project =
|
|
127
|
+
return false unless (task = expr.query.property).is_a?(Task)
|
|
128
|
+
project = task.project
|
|
74
129
|
# 1st arg must be a resource ID.
|
|
75
130
|
return false if (resource = project.resource(args[0])).nil?
|
|
76
131
|
# 2nd arg must be a scenario index.
|
|
77
132
|
return false if (scenarioIdx = project.scenarioIdx(args[1])).nil?
|
|
78
133
|
|
|
79
|
-
|
|
134
|
+
task['assignedresources', scenarioIdx].include?(resource)
|
|
80
135
|
end
|
|
81
136
|
|
|
82
137
|
def isleaf(expr, args)
|
|
83
|
-
expr.property.leaf?
|
|
138
|
+
expr.query.property.leaf?
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def isongoing(expr, args)
|
|
142
|
+
# The result can only be true when called for a Task property.
|
|
143
|
+
return false unless (task = expr.query.property).is_a?(Task)
|
|
144
|
+
project = task.project
|
|
145
|
+
# 1st arg must be a scenario index.
|
|
146
|
+
if (scenarioIdx = project.scenarioIdx(args[0])).nil?
|
|
147
|
+
expr.error("Unknown scenario '#{args[0]}' used for function isongoing()")
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
iv1 = Interval.new(project.reportContext.report.get('start'),
|
|
151
|
+
project.reportContext.report.get('end'))
|
|
152
|
+
tStart = task['start', scenarioIdx]
|
|
153
|
+
tEnd = task['end', scenarioIdx]
|
|
154
|
+
# This helps to show tasks with scheduling errors.
|
|
155
|
+
return true unless tStart && tEnd
|
|
156
|
+
iv2 = Interval.new(tStart, tEnd)
|
|
157
|
+
|
|
158
|
+
return iv1.overlaps?(iv2)
|
|
84
159
|
end
|
|
85
160
|
|
|
86
161
|
def isresource(expr, args)
|
|
87
|
-
expr.property.is_a?(Resource)
|
|
162
|
+
expr.query.property.is_a?(Resource)
|
|
88
163
|
end
|
|
89
164
|
|
|
90
|
-
def
|
|
91
|
-
|
|
92
|
-
false
|
|
165
|
+
def istask(expr, args)
|
|
166
|
+
expr.query.property.is_a?(Task)
|
|
93
167
|
end
|
|
94
168
|
|
|
95
169
|
def treelevel(expr, args)
|
|
96
|
-
expr.property.level + 1
|
|
170
|
+
expr.query.property.level + 1
|
|
97
171
|
end
|
|
98
172
|
|
|
99
173
|
end
|
data/lib/LogicalOperation.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# = LogicalOperation.rb -- The TaskJuggler III Project Management Software
|
|
5
5
|
#
|
|
6
|
-
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009, 2010 by Chris Schlaeger <cs@kde.org>
|
|
7
7
|
#
|
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
|
9
9
|
# it under the terms of version 2 of the GNU General Public License as
|
|
@@ -39,81 +39,134 @@ class TaskJuggler
|
|
|
39
39
|
# LogicalExpression. The result must be of a type that responds to all the
|
|
40
40
|
# operators of this function.
|
|
41
41
|
def eval(expr)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
case @operator
|
|
43
|
+
when nil
|
|
44
|
+
if @operand1.respond_to?(:eval)
|
|
45
|
+
# An operand can be a fixed value or another term. This could be a
|
|
46
|
+
# LogicalOperation, LogicalFunction or anything else that provides
|
|
47
|
+
# an appropriate eval() method.
|
|
48
|
+
return @operand1.eval(expr)
|
|
49
|
+
else
|
|
50
|
+
return @operand1
|
|
51
|
+
end
|
|
52
|
+
when '~'
|
|
53
|
+
return !coerceBoolean(@operand1.eval(expr), expr)
|
|
54
|
+
when '>', '>=', '=', '<', '<=', '!='
|
|
55
|
+
# Evaluate the operation for all 2 operand operations that can be
|
|
56
|
+
# either interpreted as date, numbers or Strings.
|
|
57
|
+
opnd1 = @operand1.eval(expr)
|
|
58
|
+
opnd2 = @operand2.eval(expr)
|
|
59
|
+
if opnd1.is_a?(TjTime)
|
|
60
|
+
res= evalBinaryOperation(opnd1, operator, opnd2) do |o|
|
|
61
|
+
coerceTime(o, expr)
|
|
62
|
+
end
|
|
63
|
+
return res
|
|
64
|
+
elsif opnd1.is_a?(Fixnum) || opnd1.is_a?(Float) || opnd1.is_a?(Bignum)
|
|
65
|
+
return evalBinaryOperation(opnd1, operator, opnd2) do |o|
|
|
66
|
+
coerceNumber(o, expr)
|
|
67
|
+
end
|
|
68
|
+
elsif opnd1.is_a?(String)
|
|
69
|
+
return evalBinaryOperation(opnd1, operator, opnd2) do |o|
|
|
70
|
+
coerceString(o, expr)
|
|
52
71
|
end
|
|
53
|
-
when '~'
|
|
54
|
-
return !coerceBoolean(@operand1.eval(expr))
|
|
55
|
-
when '>'
|
|
56
|
-
return coerceNumber(@operand1.eval(expr)) >
|
|
57
|
-
coerceNumber(@operand2.eval(expr))
|
|
58
|
-
when '>='
|
|
59
|
-
return coerceNumber(@operand1.eval(expr)) >=
|
|
60
|
-
coerceNumber(@operand2.eval(expr))
|
|
61
|
-
when '='
|
|
62
|
-
return coerceNumber(@operand1.eval(expr)) ==
|
|
63
|
-
coerceNumber(@operand2.eval(expr))
|
|
64
|
-
when '<'
|
|
65
|
-
return coerceNumber(@operand1.eval(expr)) <
|
|
66
|
-
coerceNumber(@operand2.eval(expr))
|
|
67
|
-
when '<='
|
|
68
|
-
return coerceNumber(@operand1.eval(expr)) <=
|
|
69
|
-
coerceNumber(@operand2.eval(expr))
|
|
70
|
-
when '&'
|
|
71
|
-
return coerceBoolean(@operand1.eval(expr)) &&
|
|
72
|
-
coerceBoolean(@operand2.eval(expr))
|
|
73
|
-
when '|'
|
|
74
|
-
return coerceBoolean(@operand1.eval(expr)) ||
|
|
75
|
-
coerceBoolean(@operand2.eval(expr))
|
|
76
72
|
else
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
expr.error("First operand of a binary operation must be a date, " +
|
|
74
|
+
"a number or a string: #{opnd1}")
|
|
79
75
|
end
|
|
80
|
-
|
|
81
|
-
expr
|
|
76
|
+
when '&'
|
|
77
|
+
return coerceBoolean(@operand1.eval(expr), expr) &&
|
|
78
|
+
coerceBoolean(@operand2.eval(expr), expr)
|
|
79
|
+
when '|'
|
|
80
|
+
return coerceBoolean(@operand1.eval(expr), expr) ||
|
|
81
|
+
coerceBoolean(@operand2.eval(expr), expr)
|
|
82
|
+
else
|
|
83
|
+
expr.error("Unknown operator #{@operator} in logical expression")
|
|
82
84
|
end
|
|
83
85
|
end
|
|
84
86
|
|
|
85
87
|
# Convert the operation into a textual representation. This function is used
|
|
86
88
|
# for error reporting and debugging.
|
|
87
|
-
def to_s
|
|
89
|
+
def to_s
|
|
88
90
|
if @operator.nil?
|
|
89
|
-
@operand1.to_s
|
|
91
|
+
"#{@operand1.to_s}"
|
|
90
92
|
elsif @operand2.nil?
|
|
91
|
-
"#{@operator}#{@operand1
|
|
93
|
+
"#{@operator}(#{@operand1.is_a?(String) ?
|
|
94
|
+
"'" + @operand1 + "'" : @operand1})"
|
|
92
95
|
else
|
|
93
|
-
"#{@operand1
|
|
96
|
+
"(#{@operand1.is_a?(String) ? "'" + @operand1 + "'" :
|
|
97
|
+
@operand1} #{@operator} #{
|
|
98
|
+
@operand2.is_a?(String) ? "'" + @operand2 + "'" : @operand2})"
|
|
94
99
|
end
|
|
95
100
|
end
|
|
96
101
|
|
|
97
102
|
private
|
|
98
103
|
|
|
104
|
+
# We need to do binary operator evaluation with various coerce functions.
|
|
105
|
+
# This function does the evaluation of _opnd1_ and _opnd2_ with the
|
|
106
|
+
# operation specified by _operator_. The operands are first coerced into
|
|
107
|
+
# the proper format by calling the block.
|
|
108
|
+
def evalBinaryOperation(opnd1, operator, opnd2)
|
|
109
|
+
case operator
|
|
110
|
+
when '>'
|
|
111
|
+
return yield(opnd1) > yield(opnd2)
|
|
112
|
+
when '>='
|
|
113
|
+
return yield(opnd1) >= yield(opnd2)
|
|
114
|
+
when '='
|
|
115
|
+
return yield(opnd1) == yield(opnd2)
|
|
116
|
+
when '<'
|
|
117
|
+
return yield(opnd1) < yield(opnd2)
|
|
118
|
+
when '<='
|
|
119
|
+
return yield(opnd1) <= yield(opnd2)
|
|
120
|
+
when '!='
|
|
121
|
+
return yield(opnd1) != yield(opnd2)
|
|
122
|
+
else
|
|
123
|
+
raise "Operator error"
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
99
127
|
# Force the _val_ into a boolean value.
|
|
100
|
-
def coerceBoolean(val)
|
|
128
|
+
def coerceBoolean(val, expr)
|
|
129
|
+
# First the obvious ones.
|
|
101
130
|
return val if val.class == TrueClass || val.class == FalseClass
|
|
131
|
+
# An empty String means false, else true.
|
|
132
|
+
return !val.empty if val.is_a?(String)
|
|
102
133
|
# In TJP logic 'non 0' means false.
|
|
103
|
-
val != 0
|
|
134
|
+
return val != 0 if val.is_a?(Fixnum) || val.is_a?(Bignum)
|
|
135
|
+
|
|
136
|
+
expr.error("Operand #{val} can't be evaluated to true or false.")
|
|
104
137
|
end
|
|
105
138
|
|
|
106
139
|
# Force the _val_ into a number. In case this fails, an exception is raised.
|
|
107
|
-
def coerceNumber(val)
|
|
140
|
+
def coerceNumber(val, expr)
|
|
108
141
|
unless val.is_a?(Fixnum) || val.is_a?(Float) || val.is_a?(Bignum)
|
|
109
|
-
|
|
110
|
-
|
|
142
|
+
expr.error("Operand #{val} of type #{val.class} must be a number.")
|
|
143
|
+
end
|
|
144
|
+
val
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Force the _val_ into a String. In case this fails, an exception is raised.
|
|
148
|
+
def coerceString(val, expr)
|
|
149
|
+
unless val.respond_to?('to_s')
|
|
150
|
+
expr.error("Operand #{val} of type #{val.class} can't be converted " +
|
|
151
|
+
"into a string")
|
|
152
|
+
end
|
|
153
|
+
val
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Force the _val_ into a String. In case this fails, an exception is raised.
|
|
157
|
+
def coerceTime(val, expr)
|
|
158
|
+
unless val.is_a?(TjTime)
|
|
159
|
+
expr.error("Operand #{val} of type #{val.class} can't be converted " +
|
|
160
|
+
"into a date")
|
|
111
161
|
end
|
|
112
162
|
val
|
|
113
163
|
end
|
|
114
164
|
|
|
115
165
|
end
|
|
116
166
|
|
|
167
|
+
# This class handles operands that are property attributes. They are
|
|
168
|
+
# addressed by attribute ID and scenario index. The expression provides the
|
|
169
|
+
# property reference.
|
|
117
170
|
class LogicalAttribute < LogicalOperation
|
|
118
171
|
|
|
119
172
|
def initialize(attribute, scenario)
|
|
@@ -121,27 +174,45 @@ class TaskJuggler
|
|
|
121
174
|
super
|
|
122
175
|
end
|
|
123
176
|
|
|
124
|
-
|
|
125
|
-
|
|
177
|
+
# To evaluate a property attribute we use the Query mechanism to retrieve
|
|
178
|
+
# the value.
|
|
179
|
+
def eval(expr)
|
|
180
|
+
query = expr.query
|
|
181
|
+
project = query.property.project
|
|
182
|
+
report = project.reportContext.report
|
|
183
|
+
query.scenarioIdx = @scenarioIdx
|
|
184
|
+
query.attributeId = @operand1
|
|
185
|
+
query.process
|
|
186
|
+
# The logical expressions are mostly about comparing values. So we use
|
|
187
|
+
# the sortableResult of the Query. This creates some challenges for load
|
|
188
|
+
# values, as the user is not accustomed to the internal representation
|
|
189
|
+
# of those.
|
|
190
|
+
# Convert nil results into empty Strings if necessary
|
|
191
|
+
query.result || ''
|
|
126
192
|
end
|
|
127
193
|
|
|
128
|
-
|
|
129
|
-
|
|
194
|
+
# Used for debugging and error reporting.
|
|
195
|
+
def to_s # :nodoc
|
|
196
|
+
"#{@scenarioIdx}.#{@operand1.to_s}"
|
|
130
197
|
end
|
|
131
198
|
|
|
132
199
|
end
|
|
133
200
|
|
|
201
|
+
# This class handles operands that represent flags. The operation evaluates
|
|
202
|
+
# to true if the property provided by the expression has the flag assigned.
|
|
134
203
|
class LogicalFlag < LogicalOperation
|
|
135
204
|
|
|
136
205
|
def initialize(opnd)
|
|
137
206
|
super
|
|
138
207
|
end
|
|
139
208
|
|
|
209
|
+
# Return true if the property has the flag assigned.
|
|
140
210
|
def eval(expr)
|
|
141
|
-
expr.property['flags', 0].include?(@operand1)
|
|
211
|
+
expr.query.property['flags', 0].include?(@operand1)
|
|
142
212
|
end
|
|
143
213
|
|
|
144
|
-
|
|
214
|
+
# Used for debugging and error reporting.
|
|
215
|
+
def to_s # :nodoc:
|
|
145
216
|
@operand1
|
|
146
217
|
end
|
|
147
218
|
|