taskjuggler 0.0.2 → 0.0.3

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.
Files changed (432) hide show
  1. data/Rakefile +1 -0
  2. data/benchmarks/depends.tjp +2 -1
  3. data/benchmarks/htmltaskreport.tjp +2 -1
  4. data/doc/classes/AppConfig.html +124 -120
  5. data/doc/classes/Arguments.html +10 -6
  6. data/doc/classes/Object.html +229 -0
  7. data/doc/classes/String.html +35 -31
  8. data/doc/classes/TaskJuggler/Account.html +18 -18
  9. data/doc/classes/TaskJuggler/AccountAttribute.html +261 -0
  10. data/doc/classes/TaskJuggler/AccountScenario.html +12 -12
  11. data/doc/classes/TaskJuggler/Allocation.html +34 -30
  12. data/doc/classes/TaskJuggler/AllocationAttribute.html +70 -70
  13. data/doc/classes/TaskJuggler/AttributeBase.html +131 -147
  14. data/doc/classes/TaskJuggler/AttributeDefinition.html +38 -21
  15. data/doc/classes/TaskJuggler/BatchProcessor.html +313 -0
  16. data/doc/classes/TaskJuggler/Booking.html +22 -18
  17. data/doc/classes/TaskJuggler/BookingListAttribute.html +42 -42
  18. data/doc/classes/TaskJuggler/BooleanAttribute.html +40 -40
  19. data/doc/classes/TaskJuggler/CSVFile.html +28 -24
  20. data/doc/classes/TaskJuggler/Charge.html +22 -18
  21. data/doc/classes/TaskJuggler/ChargeListAttribute.html +30 -30
  22. data/doc/classes/TaskJuggler/ChargeSet.html +41 -37
  23. data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +46 -46
  24. data/doc/classes/TaskJuggler/ColumnListAttribute.html +231 -0
  25. data/doc/classes/TaskJuggler/ColumnTable.html +23 -21
  26. data/doc/classes/TaskJuggler/DateAttribute.html +20 -20
  27. data/doc/classes/TaskJuggler/DefinitionListAttribute.html +162 -0
  28. data/doc/classes/TaskJuggler/DependencyListAttribute.html +46 -46
  29. data/doc/classes/TaskJuggler/DurationAttribute.html +30 -30
  30. data/doc/classes/TaskJuggler/FixnumAttribute.html +20 -20
  31. data/doc/classes/TaskJuggler/FlagListAttribute.html +42 -42
  32. data/doc/classes/TaskJuggler/FloatAttribute.html +30 -30
  33. data/doc/classes/TaskJuggler/FormatListAttribute.html +197 -0
  34. data/doc/classes/TaskJuggler/GanttChart.html +236 -207
  35. data/doc/classes/TaskJuggler/GanttContainer.html +46 -42
  36. data/doc/classes/TaskJuggler/GanttHeader.html +16 -12
  37. data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +16 -12
  38. data/doc/classes/TaskJuggler/GanttLine.html +28 -24
  39. data/doc/classes/TaskJuggler/GanttLoadStack.html +22 -18
  40. data/doc/classes/TaskJuggler/GanttMilestone.html +46 -42
  41. data/doc/classes/TaskJuggler/GanttRouter.html +104 -98
  42. data/doc/classes/TaskJuggler/GanttTaskBar.html +46 -42
  43. data/doc/classes/TaskJuggler/HTMLDocument.html +12 -12
  44. data/doc/classes/TaskJuggler/HTMLGraphics.html +12 -12
  45. data/doc/classes/TaskJuggler/Interval.html +126 -120
  46. data/doc/classes/TaskJuggler/IntervalListAttribute.html +46 -46
  47. data/doc/classes/TaskJuggler/JobInfo.html +284 -0
  48. data/doc/classes/TaskJuggler/Journal.html +197 -0
  49. data/doc/classes/TaskJuggler/JournalEntry.html +218 -0
  50. data/doc/classes/TaskJuggler/KeywordArray.html +179 -0
  51. data/doc/classes/TaskJuggler/KeywordDocumentation.html +445 -396
  52. data/doc/classes/TaskJuggler/Limits/Limit.html +34 -30
  53. data/doc/classes/TaskJuggler/Limits.html +68 -62
  54. data/doc/classes/TaskJuggler/LimitsAttribute.html +40 -40
  55. data/doc/classes/TaskJuggler/ListAttributeBase.html +207 -0
  56. data/doc/classes/TaskJuggler/Log.html +72 -68
  57. data/doc/classes/TaskJuggler/LogicalAttribute.html +38 -34
  58. data/doc/classes/TaskJuggler/LogicalExpression.html +16 -12
  59. data/doc/classes/TaskJuggler/LogicalExpressionAttribute.html +194 -0
  60. data/doc/classes/TaskJuggler/LogicalFlag.html +32 -32
  61. data/doc/classes/TaskJuggler/LogicalFunction.html +28 -24
  62. data/doc/classes/TaskJuggler/LogicalOperation.html +17 -13
  63. data/doc/classes/TaskJuggler/Macro.html +10 -6
  64. data/doc/classes/TaskJuggler/MacroParser.html +36 -36
  65. data/doc/classes/TaskJuggler/MacroTable.html +40 -36
  66. data/doc/classes/TaskJuggler/Message.html +16 -12
  67. data/doc/classes/TaskJuggler/MessageHandler.html +16 -12
  68. data/doc/classes/TaskJuggler/Navigator.html +249 -0
  69. data/doc/classes/TaskJuggler/OnShiftCache.html +316 -0
  70. data/doc/classes/TaskJuggler/Project.html +1064 -678
  71. data/doc/classes/TaskJuggler/ProjectFileParser.html +90 -85
  72. data/doc/classes/TaskJuggler/PropertyAttribute.html +194 -0
  73. data/doc/classes/TaskJuggler/PropertyList.html +114 -113
  74. data/doc/classes/TaskJuggler/PropertySet.html +355 -312
  75. data/doc/classes/TaskJuggler/PropertyTreeNode.html +527 -474
  76. data/doc/classes/TaskJuggler/Query.html +90 -85
  77. data/doc/classes/TaskJuggler/RTPNavigator.html +292 -0
  78. data/doc/classes/TaskJuggler/RTPReport.html +301 -0
  79. data/doc/classes/TaskJuggler/RealFormat.html +114 -57
  80. data/doc/classes/TaskJuggler/RealFormatAttribute.html +162 -0
  81. data/doc/classes/TaskJuggler/ReferenceAttribute.html +87 -20
  82. data/doc/classes/TaskJuggler/Report.html +82 -291
  83. data/doc/classes/TaskJuggler/ReportBase.html +448 -0
  84. data/doc/classes/TaskJuggler/ReportContext.html +243 -0
  85. data/doc/classes/TaskJuggler/ReportTable.html +158 -129
  86. data/doc/classes/TaskJuggler/ReportTableCell.html +30 -26
  87. data/doc/classes/TaskJuggler/ReportTableColumn.html +29 -25
  88. data/doc/classes/TaskJuggler/ReportTableLegend.html +28 -24
  89. data/doc/classes/TaskJuggler/ReportTableLine.html +34 -30
  90. data/doc/classes/TaskJuggler/Resource.html +12 -12
  91. data/doc/classes/TaskJuggler/ResourceListAttribute.html +46 -46
  92. data/doc/classes/TaskJuggler/ResourceListRE.html +49 -57
  93. data/doc/classes/TaskJuggler/ResourceScenario.html +126 -126
  94. data/doc/classes/TaskJuggler/RichText.html +52 -48
  95. data/doc/classes/TaskJuggler/RichTextAttribute.html +30 -30
  96. data/doc/classes/TaskJuggler/RichTextDocument.html +41 -37
  97. data/doc/classes/TaskJuggler/RichTextElement.html +274 -264
  98. data/doc/classes/TaskJuggler/RichTextException.html +13 -13
  99. data/doc/classes/TaskJuggler/RichTextParser.html +48 -47
  100. data/doc/classes/TaskJuggler/RichTextProtocolExample.html +52 -55
  101. data/doc/classes/TaskJuggler/RichTextProtocolHandler.html +55 -10
  102. data/doc/classes/TaskJuggler/RichTextScanner.html +106 -245
  103. data/doc/classes/TaskJuggler/RichTextSnip.html +28 -24
  104. data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +381 -301
  105. data/doc/classes/TaskJuggler/Scenario.html +6 -6
  106. data/doc/classes/TaskJuggler/ScenarioData.html +40 -36
  107. data/doc/classes/TaskJuggler/ScenarioListAttribute.html +229 -0
  108. data/doc/classes/TaskJuggler/Scoreboard.html +70 -66
  109. data/doc/classes/TaskJuggler/Shift.html +18 -18
  110. data/doc/classes/TaskJuggler/ShiftAssignment.html +58 -54
  111. data/doc/classes/TaskJuggler/ShiftAssignments.html +82 -78
  112. data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +40 -40
  113. data/doc/classes/TaskJuggler/ShiftScenario.html +24 -24
  114. data/doc/classes/TaskJuggler/SortListAttribute.html +196 -0
  115. data/doc/classes/TaskJuggler/SourceFileInfo.html +16 -12
  116. data/doc/classes/TaskJuggler/StringAttribute.html +30 -30
  117. data/doc/classes/TaskJuggler/SymbolAttribute.html +20 -20
  118. data/doc/classes/TaskJuggler/SyntaxReference.html +46 -42
  119. data/doc/classes/TaskJuggler/TOCEntry.html +16 -12
  120. data/doc/classes/TaskJuggler/TableColumnDefinition.html +48 -33
  121. data/doc/classes/TaskJuggler/TableOfContents.html +22 -18
  122. data/doc/classes/TaskJuggler/TableReport.html +1036 -0
  123. data/doc/classes/TaskJuggler/Task.html +12 -12
  124. data/doc/classes/TaskJuggler/TaskDependency.html +16 -12
  125. data/doc/classes/TaskJuggler/TaskListAttribute.html +46 -46
  126. data/doc/classes/TaskJuggler/TaskListRE.html +49 -58
  127. data/doc/classes/TaskJuggler/TaskScenario.html +1270 -1180
  128. data/doc/classes/TaskJuggler/TextParser/Pattern.html +100 -96
  129. data/doc/classes/TaskJuggler/TextParser/Rule.html +88 -84
  130. data/doc/classes/TaskJuggler/TextParser/StackElement.html +16 -12
  131. data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +12 -12
  132. data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +10 -6
  133. data/doc/classes/TaskJuggler/TextParser.html +203 -140
  134. data/doc/classes/TaskJuggler/TextReport.html +364 -0
  135. data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +70 -70
  136. data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +50 -42
  137. data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +16 -12
  138. data/doc/classes/TaskJuggler/TextScanner.html +334 -240
  139. data/doc/classes/TaskJuggler/TjException.html +6 -6
  140. data/doc/classes/TaskJuggler/TjTime.html +547 -497
  141. data/doc/classes/TaskJuggler/TjpExample.html +29 -25
  142. data/doc/classes/TaskJuggler/TjpExportRE.html +77 -97
  143. data/doc/classes/TaskJuggler/TjpSyntaxRules.html +3911 -3886
  144. data/doc/classes/TaskJuggler/UserManual.html +54 -54
  145. data/doc/classes/TaskJuggler/WorkingHours.html +53 -49
  146. data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +53 -85
  147. data/doc/classes/TaskJuggler/XMLBlob.html +21 -21
  148. data/doc/classes/TaskJuggler/XMLComment.html +21 -21
  149. data/doc/classes/TaskJuggler/XMLDocument.html +28 -24
  150. data/doc/classes/TaskJuggler/XMLElement.html +70 -58
  151. data/doc/classes/TaskJuggler/XMLNamedText.html +11 -11
  152. data/doc/classes/TaskJuggler/XMLText.html +36 -36
  153. data/doc/classes/TaskJuggler.html +266 -183
  154. data/doc/files/COPYING.html +1 -1
  155. data/doc/files/README.html +1 -1
  156. data/doc/files/lib/AccountScenario_rb.html +1 -1
  157. data/doc/files/lib/Account_rb.html +1 -1
  158. data/doc/files/lib/Allocation_rb.html +1 -1
  159. data/doc/files/lib/AppConfig_rb.html +1 -1
  160. data/doc/files/lib/AttributeBase_rb.html +11 -1
  161. data/doc/files/lib/AttributeDefinition_rb.html +1 -1
  162. data/doc/files/lib/Attributes_rb.html +1 -1
  163. data/doc/files/lib/{LogicalFlag_rb.html → BatchProcessor_rb.html} +8 -6
  164. data/doc/files/lib/Booking_rb.html +1 -1
  165. data/doc/files/lib/ChargeSet_rb.html +1 -1
  166. data/doc/files/lib/Charge_rb.html +1 -1
  167. data/doc/files/lib/HTMLDocument_rb.html +1 -1
  168. data/doc/files/lib/Interval_rb.html +1 -1
  169. data/doc/files/lib/Journal_rb.html +106 -0
  170. data/doc/files/lib/KeywordArray_rb.html +106 -0
  171. data/doc/files/lib/KeywordDocumentation_rb.html +1 -1
  172. data/doc/files/lib/Limits_rb.html +1 -1
  173. data/doc/files/lib/Log_rb.html +1 -1
  174. data/doc/files/lib/LogicalExpression_rb.html +1 -3
  175. data/doc/files/lib/LogicalFunction_rb.html +1 -1
  176. data/doc/files/lib/LogicalOperation_rb.html +1 -1
  177. data/doc/files/lib/MacroParser_rb.html +1 -1
  178. data/doc/files/lib/MacroTable_rb.html +1 -1
  179. data/doc/files/lib/MessageHandler_rb.html +1 -1
  180. data/doc/files/lib/Message_rb.html +1 -1
  181. data/doc/files/lib/ProjectFileParser_rb.html +5 -1
  182. data/doc/files/lib/Project_rb.html +5 -1
  183. data/doc/files/lib/PropertyList_rb.html +1 -1
  184. data/doc/files/lib/PropertySet_rb.html +1 -1
  185. data/doc/files/lib/PropertyTreeNode_rb.html +1 -1
  186. data/doc/files/lib/Query_rb.html +1 -1
  187. data/doc/files/lib/RTPNavigator_rb.html +120 -0
  188. data/doc/files/lib/RTPReport_rb.html +118 -0
  189. data/doc/files/lib/RealFormat_rb.html +1 -1
  190. data/doc/files/lib/ResourceScenario_rb.html +1 -1
  191. data/doc/files/lib/Resource_rb.html +1 -1
  192. data/doc/files/lib/RichTextDocument_rb.html +1 -1
  193. data/doc/files/lib/RichTextElement_rb.html +1 -1
  194. data/doc/files/lib/RichTextParser_rb.html +1 -1
  195. data/doc/files/lib/RichTextProtocolExample_rb.html +1 -1
  196. data/doc/files/lib/RichTextProtocolHandler_rb.html +1 -1
  197. data/doc/files/lib/RichTextScanner_rb.html +1 -1
  198. data/doc/files/lib/RichTextSnip_rb.html +1 -1
  199. data/doc/files/lib/RichTextSyntaxRules_rb.html +1 -1
  200. data/doc/files/lib/RichText_rb.html +1 -1
  201. data/doc/files/lib/ScenarioData_rb.html +1 -1
  202. data/doc/files/lib/Scenario_rb.html +1 -1
  203. data/doc/files/lib/Scoreboard_rb.html +1 -1
  204. data/doc/files/lib/ShiftAssignments_rb.html +1 -1
  205. data/doc/files/lib/ShiftScenario_rb.html +1 -1
  206. data/doc/files/lib/Shift_rb.html +1 -1
  207. data/doc/files/lib/SourceFileInfo_rb.html +1 -1
  208. data/doc/files/lib/SyntaxReference_rb.html +1 -1
  209. data/doc/files/lib/TOCEntry_rb.html +1 -1
  210. data/doc/files/lib/TableColumnDefinition_rb.html +1 -1
  211. data/doc/files/lib/TableOfContents_rb.html +1 -1
  212. data/doc/files/lib/TaskDependency_rb.html +1 -1
  213. data/doc/files/lib/TaskJuggler_rb.html +1 -1
  214. data/doc/files/lib/TaskScenario_rb.html +1 -1
  215. data/doc/files/lib/Task_rb.html +1 -1
  216. data/doc/files/lib/TextParser/Pattern_rb.html +1 -1
  217. data/doc/files/lib/TextParser/Rule_rb.html +1 -1
  218. data/doc/files/lib/TextParser/StackElement_rb.html +1 -1
  219. data/doc/files/lib/TextParser/TokenDoc_rb.html +1 -1
  220. data/doc/files/lib/TextParser_rb.html +1 -1
  221. data/doc/files/lib/TextScanner_rb.html +1 -1
  222. data/doc/files/lib/Tj3Config_rb.html +1 -1
  223. data/doc/files/lib/TjException_rb.html +1 -1
  224. data/doc/files/lib/TjTime_rb.html +1 -1
  225. data/doc/files/lib/TjpExample_rb.html +1 -1
  226. data/doc/files/lib/TjpSyntaxRules_rb.html +1 -1
  227. data/doc/files/lib/UTF8String_rb.html +1 -1
  228. data/doc/files/lib/UserManual_rb.html +1 -1
  229. data/doc/files/lib/WorkingHours_rb.html +1 -1
  230. data/doc/files/lib/XMLDocument_rb.html +1 -1
  231. data/doc/files/lib/XMLElement_rb.html +1 -1
  232. data/doc/files/lib/deep_copy_rb.html +106 -0
  233. data/doc/files/lib/ms_test_rb.html +90 -0
  234. data/doc/files/lib/reports/CSVFile_rb.html +1 -1
  235. data/doc/files/lib/reports/ColumnTable_rb.html +1 -1
  236. data/doc/files/lib/reports/GanttChart_rb.html +1 -1
  237. data/doc/files/lib/reports/GanttContainer_rb.html +1 -1
  238. data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +1 -1
  239. data/doc/files/lib/reports/GanttHeader_rb.html +1 -1
  240. data/doc/files/lib/reports/GanttLine_rb.html +1 -1
  241. data/doc/files/lib/reports/GanttLoadStack_rb.html +1 -1
  242. data/doc/files/lib/reports/GanttMilestone_rb.html +1 -1
  243. data/doc/files/lib/reports/GanttRouter_rb.html +1 -1
  244. data/doc/files/lib/reports/GanttTaskBar_rb.html +1 -1
  245. data/doc/files/lib/reports/HTMLGraphics_rb.html +1 -1
  246. data/doc/files/lib/reports/{ReportElement_rb.html → Navigator_rb.html} +6 -8
  247. data/doc/files/lib/reports/ReportBase_rb.html +106 -0
  248. data/doc/files/lib/reports/ReportContext_rb.html +106 -0
  249. data/doc/files/lib/reports/ReportTableCell_rb.html +1 -1
  250. data/doc/files/lib/reports/ReportTableColumn_rb.html +1 -1
  251. data/doc/files/lib/reports/ReportTableLegend_rb.html +1 -1
  252. data/doc/files/lib/reports/ReportTableLine_rb.html +1 -1
  253. data/doc/files/lib/reports/ReportTable_rb.html +1 -1
  254. data/doc/files/lib/reports/Report_rb.html +8 -2
  255. data/doc/files/lib/reports/ResourceListRE_rb.html +2 -2
  256. data/doc/files/lib/reports/{ReportTableElement_rb.html → TableReport_rb.html} +7 -5
  257. data/doc/files/lib/reports/TaskListRE_rb.html +2 -2
  258. data/doc/files/lib/reports/TextReport_rb.html +116 -0
  259. data/doc/files/lib/reports/TjpExportRE_rb.html +2 -2
  260. data/doc/files/lib/taskjuggler3_rb.html +61 -56
  261. data/doc/files/lib/tj3man_rb.html +1 -1
  262. data/doc/fr_class_index.html +41 -3
  263. data/doc/fr_file_index.html +21 -5
  264. data/doc/fr_method_index.html +1069 -959
  265. data/examples/ContactList.html +1467 -0
  266. data/examples/Deliveries.html +485 -0
  267. data/examples/Development.html +2525 -0
  268. data/examples/Overview.html +747 -0
  269. data/examples/Resource Graph.html +616 -0
  270. data/examples/tutorial.tjp +63 -67
  271. data/lib/AttributeBase.rb +27 -31
  272. data/lib/AttributeDefinition.rb +12 -7
  273. data/lib/Attributes.rb +134 -34
  274. data/lib/Interval.rb +2 -0
  275. data/lib/Journal.rb +44 -0
  276. data/lib/{LogicalFlag.rb → KeywordArray.rb} +5 -13
  277. data/lib/KeywordDocumentation.rb +84 -47
  278. data/lib/Limits.rb +7 -5
  279. data/lib/LogicalExpression.rb +1 -1
  280. data/lib/LogicalOperation.rb +33 -0
  281. data/lib/Project.rb +313 -99
  282. data/lib/ProjectFileParser.rb +88 -11
  283. data/lib/PropertyList.rb +2 -1
  284. data/lib/PropertySet.rb +13 -4
  285. data/lib/PropertyTreeNode.rb +34 -15
  286. data/lib/Query.rb +2 -1
  287. data/lib/RTPNavigator.rb +53 -0
  288. data/lib/RTPReport.rb +62 -0
  289. data/lib/RealFormat.rb +28 -10
  290. data/lib/RichTextElement.rb +18 -12
  291. data/lib/RichTextParser.rb +1 -0
  292. data/lib/RichTextProtocolExample.rb +8 -11
  293. data/lib/RichTextProtocolHandler.rb +11 -1
  294. data/lib/RichTextScanner.rb +308 -164
  295. data/lib/RichTextSyntaxRules.rb +24 -0
  296. data/lib/TableColumnDefinition.rb +5 -1
  297. data/lib/TaskJuggler.rb +3 -2
  298. data/lib/TaskScenario.rb +123 -31
  299. data/lib/TextParser.rb +14 -3
  300. data/lib/TextScanner.rb +210 -34
  301. data/lib/Tj3Config.rb +1 -1
  302. data/lib/TjTime.rb +15 -0
  303. data/lib/TjpExample.rb +1 -1
  304. data/lib/TjpSyntaxRules.rb +674 -473
  305. data/lib/WorkingHours.rb +1 -1
  306. data/lib/XMLElement.rb +11 -3
  307. data/lib/deep_copy.rb +72 -0
  308. data/lib/ms_test.rb +27 -0
  309. data/lib/reports/ColumnTable.rb +7 -5
  310. data/lib/reports/GanttChart.rb +60 -34
  311. data/lib/reports/GanttHeader.rb +1 -1
  312. data/lib/reports/GanttRouter.rb +7 -5
  313. data/lib/reports/Navigator.rb +72 -0
  314. data/lib/reports/Report.rb +58 -73
  315. data/lib/reports/ReportBase.rb +241 -0
  316. data/lib/reports/ReportContext.rb +41 -0
  317. data/lib/reports/ReportTable.rb +7 -2
  318. data/lib/reports/ReportTableCell.rb +3 -3
  319. data/lib/reports/ResourceListRE.rb +19 -26
  320. data/lib/reports/{ReportTableElement.rb → TableReport.rb} +297 -97
  321. data/lib/reports/TaskListRE.rb +16 -24
  322. data/lib/reports/TextReport.rb +87 -0
  323. data/lib/reports/TjpExportRE.rb +55 -50
  324. data/lib/taskjuggler3.rb +6 -1
  325. data/manual/Getting_Started +57 -6
  326. data/manual/How_To_Contribute +2 -4
  327. data/manual/Intro +2 -2
  328. data/manual/Reporting_Bugs +9 -2
  329. data/manual/Rich_Text_Attributes +41 -0
  330. data/manual/Tutorial +219 -173
  331. data/tasks/test.rake +3 -0
  332. data/test/TestSuite/CSV-Reports/celltext.tjp +2 -1
  333. data/test/TestSuite/CSV-Reports/resourcereport.tjp +2 -1
  334. data/test/TestSuite/CSV-Reports/resourcereport_with_tasks.tjp +2 -1
  335. data/test/TestSuite/CSV-Reports/sortByTree.tjp +2 -1
  336. data/test/TestSuite/CSV-Reports/sortBy_duration.down.tjp +2 -1
  337. data/test/TestSuite/CSV-Reports/sortBy_effort.up.tjp +2 -1
  338. data/test/TestSuite/CSV-Reports/sortBy_plan.start.down.tjp +2 -1
  339. data/test/TestSuite/CSV-Reports/taskreport.tjp +2 -1
  340. data/test/TestSuite/CSV-Reports/taskreport_with_resources.tjp +2 -1
  341. data/test/TestSuite/HTML-Reports/depArrows.tjp +72 -0
  342. data/test/TestSuite/HTML-Reports/reference-export.html +187 -0
  343. data/test/TestSuite/HTML-Reports/reference.tjp +21 -0
  344. data/test/TestSuite/Scheduler/Correct/Allocate.tjp +2 -1
  345. data/test/TestSuite/Scheduler/Correct/AutomaticMilestones.tjp +3 -3
  346. data/test/TestSuite/Scheduler/Correct/Booking.tjp +3 -3
  347. data/test/TestSuite/Scheduler/Correct/Container-2.tjp +37 -0
  348. data/test/TestSuite/Scheduler/Correct/Container.tjp +40 -0
  349. data/test/TestSuite/Scheduler/Correct/Depends.tjp +9 -14
  350. data/test/TestSuite/Scheduler/Correct/Duration.tjp +2 -1
  351. data/test/TestSuite/Scheduler/Correct/InheritStartEnd.tjp +20 -29
  352. data/test/TestSuite/Scheduler/Correct/Limits.tjp +11 -13
  353. data/test/TestSuite/Scheduler/Correct/Optimize-1.tjp +6 -5
  354. data/test/TestSuite/Scheduler/Correct/Optimize-2.tjp +10 -6
  355. data/test/TestSuite/Scheduler/Correct/Optimize-3.tjp +9 -6
  356. data/test/TestSuite/Scheduler/Correct/Optimize-4.tjp +9 -6
  357. data/test/TestSuite/Scheduler/Correct/Optimize-5.tjp +13 -10
  358. data/test/TestSuite/Scheduler/Correct/Precedes.tjp +9 -14
  359. data/test/TestSuite/Scheduler/Correct/Shift.tjp +9 -8
  360. data/test/TestSuite/Scheduler/Correct/checks.tji +4 -0
  361. data/test/TestSuite/Scheduler/Errors/weak_end_dep.tjp +16 -0
  362. data/test/TestSuite/Scheduler/Errors/weak_start_dep.tjp +16 -0
  363. data/test/TestSuite/Syntax/Correct/Account.tjp +1 -1
  364. data/test/TestSuite/Syntax/Correct/AutoID.tjp +21 -0
  365. data/test/TestSuite/Syntax/Correct/AutoMacros.tjp +2 -1
  366. data/test/TestSuite/Syntax/Correct/Caption.tjp +7 -6
  367. data/test/TestSuite/Syntax/Correct/Celltext.tjp +7 -4
  368. data/test/TestSuite/Syntax/Correct/Comments.tjp +1 -1
  369. data/test/TestSuite/Syntax/Correct/CompletedWork.tji +11 -19
  370. data/test/TestSuite/Syntax/Correct/CriticalPath.tjp +4 -3
  371. data/test/TestSuite/Syntax/Correct/Export.tjp +3 -1
  372. data/test/TestSuite/Syntax/Correct/Flags.tjp +2 -1
  373. data/test/TestSuite/Syntax/Correct/HtmlTaskReport.tjp +2 -1
  374. data/test/TestSuite/Syntax/Correct/Journal.tjp +18 -0
  375. data/test/TestSuite/Syntax/Correct/LoadUnits.tjp +2 -1
  376. data/test/TestSuite/Syntax/Correct/LogicalExpression.tjp +16 -0
  377. data/test/TestSuite/Syntax/Correct/Period.tjp +2 -1
  378. data/test/TestSuite/Syntax/Correct/RawHTML.tjp +4 -2
  379. data/test/TestSuite/Syntax/Correct/Reports.tjp +4 -2
  380. data/test/TestSuite/Syntax/Correct/ResourcePrefix.tji +2 -0
  381. data/test/TestSuite/Syntax/Correct/ResourcePrefix.tjp +23 -0
  382. data/test/TestSuite/Syntax/Correct/Responsible.tjp +1 -1
  383. data/test/TestSuite/Syntax/Correct/Simple.tjp +1 -1
  384. data/test/TestSuite/Syntax/Correct/String.tjp +1 -1
  385. data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +2 -1
  386. data/test/TestSuite/Syntax/Correct/tutorial.tjp +92 -70
  387. data/test/TestSuite/Syntax/Errors/bad_comment.tjp +7 -0
  388. data/test/TestSuite/Syntax/Errors/bad_include.tjp +1 -1
  389. data/test/TestSuite/Syntax/Errors/bad_time_zone.tjp +6 -0
  390. data/test/TestSuite/Syntax/Errors/bad_timing_res.tjp +5 -0
  391. data/test/TestSuite/Syntax/Errors/chargeset_master.tjp +1 -1
  392. data/test/TestSuite/Syntax/Errors/container_attribute.tjp +1 -1
  393. data/test/TestSuite/Syntax/Errors/cost_acct_no_top.tjp +3 -2
  394. data/test/TestSuite/Syntax/Errors/cost_rev_same.tjp +1 -1
  395. data/test/TestSuite/Syntax/Errors/eof_in_istring1.tjp +5 -0
  396. data/test/TestSuite/Syntax/Errors/eof_in_istring2.tjp +5 -0
  397. data/test/TestSuite/Syntax/Errors/eof_in_istring3.tjp +6 -0
  398. data/test/TestSuite/Syntax/Errors/eof_in_istring4.tjp +6 -0
  399. data/test/TestSuite/Syntax/Errors/eof_in_istring5.tjp +6 -0
  400. data/test/TestSuite/Syntax/Errors/include_recursion.tji +1 -0
  401. data/test/TestSuite/Syntax/Errors/include_recursion.tjp +7 -0
  402. data/test/TestSuite/Syntax/Errors/junk_after_cut.tjp +6 -0
  403. data/test/TestSuite/Syntax/Errors/navigator_exists.tjp +10 -0
  404. data/test/TestSuite/Syntax/Errors/operand_unkn_flag.tjp +1 -1
  405. data/test/TestSuite/Syntax/Errors/report_end.tjp +1 -1
  406. data/test/TestSuite/Syntax/Errors/report_exists.tjp +10 -0
  407. data/test/TestSuite/Syntax/Errors/report_start.tjp +1 -1
  408. data/test/TestSuite/Syntax/Errors/rev_acct_no_top.tjp +1 -1
  409. data/test/TestSuite/Syntax/Errors/sort_direction.tjp +1 -1
  410. data/test/TestSuite/Syntax/Errors/sort_unknown_scen.tjp +1 -1
  411. data/test/TestSuite/Syntax/Errors/sorting_crit_exptd1.tjp +1 -1
  412. data/test/TestSuite/Syntax/Errors/sorting_crit_exptd2.tjp +1 -1
  413. data/test/TestSuite/Syntax/Errors/sorting_wbs.tjp +1 -1
  414. data/test/TestSuite/Syntax/Errors/too_large_timing_res.tjp +7 -0
  415. data/test/TestSuite/Syntax/Errors/unknown_scenario_idx.tjp +1 -1
  416. data/test/TestSuite/Syntax/Errors/unknown_task.tjp +1 -1
  417. data/test/all.rb +1 -16
  418. data/test/test_CSV-Reports.rb +8 -5
  419. data/test/test_Query.rb +2 -2
  420. data/test/test_RichText.rb +95 -0
  421. data/test/test_Scheduler.rb +8 -4
  422. data/test/test_Syntax.rb +8 -4
  423. data/test/test_deep_copy.rb +83 -0
  424. metadata +549 -487
  425. data/benchmarks/UTF-8-Strings.rb +0 -58
  426. data/doc/classes/TaskJuggler/ReportElement.html +0 -1070
  427. data/doc/classes/TaskJuggler/ReportTableElement.html +0 -644
  428. data/lib/reports/ReportElement.rb +0 -427
  429. data/test/TestSuite/Syntax/Correct/csvtest +0 -16
  430. data/test/TestSuite/Syntax/Errors/no_csv_suffix.tjp +0 -10
  431. data/test/TestSuite/Syntax/Errors/no_html_suffix.tjp +0 -10
  432. data/test/TestSuite/Syntax/Errors/report_redifinition.tjp +0 -10
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby -w
2
2
  # encoding: UTF-8
3
3
  #
4
- # = ReportTableElement.rb -- The TaskJuggler III Project Management Software
4
+ # = TableReport.rb -- The TaskJuggler III Project Management Software
5
5
  #
6
6
  # Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
7
7
  #
@@ -10,6 +10,7 @@
10
10
  # published by the Free Software Foundation.
11
11
  #
12
12
 
13
+ require 'reports/ReportBase'
13
14
  require 'reports/GanttChart'
14
15
  require 'reports/ReportTableLegend'
15
16
  require 'reports/ColumnTable'
@@ -17,50 +18,63 @@ require 'Query'
17
18
 
18
19
  class TaskJuggler
19
20
 
20
- # This is base class for all types of tabular report elements. All tabular
21
- # report elements are converted to an abstract (output independent)
22
- # intermediate form first, before the are turned into the requested output
23
- # format.
24
- class ReportTableElement < ReportElement
21
+ # This is base class for all types of tabular reports. All tabular reports
22
+ # are converted to an abstract (output independent) intermediate form first,
23
+ # before the are turned into the requested output format.
24
+ class TableReport < ReportBase
25
25
 
26
26
  attr_reader :legend
27
27
 
28
- # Generate a new ReportTableElement object.
28
+ @@propertiesById = {
29
+ # ID Header Indent Align Calced. Scen Spec.
30
+ 'complete' => [ 'Completion', false, :right, true, true ],
31
+ 'cost' => [ 'Cost', true, :right, true, true ],
32
+ 'duration' => [ 'Duration', true, :right, true, true ],
33
+ 'effort' => [ 'Effort', true, :right, true, true ],
34
+ 'id' => [ 'Id', false, :left, true, false ],
35
+ 'line' => [ 'Line No.', false, :right, true, false ],
36
+ 'name' => [ 'Name', true, :left, false, false ],
37
+ 'no' => [ 'No.', false, :right, true, false ],
38
+ 'rate' => [ 'Rate', true, :right, true, true ],
39
+ 'resources' => [ 'Resources', false, :left, true, true ],
40
+ 'revenue' => [ 'Revenue', true, :right, true, true ],
41
+ 'scenario' => [ 'Scenario', false, :left, true, true ],
42
+ 'wbs' => [ 'WBS', false, :left, true, false ]
43
+ }
44
+ @@propertiesByType = {
45
+ # Type Indent Align
46
+ DateAttribute => [ false, :left ],
47
+ FixnumAttribute => [ false, :right ],
48
+ FloatAttribute => [ false, :right ],
49
+ RichTextAttribute => [ false, :left ],
50
+ StringAttribute => [ false, :left ]
51
+ }
52
+ # Generate a new TableReport object.
29
53
  def initialize(report)
30
54
  super
55
+ @report.content = self
31
56
 
32
57
  # Reference to the intermediate representation.
33
58
  @table = nil
59
+ @start = @end = nil
34
60
 
35
61
  @legend = ReportTableLegend.new
36
- end
37
62
 
38
- # This is an abstract member that all sub classes must re-implement. It may
39
- # or may not do something though.
40
- def generateIntermediateFormat
41
- raise 'This function must be overriden by derived classes.'
42
63
  end
43
64
 
44
- # Turn the ReportTableElement into an equivalent HTML element tree.
65
+
66
+ # Turn the TableReport into an equivalent HTML element tree.
45
67
  def to_html
46
68
  html = []
47
69
 
48
- # Make sure we have some margins around the report.
49
- html << (frame = XMLElement.new('div',
50
- 'style' => 'margin: 35px 5% 25px 5%; '))
51
-
52
- if @prolog
53
- @prolog.sectionNumbers = false
54
- frame << @prolog.to_html
55
- end
56
-
57
- frame << (table = XMLElement.new('table', 'summary' => 'Report Table',
70
+ html << rt_to_html('header')
71
+ html << (table = XMLElement.new('table', 'summary' => 'Report Table',
58
72
  'cellspacing' => '2', 'border' => '0',
59
73
  'cellpadding' => '0', 'align' => 'center',
60
74
  'class' => 'tabback'))
61
75
 
62
76
  # The headline is put in a sub-table to appear bigger.
63
- if @headline
77
+ if a('headline')
64
78
  table << (thead = XMLElement.new('thead'))
65
79
  thead << (tr = XMLElement.new('tr'))
66
80
  tr << (td = XMLElement.new('td'))
@@ -73,7 +87,7 @@ class TaskJuggler
73
87
  'style' => 'font-size:16px; ' +
74
88
  'font-weight:bold',
75
89
  'class' => 'tabfront'))
76
- td1 << XMLNamedText.new(@headline, 'p')
90
+ td1 << XMLNamedText.new(a('headline'), 'p')
77
91
  end
78
92
 
79
93
  # Now generate the actual table with the data.
@@ -83,13 +97,13 @@ class TaskJuggler
83
97
  td << @table.to_html
84
98
 
85
99
  # Embedd the caption as RichText into the table footer.
86
- if @caption
100
+ if a('caption')
87
101
  tbody << (tr = XMLElement.new('tr'))
88
102
  tr << (td = XMLElement.new('td', 'class' => 'tabback'))
89
103
  td << (div = XMLElement.new('div', 'class' => 'caption',
90
104
  'style' => 'margin:1px'))
91
- @caption.sectionNumbers = false
92
- div << @caption.to_html
105
+ a('caption').sectionNumbers = false
106
+ div << a('caption').to_html
93
107
  end
94
108
 
95
109
  # A sub-table with the legend.
@@ -110,22 +124,179 @@ class TaskJuggler
110
124
  'href' => "#{AppConfig.contact}")
111
125
  td << XMLText.new(" v#{AppConfig.version}")
112
126
 
113
- if @epilog
114
- @epilog.sectionNumbers = false
115
- frame << @epilog.to_html
116
- end
117
-
127
+ html << rt_to_html('footer')
118
128
  html
119
129
  end
120
130
 
121
- # Convert the ReportElement into an Array of Arrays. It has one Array for
122
- # each line. The nested Arrays have one String for each column.
131
+ # Convert the table into an Array of Arrays. It has one Array for each
132
+ # line. The nested Arrays have one String for each column.
123
133
  def to_csv
124
134
  @table.to_csv
125
135
  end
126
136
 
137
+ # This is the default attribute value to text converter. It is used
138
+ # whenever we need no special treatment.
139
+ def cellText(value, type)
140
+ begin
141
+ if value.nil?
142
+ if type == DateAttribute
143
+ nil
144
+ else
145
+ ''
146
+ end
147
+ else
148
+ # Certain attribute types need special treatment.
149
+ if type == DateAttribute
150
+ value.value.to_s(a('timeFormat'))
151
+ elsif type == RichTextAttribute
152
+ value.value
153
+ elsif type == ReferenceAttribute
154
+ value.label
155
+ else
156
+ value.to_s
157
+ end
158
+ end
159
+ rescue TjException
160
+ ''
161
+ end
162
+ end
163
+
164
+ # This function returns true if the values for the _colId_ column need to be
165
+ # calculated.
166
+ def calculated?(colId)
167
+ if @@propertiesById.has_key?(colId)
168
+ return @@propertiesById[colId][3]
169
+ end
170
+ return false
171
+ end
172
+
173
+ # This functions returns true if the values for the _col_id_ column are
174
+ # scenario specific.
175
+ def scenarioSpecific?(colId)
176
+ if @@propertiesById.has_key?(colId)
177
+ return @@propertiesById[colId][4]
178
+ end
179
+ return false
180
+ end
181
+
182
+ # Return if the column values should be indented based on the _colId_ or the
183
+ # _propertyType_.
184
+ def indent(colId, propertyType)
185
+ if @@propertiesById.has_key?(colId)
186
+ return @@propertiesById[colId][1]
187
+ elsif @@propertiesByType.has_key?(propertyType)
188
+ return @@propertiesByType[propertyType][0]
189
+ else
190
+ false
191
+ end
192
+ end
193
+
194
+ # Return the alignment of the column based on the _colId_ or the
195
+ # _propertyType_.
196
+ def alignment(colId, propertyType)
197
+ if @@propertiesById.has_key?(colId)
198
+ return @@propertiesById[colId][2]
199
+ elsif @@propertiesByType.has_key?(propertyType)
200
+ return @@propertiesByType[propertyType][1]
201
+ else
202
+ :center
203
+ end
204
+ end
205
+
206
+ # Returns the default column title for the columns _id_.
207
+ def TableReport::defaultColumnTitle(id)
208
+ # Return an empty string for some special columns that don't have a fixed
209
+ # title.
210
+ specials = %w( chart hourly daily weekly monthly quarterly yearly)
211
+ return '' if specials.include?(id)
212
+
213
+ # Return the title for build-in hardwired columns.
214
+ @@propertiesById.include?(id) ? @@propertiesById[id][0] : nil
215
+ end
216
+
217
+ def supportedColumns
218
+ @@propertiesById.keys
219
+ end
220
+
127
221
  protected
128
222
 
223
+ # These can't be determined during initialization as they have have been
224
+ # changed afterwards.
225
+ def setReportPeriod
226
+ @start = a('start')
227
+ @end = a('end')
228
+ end
229
+
230
+ # In case the user has not specified the report period, we try to fit all
231
+ # the _tasks_ in and add an extra 5% time at both ends. _scenarios_ is a
232
+ # list of scenario indexes.
233
+ def adjustReportPeriod(tasks, scenarios, columns)
234
+ return if tasks.empty? ||
235
+ a('start') != @project['start'] || a('end') != @project['end']
236
+
237
+ @start = @end = nil
238
+ scenarios.each do |scenarioIdx|
239
+ tasks.each do |task|
240
+ date = task['start', scenarioIdx] || @project['start']
241
+ @start = date if @start.nil? || date < @start
242
+ date = task['end', scenarioIdx] || @project['end']
243
+ @end = date if @end.nil? || date > @end
244
+ end
245
+ end
246
+ # We want to add at least 5% on both ends.
247
+ margin = 0
248
+ minWidth = @end - @start + 1
249
+ columns.each do |column|
250
+ case column.id
251
+ when 'chart'
252
+ # In case we have a 'chart' column, we enforce certain minimum width
253
+ # of the chart. The width depends on the selected scale.
254
+ # The following table contains an entry for each scale. The entry
255
+ # consists of the triple 'seconds per unit', 'minimum width units'
256
+ # and 'margin units'. The minimum with does not include the margins
257
+ # since they are always added.
258
+ mwMap = {
259
+ 'hour' => [ 60 * 60, 18, 2 ],
260
+ 'day' => [ 60 * 60 * 24, 18, 2 ],
261
+ 'week' => [ 60 * 60 * 24 * 7, 6, 1 ],
262
+ 'month' => [ 60 * 60 * 24 * 31, 10, 1 ],
263
+ 'quarter' => [ 60 * 60 * 24 * 90, 6, 1 ],
264
+ 'year' => [ 60 * 60 * 24 * 365, 4, 1 ]
265
+ }
266
+ entry = mwMap[column.scale]
267
+ raise "Unknown scale #{column.scale}" unless entry
268
+ margin = entry[0] * entry[2]
269
+ # If the with determined by start and end dates of the task is below
270
+ # the minimum width, we increase the width to the value provided by
271
+ # the table.
272
+ minWidth = entry[0] * entry[1] if minWidth < entry[0] * entry[1]
273
+ break
274
+ when 'hourly', 'daily', 'weekly', 'monthly', 'quarterly', 'yearly'
275
+ # For the calendar columns we use a similar approach as we use for
276
+ # the 'chart' column.
277
+ mwMap = {
278
+ 'hourly' => [ 60 * 60, 18, 2 ],
279
+ 'daily' => [ 60 * 60 * 24, 18, 2 ],
280
+ 'weekly' => [ 60 * 60 * 24 * 7, 6, 1 ],
281
+ 'monthly' => [ 60 * 60 * 24 * 31, 10, 1 ],
282
+ 'quarterly' => [ 60 * 60 * 24 * 90, 6, 1 ],
283
+ 'yearly' => [ 60 * 60 * 24 * 365, 4, 1 ]
284
+ }
285
+ entry = mwMap[column.id]
286
+ raise "Unknown scale #{column.id}" unless entry
287
+ margin = entry[0] * entry[2]
288
+ minWidth = entry[0] * entry[1] if minWidth < entry[0] * entry[1]
289
+ break
290
+ end
291
+ end
292
+
293
+ if minWidth > (@end - @start + 1)
294
+ margin += (minWidth - (@end - @start + 1)) / 2
295
+ end
296
+ @start -= margin
297
+ @end += margin
298
+ end
299
+
129
300
  # Generates cells for the table header. _columnDef_ is the
130
301
  # TableColumnDefinition object that describes the column. Based on the id of
131
302
  # the column different actions need to be taken to generate the header text.
@@ -135,7 +306,8 @@ class TaskJuggler
135
306
  # For the 'chart' column we generate a GanttChart object. The sizes are
136
307
  # set so that the lines of the Gantt chart line up with the lines of the
137
308
  # table.
138
- gantt = GanttChart.new(@now, @weekStartsMonday, self)
309
+ gantt = GanttChart.new(a('now'),
310
+ a('weekStartsMonday'), self)
139
311
  gantt.generateByScale(@start, @end, columnDef.scale)
140
312
  # The header consists of 2 lines separated by a 1 pixel boundary.
141
313
  gantt.header.height = @table.headerLineHeight * 2 + 1
@@ -153,10 +325,11 @@ class TaskJuggler
153
325
  :weekdayAndDate, :hour)
154
326
  when 'daily'
155
327
  genCalChartHeader(columnDef, @start.midnight, :sameTimeNextDay,
156
- :shortMonthName, :day)
328
+ :monthAndYear, :day)
157
329
  when 'weekly'
158
- genCalChartHeader(columnDef, @start.beginOfWeek(@weekStartsMonday),
159
- :sameTimeNextWeek, :shortMonthName, :day)
330
+ genCalChartHeader(columnDef,
331
+ @start.beginOfWeek(a('weekStartsMonday')),
332
+ :sameTimeNextWeek, :monthAndYear, :day)
160
333
  when 'monthly'
161
334
  genCalChartHeader(columnDef, @start.beginOfMonth, :sameTimeNextMonth,
162
335
  :year, :shortMonthName)
@@ -183,12 +356,12 @@ class TaskJuggler
183
356
  # line.
184
357
  def generateTaskList(taskList, resourceList, scopeLine)
185
358
  queryAttrs = { 'scopeProperty' => scopeLine ? scopeLine.property : nil,
186
- 'loadUnit' => @loadUnit,
187
- 'numberFormat' => @numberFormat,
188
- 'currencyFormat' => @currencyFormat,
359
+ 'loadUnit' => a('loadUnit'),
360
+ 'numberFormat' => a('numberFormat'),
361
+ 'currencyFormat' => a('currencyFormat'),
189
362
  'start' => @start, 'end' => @end,
190
- 'costAccount' => @costAccount,
191
- 'revenueAccount' => @revenueAccount }
363
+ 'costAccount' => a('costAccount'),
364
+ 'revenueAccount' => a('revenueAccount') }
192
365
  taskList.query = Query.new(queryAttrs)
193
366
  taskList.sort!
194
367
 
@@ -202,17 +375,17 @@ class TaskJuggler
202
375
  no += 1
203
376
  Log.activity if lineNo % 10 == 0
204
377
  lineNo += 1
205
- @scenarios.each do |scenarioIdx|
378
+ a('scenarios').each do |scenarioIdx|
206
379
  # Generate line for each task.
207
380
  line = ReportTableLine.new(@table, task, scopeLine)
208
381
 
209
382
  line.no = no unless scopeLine
210
383
  line.lineNo = lineNo
211
384
  line.subLineNo = @table.lines
212
- setIndent(line, @taskRoot, taskList.treeMode?)
385
+ setIndent(line, a('taskRoot'), taskList.treeMode?)
213
386
 
214
387
  # Generate a cell for each column in this line.
215
- @columns.each do |columnDef|
388
+ a('columns').each do |columnDef|
216
389
  next unless generateTableCell(line, task, columnDef, scenarioIdx)
217
390
  end
218
391
  end
@@ -221,9 +394,9 @@ class TaskJuggler
221
394
  # If we have a resourceList we generate nested lines for each of the
222
395
  # resources that are assigned to this task and pass the user-defined
223
396
  # filter.
224
- resourceList.setSorting(@sortResources)
397
+ resourceList.setSorting(a('sortResources'))
225
398
  assignedResourceList = filterResourceList(resourceList, task,
226
- @hideResource, @rollupResource)
399
+ a('hideResource'), a('rollupResource'))
227
400
  assignedResourceList.sort!
228
401
  lineNo = generateResourceList(assignedResourceList, nil, line)
229
402
  end
@@ -237,12 +410,12 @@ class TaskJuggler
237
410
  # generated resource lines will be within the scope this task line.
238
411
  def generateResourceList(resourceList, taskList, scopeLine)
239
412
  queryAttrs = { 'scopeProperty' => scopeLine ? scopeLine.property : nil,
240
- 'loadUnit' => @loadUnit,
241
- 'numberFormat' => @numberFormat,
242
- 'currencyFormat' => @currencyFormat,
413
+ 'loadUnit' => a('loadUnit'),
414
+ 'numberFormat' => a('numberFormat'),
415
+ 'currencyFormat' => a('currencyFormat'),
243
416
  'start' => @start, 'end' => @end,
244
- 'costAccount' => @costAccount,
245
- 'revenueAccount' => @revenueAccount }
417
+ 'costAccount' => a('costAccount'),
418
+ 'revenueAccount' => a('revenueAccount') }
246
419
  resourceList.query = Query.new(queryAttrs)
247
420
  resourceList.sort!
248
421
 
@@ -256,17 +429,17 @@ class TaskJuggler
256
429
  no += 1
257
430
  Log.activity if lineNo % 10 == 0
258
431
  lineNo += 1
259
- @scenarios.each do |scenarioIdx|
432
+ a('scenarios').each do |scenarioIdx|
260
433
  # Generate line for each resource.
261
434
  line = ReportTableLine.new(@table, resource, scopeLine)
262
435
 
263
436
  line.no = no unless scopeLine
264
437
  line.lineNo = lineNo
265
438
  line.subLineNo = @table.lines
266
- setIndent(line, @resourceRoot, resourceList.treeMode?)
439
+ setIndent(line, a('resourceRoot'), resourceList.treeMode?)
267
440
 
268
441
  # Generate a cell for each column in this line.
269
- @columns.each do |column|
442
+ a('columns').each do |column|
270
443
  next unless generateTableCell(line, resource, column, scenarioIdx)
271
444
  end
272
445
  end
@@ -275,9 +448,10 @@ class TaskJuggler
275
448
  # If we have a taskList we generate nested lines for each of the
276
449
  # tasks that the resource is assigned to and pass the user-defined
277
450
  # filter.
278
- taskList.setSorting(@sortTasks)
451
+ taskList.setSorting(a('sortTasks'))
279
452
  assignedTaskList = filterTaskList(taskList, resource,
280
- @hideTask, @rollupTask)
453
+ a('hideTask'),
454
+ a('rollupTask'))
281
455
  assignedTaskList.sort!
282
456
  lineNo = generateTaskList(assignedTaskList, nil, line)
283
457
  end
@@ -320,14 +494,15 @@ class TaskJuggler
320
494
  firstColumn = nil
321
495
  # The innter loops terminates when the label for the upper scale has
322
496
  # changed to the next scale cell.
323
- while t < @end && (name1Func.nil? || t.send(name1Func) == currentInterval)
497
+ while t < @end && (name1Func.nil? ||
498
+ t.send(name1Func) == currentInterval)
324
499
  # call TjTime::sameTimeNext... function to get the end of the column.
325
500
  nextT = t.send(sameTimeNextFunc)
326
501
  iv = Interval.new(t, nextT)
327
502
  # Create the new column object.
328
503
  column = ReportTableColumn.new(table, nil, '')
329
504
  # Store the date of the column in the original form.
330
- column.cell1.data = t.to_s(@timeFormat)
505
+ column.cell1.data = t.to_s(a('timeFormat'))
331
506
  # The upper scale cells will be merged into one large cell that spans
332
507
  # all lower scale cells that belong to this upper cell.
333
508
  if firstColumn.nil?
@@ -391,7 +566,7 @@ class TaskJuggler
391
566
  start = @start.midnight
392
567
  sameTimeNextFunc = :sameTimeNextDay
393
568
  when 'weekly'
394
- start = @start.beginOfWeek(@weekStartsMonday)
569
+ start = @start.beginOfWeek(a('weekStartsMonday'))
395
570
  sameTimeNextFunc = :sameTimeNextWeek
396
571
  when 'monthly'
397
572
  start = @start.beginOfMonth
@@ -435,22 +610,36 @@ class TaskJuggler
435
610
  # hidden cell.
436
611
  def genStandardCell(scenarioIdx, line, columnDef)
437
612
  property = line.property
438
- # Create a new cell
439
- cell = newCell(line, cellText(property, scenarioIdx, columnDef.id))
440
613
 
614
+ # Find out, what type of PropertyTreeNode we are dealing with.
441
615
  if property.is_a?(Task)
442
- properties = @project.tasks
616
+ propertyList = @project.tasks
443
617
  elsif property.is_a?(Resource)
444
- properties = @project.resources
618
+ propertyList = @project.resources
445
619
  else
446
620
  raise "Unknown property type #{property.class}"
447
621
  end
622
+ colId = columnDef.id
623
+ # Get the value no matter if it's scenario specific or not.
624
+ if propertyList.scenarioSpecific?(colId)
625
+ value = property.getAttr(colId, scenarioIdx)
626
+ else
627
+ value = property.getAttr(colId)
628
+ end
629
+ # Get the type of the property
630
+ type = propertyList.attributeType(colId)
631
+
632
+ # Create a new cell
633
+ cell = newCell(line, cellText(value, type))
634
+ if type == ReferenceAttribute
635
+ cell.url = value.url
636
+ end
448
637
 
449
638
  # Check if we are dealing with multiple scenarios.
450
- if @scenarios.length > 1
639
+ if a('scenarios').length > 1
451
640
  # Check if the attribute is not scenario specific
452
- unless properties.scenarioSpecific?(columnDef.id)
453
- if scenarioIdx == @scenarios.first
641
+ unless propertyList.scenarioSpecific?(columnDef.id)
642
+ if scenarioIdx == a('scenarios').first
454
643
  # Use a somewhat bigger font.
455
644
  cell.fontSize = 15
456
645
  else
@@ -458,23 +647,24 @@ class TaskJuggler
458
647
  cell.hidden = true
459
648
  return false
460
649
  end
461
- cell.rows = @scenarios.length
650
+ cell.rows = a('scenarios').length
462
651
  end
463
652
  end
464
653
 
465
654
  setStandardCellAttributes(cell, columnDef,
466
- properties.attributeType(columnDef.id), line)
655
+ propertyList.attributeType(columnDef.id), line)
467
656
 
468
657
  scopeProperty = line.scopeLine ? line.scopeLine.property : nil
469
658
  query = Query.new('property' => property,
470
659
  'scopeProperty' => scopeProperty,
471
660
  'attributeId' => columnDef.id,
472
- 'scenarioIdx' => scenarioIdx, 'loadUnit' => @loadUnit,
473
- 'numberFormat' => @numberFormat,
474
- 'currencyFormat' => @currencyFormat,
661
+ 'scenarioIdx' => scenarioIdx,
662
+ 'loadUnit' => a('loadUnit'),
663
+ 'numberFormat' => a('numberFormat'),
664
+ 'currencyFormat' => a('currencyFormat'),
475
665
  'start' => @start, 'end' => @end,
476
- 'costAccount' => @costAccount,
477
- 'revenueAccount' => @revenueAccount)
666
+ 'costAccount' => a('costAccount'),
667
+ 'revenueAccount' => a('revenueAccount'))
478
668
  if cell.text
479
669
  if columnDef.cellText
480
670
  cell.text = expandMacros(columnDef.cellText, cell.text, query)
@@ -499,28 +689,29 @@ class TaskJuggler
499
689
  cell = newCell(line)
500
690
 
501
691
  unless scenarioSpecific?(columnDef.id)
502
- if scenarioIdx != @scenarios.first
692
+ if scenarioIdx != a('scenarios').first
503
693
  cell.hidden = true
504
694
  return false
505
695
  end
506
- cell.rows = @scenarios.length
696
+ cell.rows = a('scenarios').length
507
697
  end
508
698
 
509
699
  setStandardCellAttributes(cell, columnDef, nil, line)
510
700
 
701
+ scopeProperty = line.scopeLine ? line.scopeLine.property : nil
511
702
  return if columnDef.hideCellText &&
512
- endcolumnDef.hideCellText.eval(property, scopeProperty)
703
+ columnDef.hideCellText.eval(property, scopeProperty)
513
704
 
514
- scopeProperty = line.scopeLine ? line.scopeLine.property : nil
515
705
  query = Query.new('property' => property,
516
706
  'scopeProperty' => scopeProperty,
517
707
  'attributeId' => columnDef.id,
518
- 'scenarioIdx' => scenarioIdx, 'loadUnit' => @loadUnit,
519
- 'numberFormat' => @numberFormat,
520
- 'currencyFormat' => @currencyFormat,
708
+ 'scenarioIdx' => scenarioIdx,
709
+ 'loadUnit' => a('loadUnit'),
710
+ 'numberFormat' => a('numberFormat'),
711
+ 'currencyFormat' => a('currencyFormat'),
521
712
  'start' => @start, 'end' => @end,
522
- 'costAccount' => @costAccount,
523
- 'revenueAccount' => @revenueAccount)
713
+ 'costAccount' => a('costAccount'),
714
+ 'revenueAccount' => a('revenueAccount'))
524
715
  query.process
525
716
  cell.text = query.result
526
717
 
@@ -532,6 +723,8 @@ class TaskJuggler
532
723
  cell.text = line.no.to_s
533
724
  when 'wbs'
534
725
  cell.indent = 2 if line.scopeLine
726
+ when 'scenario'
727
+ cell.text = @project.scenario(scenarioIdx).name
535
728
  end
536
729
 
537
730
  if columnDef.cellText
@@ -564,11 +757,12 @@ class TaskJuggler
564
757
  @project['end'] : task['end', scenarioIdx])
565
758
 
566
759
  query = Query.new('property' => task, 'scopeProperty' => resource,
567
- 'scenarioIdx' => scenarioIdx, 'loadUnit' => @loadUnit,
568
- 'numberFormat' => @numberFormat,
569
- 'currencyFormat' => @currencyFormat,
570
- 'costAccount' => @costAccount,
571
- 'revenueAccount' => @revenueAccount)
760
+ 'scenarioIdx' => scenarioIdx,
761
+ 'loadUnit' => a('loadUnit'),
762
+ 'numberFormat' => a('numberFormat'),
763
+ 'currencyFormat' => a('currencyFormat'),
764
+ 'costAccount' => a('costAccount'),
765
+ 'revenueAccount' => a('revenueAccount'))
572
766
 
573
767
  firstCell = nil
574
768
  while t < @end
@@ -637,11 +831,12 @@ class TaskJuggler
637
831
  end
638
832
 
639
833
  query = Query.new('property' => resource,
640
- 'scenarioIdx' => scenarioIdx, 'loadUnit' => @loadUnit,
641
- 'numberFormat' => @numberFormat,
642
- 'currencyFormat' => @currencyFormat,
643
- 'costAccount' => @costAccount,
644
- 'revenueAccount' => @revenueAccount)
834
+ 'scenarioIdx' => scenarioIdx,
835
+ 'loadUnit' => a('loadUnit'),
836
+ 'numberFormat' => a('numberFormat'),
837
+ 'currencyFormat' => a('currencyFormat'),
838
+ 'costAccount' => a('costAccount'),
839
+ 'revenueAccount' => a('revenueAccount'))
645
840
 
646
841
  firstCell = nil
647
842
  while t < @end
@@ -777,8 +972,13 @@ class TaskJuggler
777
972
  def setCellURL(cell, columnDef, query)
778
973
  return unless columnDef.cellURL
779
974
 
780
- url = expandMacros(columnDef.cellURL, cell.text, query)
781
- cell.url = url unless url.empty?
975
+ if columnDef.hideCellURL &&
976
+ columnDef.hideCellURL.eval(query.property, query.scopeProperty)
977
+ url = nil
978
+ else
979
+ url = expandMacros(columnDef.cellURL, cell.text, query)
980
+ end
981
+ cell.url = url unless url.nil? || url.empty?
782
982
  end
783
983
 
784
984
  # Try to merge equal cells without text to multi-column cells.