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.
Files changed (495) hide show
  1. data/benchmarks/UTF-8-Strings.rb +58 -0
  2. data/data/css/tjmanual.css +52 -0
  3. data/data/css/tjreport.css +195 -0
  4. data/data/icons/details.png +0 -0
  5. data/data/icons/flag-green.png +0 -0
  6. data/data/icons/flag-red.png +0 -0
  7. data/data/icons/flag-yellow.png +0 -0
  8. data/data/icons/resource.png +0 -0
  9. data/data/icons/resourcegroup.png +0 -0
  10. data/data/icons/task.png +0 -0
  11. data/data/icons/taskgroup.png +0 -0
  12. data/data/icons/trend-down.png +0 -0
  13. data/data/icons/trend-flat.png +0 -0
  14. data/data/icons/trend-up.png +0 -0
  15. data/data/scripts/wz_tooltip.js +1301 -0
  16. data/doc/classes/AppConfig.html +298 -230
  17. data/doc/classes/Arguments.html +8 -8
  18. data/doc/classes/Object.html +7 -7
  19. data/doc/classes/String.html +89 -89
  20. data/doc/classes/TaskJuggler.html +396 -264
  21. data/doc/classes/TaskJuggler/Account.html +18 -18
  22. data/doc/classes/TaskJuggler/AccountAttribute.html +26 -26
  23. data/doc/classes/TaskJuggler/AccountScenario.html +12 -12
  24. data/doc/classes/TaskJuggler/Allocation.html +30 -30
  25. data/doc/classes/TaskJuggler/AllocationAttribute.html +26 -26
  26. data/doc/classes/TaskJuggler/AttributeBase.html +227 -115
  27. data/doc/classes/TaskJuggler/AttributeDefinition.html +6 -6
  28. data/doc/classes/TaskJuggler/BatchProcessor.html +117 -83
  29. data/doc/classes/TaskJuggler/Booking.html +18 -18
  30. data/doc/classes/TaskJuggler/BookingListAttribute.html +26 -26
  31. data/doc/classes/TaskJuggler/BooleanAttribute.html +26 -26
  32. data/doc/classes/TaskJuggler/CSVFile.html +24 -24
  33. data/doc/classes/TaskJuggler/CellSettingPattern.html +201 -0
  34. data/doc/classes/TaskJuggler/CellSettingPatternList.html +253 -0
  35. data/doc/classes/TaskJuggler/Charge.html +18 -18
  36. data/doc/classes/TaskJuggler/ChargeListAttribute.html +20 -20
  37. data/doc/classes/TaskJuggler/ChargeSet.html +37 -37
  38. data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +26 -26
  39. data/doc/classes/TaskJuggler/ColumnListAttribute.html +20 -20
  40. data/doc/classes/TaskJuggler/ColumnTable.html +40 -40
  41. data/doc/classes/TaskJuggler/DateAttribute.html +54 -15
  42. data/doc/classes/TaskJuggler/DefinitionListAttribute.html +10 -10
  43. data/doc/classes/TaskJuggler/DependencyListAttribute.html +47 -47
  44. data/doc/classes/TaskJuggler/DurationAttribute.html +30 -30
  45. data/doc/classes/TaskJuggler/FixnumAttribute.html +20 -20
  46. data/doc/classes/TaskJuggler/FlagListAttribute.html +43 -43
  47. data/doc/classes/TaskJuggler/FloatAttribute.html +30 -30
  48. data/doc/classes/TaskJuggler/FormatListAttribute.html +21 -21
  49. data/doc/classes/TaskJuggler/GanttChart.html +48 -48
  50. data/doc/classes/TaskJuggler/GanttContainer.html +42 -42
  51. data/doc/classes/TaskJuggler/GanttHeader.html +12 -12
  52. data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +12 -12
  53. data/doc/classes/TaskJuggler/GanttLine.html +24 -24
  54. data/doc/classes/TaskJuggler/GanttLoadStack.html +18 -18
  55. data/doc/classes/TaskJuggler/GanttMilestone.html +42 -42
  56. data/doc/classes/TaskJuggler/GanttRouter.html +24 -24
  57. data/doc/classes/TaskJuggler/GanttTaskBar.html +42 -42
  58. data/doc/classes/TaskJuggler/HTMLDocument.html +13 -13
  59. data/doc/classes/TaskJuggler/HTMLGraphics.html +12 -12
  60. data/doc/classes/TaskJuggler/Interval.html +57 -57
  61. data/doc/classes/TaskJuggler/IntervalListAttribute.html +47 -47
  62. data/doc/classes/TaskJuggler/JobInfo.html +68 -12
  63. data/doc/classes/TaskJuggler/Journal.html +266 -20
  64. data/doc/classes/TaskJuggler/JournalEntry.html +79 -23
  65. data/doc/classes/TaskJuggler/JournalEntryList.html +454 -0
  66. data/doc/classes/TaskJuggler/KeywordArray.html +10 -10
  67. data/doc/classes/TaskJuggler/KeywordDocumentation.html +171 -170
  68. data/doc/classes/TaskJuggler/Limits.html +36 -36
  69. data/doc/classes/TaskJuggler/Limits/Limit.html +30 -30
  70. data/doc/classes/TaskJuggler/LimitsAttribute.html +40 -40
  71. data/doc/classes/TaskJuggler/ListAttributeBase.html +20 -20
  72. data/doc/classes/TaskJuggler/Log.html +145 -107
  73. data/doc/classes/TaskJuggler/LogicalAttribute.html +65 -36
  74. data/doc/classes/TaskJuggler/LogicalExpression.html +61 -24
  75. data/doc/classes/TaskJuggler/LogicalExpressionAttribute.html +20 -20
  76. data/doc/classes/TaskJuggler/LogicalFlag.html +31 -51
  77. data/doc/classes/TaskJuggler/LogicalFunction.html +64 -53
  78. data/doc/classes/TaskJuggler/LogicalOperation.html +103 -55
  79. data/doc/classes/TaskJuggler/Macro.html +6 -6
  80. data/doc/classes/TaskJuggler/MacroParser.html +36 -36
  81. data/doc/classes/TaskJuggler/MacroTable.html +37 -37
  82. data/doc/classes/TaskJuggler/Message.html +12 -12
  83. data/doc/classes/TaskJuggler/MessageHandler.html +32 -20
  84. data/doc/classes/TaskJuggler/Navigator.html +110 -46
  85. data/doc/classes/TaskJuggler/NavigatorElement.html +449 -0
  86. data/doc/classes/TaskJuggler/OnShiftCache.html +24 -24
  87. data/doc/classes/TaskJuggler/Project.html +1158 -893
  88. data/doc/classes/TaskJuggler/ProjectFileParser.html +94 -91
  89. data/doc/classes/TaskJuggler/PropertyAttribute.html +20 -20
  90. data/doc/classes/TaskJuggler/PropertyList.html +225 -155
  91. data/doc/classes/TaskJuggler/PropertySet.html +375 -332
  92. data/doc/classes/TaskJuggler/PropertyTreeNode.html +750 -510
  93. data/doc/classes/TaskJuggler/Query.html +404 -139
  94. data/doc/classes/TaskJuggler/{RTPNavigator.html → RTFNavigator.html} +57 -56
  95. data/doc/classes/TaskJuggler/RTFQuery.html +343 -0
  96. data/doc/classes/TaskJuggler/{RTPReport.html → RTFReport.html} +70 -67
  97. data/doc/classes/TaskJuggler/RealFormat.html +18 -18
  98. data/doc/classes/TaskJuggler/RealFormatAttribute.html +10 -10
  99. data/doc/classes/TaskJuggler/ReferenceAttribute.html +107 -40
  100. data/doc/classes/TaskJuggler/RemoteServiceManager.html +335 -0
  101. data/doc/classes/TaskJuggler/Report.html +66 -64
  102. data/doc/classes/TaskJuggler/ReportBase.html +112 -123
  103. data/doc/classes/TaskJuggler/ReportContext.html +43 -38
  104. data/doc/classes/TaskJuggler/ReportServer.html +320 -0
  105. data/doc/classes/TaskJuggler/ReportTable.html +42 -42
  106. data/doc/classes/TaskJuggler/ReportTableCell.html +221 -129
  107. data/doc/classes/TaskJuggler/ReportTableColumn.html +27 -27
  108. data/doc/classes/TaskJuggler/ReportTableLegend.html +24 -24
  109. data/doc/classes/TaskJuggler/ReportTableLine.html +126 -80
  110. data/doc/classes/TaskJuggler/Resource.html +12 -12
  111. data/doc/classes/TaskJuggler/ResourceListAttribute.html +82 -47
  112. data/doc/classes/TaskJuggler/ResourceListRE.html +43 -39
  113. data/doc/classes/TaskJuggler/ResourceScenario.html +413 -321
  114. data/doc/classes/TaskJuggler/RichText.html +64 -248
  115. data/doc/classes/TaskJuggler/RichTextAttribute.html +94 -30
  116. data/doc/classes/TaskJuggler/RichTextDocument.html +87 -85
  117. data/doc/classes/TaskJuggler/RichTextElement.html +456 -363
  118. data/doc/classes/TaskJuggler/RichTextException.html +13 -13
  119. data/doc/classes/TaskJuggler/{RichTextProtocolExample.html → RichTextFunctionExample.html} +64 -63
  120. data/doc/classes/TaskJuggler/{RichTextProtocolHandler.html → RichTextFunctionHandler.html} +42 -36
  121. data/doc/classes/TaskJuggler/RichTextIntermediate.html +563 -0
  122. data/doc/classes/TaskJuggler/RichTextParser.html +54 -51
  123. data/doc/classes/TaskJuggler/RichTextScanner.html +94 -92
  124. data/doc/classes/TaskJuggler/RichTextSnip.html +96 -60
  125. data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +369 -227
  126. data/doc/classes/TaskJuggler/Scenario.html +6 -6
  127. data/doc/classes/TaskJuggler/ScenarioData.html +37 -37
  128. data/doc/classes/TaskJuggler/ScenarioListAttribute.html +31 -31
  129. data/doc/classes/TaskJuggler/Scoreboard.html +66 -66
  130. data/doc/classes/TaskJuggler/Shift.html +18 -18
  131. data/doc/classes/TaskJuggler/ShiftAssignment.html +54 -54
  132. data/doc/classes/TaskJuggler/ShiftAssignments.html +78 -78
  133. data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +40 -40
  134. data/doc/classes/TaskJuggler/ShiftScenario.html +24 -24
  135. data/doc/classes/TaskJuggler/SortListAttribute.html +22 -22
  136. data/doc/classes/TaskJuggler/SourceFileInfo.html +12 -12
  137. data/doc/classes/TaskJuggler/StringAttribute.html +30 -30
  138. data/doc/classes/TaskJuggler/SymbolAttribute.html +20 -20
  139. data/doc/classes/TaskJuggler/SyntaxReference.html +42 -42
  140. data/doc/classes/TaskJuggler/TOCEntry.html +12 -12
  141. data/doc/classes/TaskJuggler/TSResourceRecord.html +197 -0
  142. data/doc/classes/TaskJuggler/TSTaskRecord.html +215 -0
  143. data/doc/classes/TaskJuggler/TableColumnDefinition.html +64 -43
  144. data/doc/classes/TaskJuggler/TableOfContents.html +18 -18
  145. data/doc/classes/TaskJuggler/TableReport.html +447 -468
  146. data/doc/classes/TaskJuggler/Task.html +12 -12
  147. data/doc/classes/TaskJuggler/TaskDependency.html +12 -12
  148. data/doc/classes/TaskJuggler/TaskListAttribute.html +47 -47
  149. data/doc/classes/TaskJuggler/TaskListRE.html +43 -39
  150. data/doc/classes/TaskJuggler/TaskScenario.html +529 -282
  151. data/doc/classes/TaskJuggler/TextParser.html +215 -194
  152. data/doc/classes/TaskJuggler/TextParser/Pattern.html +97 -97
  153. data/doc/classes/TaskJuggler/TextParser/Rule.html +84 -84
  154. data/doc/classes/TaskJuggler/TextParser/StackElement.html +16 -15
  155. data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +12 -12
  156. data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +6 -6
  157. data/doc/classes/TaskJuggler/TextReport.html +77 -74
  158. data/doc/classes/TaskJuggler/TextScanner.html +294 -281
  159. data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +70 -70
  160. data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +59 -60
  161. data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +12 -12
  162. data/doc/classes/TaskJuggler/TimeSheetReport.html +406 -0
  163. data/doc/classes/TaskJuggler/TjException.html +6 -6
  164. data/doc/classes/TaskJuggler/TjTime.html +522 -513
  165. data/doc/classes/TaskJuggler/TjpExample.html +25 -25
  166. data/doc/classes/TaskJuggler/TjpExportRE.html +21 -24
  167. data/doc/classes/TaskJuggler/TjpSyntaxRules.html +6177 -4318
  168. data/doc/classes/TaskJuggler/UserManual.html +212 -213
  169. data/doc/classes/TaskJuggler/WorkingHours.html +49 -49
  170. data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +53 -53
  171. data/doc/classes/TaskJuggler/XMLBlob.html +21 -21
  172. data/doc/classes/TaskJuggler/XMLComment.html +21 -21
  173. data/doc/classes/TaskJuggler/XMLDocument.html +27 -26
  174. data/doc/classes/TaskJuggler/XMLElement.html +86 -50
  175. data/doc/classes/TaskJuggler/XMLNamedText.html +11 -11
  176. data/doc/classes/TaskJuggler/XMLText.html +36 -36
  177. data/doc/files/COPYING.html +1 -1
  178. data/doc/files/README.html +1 -1
  179. data/doc/files/lib/AccountScenario_rb.html +3 -2
  180. data/doc/files/lib/Account_rb.html +3 -2
  181. data/doc/files/lib/Allocation_rb.html +3 -2
  182. data/doc/files/lib/AppConfig_rb.html +5 -2
  183. data/doc/files/lib/AttributeBase_rb.html +3 -2
  184. data/doc/files/lib/AttributeDefinition_rb.html +3 -2
  185. data/doc/files/lib/Attributes_rb.html +3 -2
  186. data/doc/files/lib/BatchProcessor_rb.html +4 -3
  187. data/doc/files/lib/Booking_rb.html +3 -2
  188. data/doc/files/lib/ChargeSet_rb.html +3 -2
  189. data/doc/files/lib/Charge_rb.html +3 -2
  190. data/doc/files/lib/HTMLDocument_rb.html +3 -2
  191. data/doc/files/lib/Interval_rb.html +3 -2
  192. data/doc/files/lib/Journal_rb.html +4 -3
  193. data/doc/files/lib/KeywordArray_rb.html +3 -2
  194. data/doc/files/lib/KeywordDocumentation_rb.html +3 -2
  195. data/doc/files/lib/Limits_rb.html +3 -2
  196. data/doc/files/lib/Log_rb.html +3 -2
  197. data/doc/files/lib/LogicalExpression_rb.html +3 -2
  198. data/doc/files/lib/LogicalFunction_rb.html +3 -2
  199. data/doc/files/lib/LogicalOperation_rb.html +3 -2
  200. data/doc/files/lib/MacroParser_rb.html +3 -2
  201. data/doc/files/lib/MacroTable_rb.html +3 -2
  202. data/doc/files/lib/MessageHandler_rb.html +3 -2
  203. data/doc/files/lib/Message_rb.html +3 -2
  204. data/doc/files/lib/ProjectFileParser_rb.html +7 -4
  205. data/doc/files/lib/Project_rb.html +3 -2
  206. data/doc/files/lib/PropertyList_rb.html +3 -2
  207. data/doc/files/lib/PropertySet_rb.html +3 -2
  208. data/doc/files/lib/PropertyTreeNode_rb.html +3 -2
  209. data/doc/files/lib/Query_rb.html +3 -2
  210. data/doc/files/lib/{RTPNavigator_rb.html → RTFNavigator_rb.html} +8 -7
  211. data/doc/files/lib/RTFQuery_rb.html +121 -0
  212. data/doc/files/lib/{RTPReport_rb.html → RTFReport_rb.html} +8 -7
  213. data/doc/files/lib/RealFormat_rb.html +3 -2
  214. data/doc/files/lib/RemoteServiceManager_rb.html +117 -0
  215. data/doc/files/lib/ReportServer_rb.html +107 -0
  216. data/doc/files/lib/ResourceScenario_rb.html +3 -2
  217. data/doc/files/lib/Resource_rb.html +3 -2
  218. data/doc/files/lib/RichTextDocument_rb.html +4 -3
  219. data/doc/files/lib/RichTextElement_rb.html +3 -2
  220. data/doc/files/lib/{RichTextProtocolExample_rb.html → RichTextFunctionExample_rb.html} +8 -7
  221. data/doc/files/lib/{RichTextProtocolHandler_rb.html → RichTextFunctionHandler_rb.html} +7 -6
  222. data/doc/files/lib/RichTextParser_rb.html +3 -2
  223. data/doc/files/lib/RichTextScanner_rb.html +3 -2
  224. data/doc/files/lib/RichTextSnip_rb.html +3 -2
  225. data/doc/files/lib/RichTextSyntaxRules_rb.html +3 -2
  226. data/doc/files/lib/RichText_rb.html +3 -2
  227. data/doc/files/lib/ScenarioData_rb.html +3 -2
  228. data/doc/files/lib/Scenario_rb.html +3 -2
  229. data/doc/files/lib/Scoreboard_rb.html +3 -2
  230. data/doc/files/lib/ShiftAssignments_rb.html +3 -2
  231. data/doc/files/lib/ShiftScenario_rb.html +3 -2
  232. data/doc/files/lib/Shift_rb.html +3 -2
  233. data/doc/files/lib/SourceFileInfo_rb.html +3 -2
  234. data/doc/files/lib/SyntaxReference_rb.html +3 -2
  235. data/doc/files/lib/TOCEntry_rb.html +3 -2
  236. data/doc/files/lib/TableColumnDefinition_rb.html +3 -2
  237. data/doc/files/lib/TableOfContents_rb.html +3 -2
  238. data/doc/files/lib/TaskDependency_rb.html +3 -2
  239. data/doc/files/lib/TaskJuggler_rb.html +7 -2
  240. data/doc/files/lib/TaskScenario_rb.html +3 -2
  241. data/doc/files/lib/Task_rb.html +3 -2
  242. data/doc/files/lib/TextParser/Pattern_rb.html +4 -3
  243. data/doc/files/lib/TextParser/Rule_rb.html +4 -3
  244. data/doc/files/lib/TextParser/StackElement_rb.html +4 -3
  245. data/doc/files/lib/TextParser/TokenDoc_rb.html +4 -3
  246. data/doc/files/lib/TextParser_rb.html +3 -2
  247. data/doc/files/lib/TextScanner_rb.html +3 -2
  248. data/doc/files/lib/Tj3Config_rb.html +3 -2
  249. data/doc/files/lib/TjException_rb.html +3 -2
  250. data/doc/files/lib/TjTime_rb.html +3 -2
  251. data/doc/files/lib/TjpExample_rb.html +3 -2
  252. data/doc/files/lib/TjpSyntaxRules_rb.html +3 -2
  253. data/doc/files/lib/UTF8String_rb.html +14 -6
  254. data/doc/files/lib/UserManual_rb.html +6 -3
  255. data/doc/files/lib/WorkingHours_rb.html +3 -2
  256. data/doc/files/lib/XMLDocument_rb.html +3 -2
  257. data/doc/files/lib/XMLElement_rb.html +3 -2
  258. data/doc/files/lib/deep_copy_rb.html +3 -2
  259. data/doc/files/lib/reports/CSVFile_rb.html +3 -2
  260. data/doc/files/lib/reports/ColumnTable_rb.html +3 -2
  261. data/doc/files/lib/reports/GanttChart_rb.html +3 -2
  262. data/doc/files/lib/reports/GanttContainer_rb.html +3 -2
  263. data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +3 -2
  264. data/doc/files/lib/reports/GanttHeader_rb.html +3 -2
  265. data/doc/files/lib/reports/GanttLine_rb.html +3 -2
  266. data/doc/files/lib/reports/GanttLoadStack_rb.html +3 -2
  267. data/doc/files/lib/reports/GanttMilestone_rb.html +3 -2
  268. data/doc/files/lib/reports/GanttRouter_rb.html +3 -2
  269. data/doc/files/lib/reports/GanttTaskBar_rb.html +3 -2
  270. data/doc/files/lib/reports/HTMLGraphics_rb.html +3 -2
  271. data/doc/files/lib/reports/Navigator_rb.html +3 -2
  272. data/doc/files/lib/reports/ReportBase_rb.html +3 -2
  273. data/doc/files/lib/reports/ReportContext_rb.html +3 -2
  274. data/doc/files/lib/reports/ReportTableCell_rb.html +3 -2
  275. data/doc/files/lib/reports/ReportTableColumn_rb.html +3 -2
  276. data/doc/files/lib/reports/ReportTableLegend_rb.html +3 -2
  277. data/doc/files/lib/reports/ReportTableLine_rb.html +3 -2
  278. data/doc/files/lib/reports/ReportTable_rb.html +3 -2
  279. data/doc/files/lib/reports/Report_rb.html +7 -2
  280. data/doc/files/lib/reports/ResourceListRE_rb.html +3 -2
  281. data/doc/files/lib/reports/TableReport_rb.html +3 -2
  282. data/doc/files/lib/reports/TaskListRE_rb.html +3 -2
  283. data/doc/files/lib/reports/TextReport_rb.html +4 -3
  284. data/doc/files/lib/reports/TimeSheetReport_rb.html +117 -0
  285. data/doc/files/lib/reports/TjpExportRE_rb.html +3 -2
  286. data/doc/files/lib/taskjuggler3_rb.html +94 -77
  287. data/doc/files/lib/tj3client_rb.html +280 -0
  288. data/doc/files/lib/tj3man_rb.html +10 -9
  289. data/doc/fr_class_index.html +27 -5
  290. data/doc/fr_file_index.html +15 -7
  291. data/doc/fr_method_index.html +1312 -1020
  292. data/examples/tutorial.tjp +113 -14
  293. data/gem_spec.rb +2 -1
  294. data/lib/Account.rb +1 -1
  295. data/lib/AccountScenario.rb +1 -1
  296. data/lib/Allocation.rb +1 -1
  297. data/lib/AppConfig.rb +23 -10
  298. data/lib/AttributeBase.rb +34 -6
  299. data/lib/AttributeDefinition.rb +1 -1
  300. data/lib/Attributes.rb +51 -16
  301. data/lib/BatchProcessor.rb +204 -77
  302. data/lib/Booking.rb +1 -1
  303. data/lib/Charge.rb +1 -1
  304. data/lib/ChargeSet.rb +1 -1
  305. data/lib/HTMLDocument.rb +2 -2
  306. data/lib/Interval.rb +1 -1
  307. data/lib/Journal.rb +231 -9
  308. data/lib/KeywordArray.rb +1 -1
  309. data/lib/KeywordDocumentation.rb +6 -4
  310. data/lib/Limits.rb +1 -1
  311. data/lib/Log.rb +8 -1
  312. data/lib/LogicalExpression.rb +14 -13
  313. data/lib/LogicalFunction.rb +88 -14
  314. data/lib/LogicalOperation.rb +124 -53
  315. data/lib/MacroParser.rb +1 -1
  316. data/lib/MacroTable.rb +2 -2
  317. data/lib/Message.rb +1 -1
  318. data/lib/MessageHandler.rb +7 -3
  319. data/lib/Project.rb +93 -14
  320. data/lib/ProjectFileParser.rb +30 -15
  321. data/lib/PropertyList.rb +103 -36
  322. data/lib/PropertySet.rb +22 -10
  323. data/lib/PropertyTreeNode.rb +120 -15
  324. data/lib/Query.rb +119 -48
  325. data/lib/{RTPNavigator.rb → RTFNavigator.rb} +11 -10
  326. data/lib/RTFQuery.rb +166 -0
  327. data/lib/{RTPReport.rb → RTFReport.rb} +11 -8
  328. data/lib/RealFormat.rb +1 -1
  329. data/lib/RemoteServiceManager.rb +80 -0
  330. data/lib/ReportServer.rb +66 -0
  331. data/lib/Resource.rb +1 -1
  332. data/lib/ResourceScenario.rb +48 -19
  333. data/lib/RichText.rb +98 -41
  334. data/lib/RichTextDocument.rb +10 -8
  335. data/lib/RichTextElement.rb +72 -28
  336. data/lib/{RichTextProtocolExample.rb → RichTextFunctionExample.rb} +8 -7
  337. data/lib/{RichTextProtocolHandler.rb → RichTextFunctionHandler.rb} +12 -14
  338. data/lib/RichTextParser.rb +6 -3
  339. data/lib/RichTextScanner.rb +91 -19
  340. data/lib/RichTextSnip.rb +8 -3
  341. data/lib/RichTextSyntaxRules.rb +103 -45
  342. data/lib/Scenario.rb +1 -1
  343. data/lib/ScenarioData.rb +2 -2
  344. data/lib/Scoreboard.rb +1 -1
  345. data/lib/Shift.rb +1 -1
  346. data/lib/ShiftAssignments.rb +1 -1
  347. data/lib/ShiftScenario.rb +1 -1
  348. data/lib/SourceFileInfo.rb +1 -1
  349. data/lib/SyntaxReference.rb +2 -2
  350. data/lib/TOCEntry.rb +1 -1
  351. data/lib/TableColumnDefinition.rb +59 -16
  352. data/lib/TableOfContents.rb +1 -1
  353. data/lib/Task.rb +1 -1
  354. data/lib/TaskDependency.rb +1 -1
  355. data/lib/TaskJuggler.rb +31 -8
  356. data/lib/TaskScenario.rb +165 -16
  357. data/lib/TextParser.rb +36 -22
  358. data/lib/TextParser/Pattern.rb +3 -3
  359. data/lib/TextParser/Rule.rb +2 -2
  360. data/lib/TextParser/StackElement.rb +4 -3
  361. data/lib/TextParser/TokenDoc.rb +2 -2
  362. data/lib/TextScanner.rb +52 -37
  363. data/lib/Tj3Config.rb +6 -5
  364. data/lib/TjException.rb +1 -1
  365. data/lib/TjTime.rb +12 -3
  366. data/lib/TjpExample.rb +1 -1
  367. data/lib/TjpSyntaxRules.rb +1044 -150
  368. data/lib/UTF8String.rb +2 -1
  369. data/lib/UserManual.rb +18 -70
  370. data/lib/WorkingHours.rb +3 -3
  371. data/lib/XMLDocument.rb +3 -2
  372. data/lib/XMLElement.rb +6 -1
  373. data/lib/deep_copy.rb +1 -1
  374. data/lib/reports/CSVFile.rb +1 -1
  375. data/lib/reports/ColumnTable.rb +9 -9
  376. data/lib/reports/GanttChart.rb +1 -1
  377. data/lib/reports/GanttContainer.rb +1 -1
  378. data/lib/reports/GanttHeader.rb +1 -1
  379. data/lib/reports/GanttHeaderScaleItem.rb +1 -1
  380. data/lib/reports/GanttLine.rb +40 -40
  381. data/lib/reports/GanttLoadStack.rb +1 -1
  382. data/lib/reports/GanttMilestone.rb +1 -1
  383. data/lib/reports/GanttRouter.rb +1 -1
  384. data/lib/reports/GanttTaskBar.rb +1 -1
  385. data/lib/reports/HTMLGraphics.rb +1 -1
  386. data/lib/reports/Navigator.rb +149 -22
  387. data/lib/reports/Report.rb +115 -172
  388. data/lib/reports/ReportBase.rb +22 -27
  389. data/lib/reports/ReportContext.rb +29 -15
  390. data/lib/reports/ReportTable.rb +1 -1
  391. data/lib/reports/ReportTableCell.rb +120 -27
  392. data/lib/reports/ReportTableColumn.rb +3 -3
  393. data/lib/reports/ReportTableLegend.rb +1 -1
  394. data/lib/reports/ReportTableLine.rb +10 -2
  395. data/lib/reports/ResourceListRE.rb +5 -1
  396. data/lib/reports/TableReport.rb +237 -287
  397. data/lib/reports/TaskListRE.rb +5 -1
  398. data/lib/reports/TextReport.rb +7 -4
  399. data/lib/reports/TimeSheetReport.rb +233 -0
  400. data/lib/reports/TjpExportRE.rb +2 -2
  401. data/lib/taskjuggler3.rb +27 -11
  402. data/lib/tj3client.rb +110 -0
  403. data/lib/tj3man.rb +4 -4
  404. data/manual/Getting_Started +0 -50
  405. data/manual/How_To_Contribute +6 -13
  406. data/manual/Installation +102 -28
  407. data/manual/Intro +11 -1
  408. data/manual/Reporting_Bugs +23 -7
  409. data/manual/Rich_Text_Attributes +59 -6
  410. data/manual/TaskJuggler_2x_Migration +27 -0
  411. data/manual/The_TaskJuggler_Syntax +104 -0
  412. data/manual/Tutorial +10 -9
  413. data/prj_cfg.rb +8 -2
  414. data/tasks/csts.rake +1 -1
  415. data/tasks/manual.rake +5 -3
  416. data/test/MessageChecker.rb +1 -1
  417. data/test/TestSuite/HTML-Reports/Alerts.html +172 -0
  418. data/test/TestSuite/HTML-Reports/Alerts.tjp +77 -0
  419. data/test/TestSuite/HTML-Reports/CellText.html +758 -0
  420. data/test/TestSuite/HTML-Reports/CellText.tjp +75 -0
  421. data/test/TestSuite/HTML-Reports/ColumnPeriods.html +156 -0
  422. data/test/TestSuite/HTML-Reports/ColumnPeriods.tjp +44 -0
  423. data/test/TestSuite/HTML-Reports/IsOngoing.html +172 -0
  424. data/test/TestSuite/HTML-Reports/IsOngoing.tjp +34 -0
  425. data/test/TestSuite/HTML-Reports/LogicalFunctions.html +80 -0
  426. data/test/TestSuite/HTML-Reports/LogicalFunctions.tjp +20 -0
  427. data/test/TestSuite/HTML-Reports/Query.html +31 -0
  428. data/test/TestSuite/HTML-Reports/Query.tjp +28 -0
  429. data/test/TestSuite/HTML-Reports/Sorting.tjp +68 -0
  430. data/test/TestSuite/HTML-Reports/TimeSheet.tjp +69 -0
  431. data/test/TestSuite/HTML-Reports/UDAQuery.tjp +27 -0
  432. data/test/TestSuite/HTML-Reports/css/tjmanual.css +52 -0
  433. data/test/TestSuite/HTML-Reports/css/tjreport.css +195 -0
  434. data/test/TestSuite/HTML-Reports/depArrows.html +842 -0
  435. data/test/TestSuite/HTML-Reports/icons/details.png +0 -0
  436. data/test/TestSuite/HTML-Reports/icons/flag-green.png +0 -0
  437. data/test/TestSuite/HTML-Reports/icons/flag-red.png +0 -0
  438. data/test/TestSuite/HTML-Reports/icons/flag-yellow.png +0 -0
  439. data/test/TestSuite/HTML-Reports/icons/resource.png +0 -0
  440. data/test/TestSuite/HTML-Reports/icons/resourcegroup.png +0 -0
  441. data/test/TestSuite/HTML-Reports/icons/task.png +0 -0
  442. data/test/TestSuite/HTML-Reports/icons/taskgroup.png +0 -0
  443. data/test/TestSuite/HTML-Reports/reference.tjp +7 -8
  444. data/test/TestSuite/HTML-Reports/scripts/scripts/wz_tooltip.js +1301 -0
  445. data/test/TestSuite/HTML-Reports/scripts/wz_tooltip.js +1301 -0
  446. data/test/TestSuite/Scheduler/Correct/Mandatory.tjp +34 -0
  447. data/test/TestSuite/Syntax/Correct/Celltext.tjp +2 -1
  448. data/test/TestSuite/Syntax/Correct/Journal.tjp +2 -2
  449. data/test/TestSuite/Syntax/Correct/LogicalExpression.tjp +2 -1
  450. data/test/TestSuite/Syntax/Correct/LogicalFunction.tjp +20 -0
  451. data/test/TestSuite/Syntax/Correct/Query.tjp +18 -0
  452. data/test/TestSuite/Syntax/Correct/StatusSheet.tjp +45 -0
  453. data/test/TestSuite/Syntax/Correct/TimeSheet.tjp +49 -0
  454. data/test/TestSuite/Syntax/Correct/icons/details.png +0 -0
  455. data/test/TestSuite/Syntax/Correct/icons/flag-green.png +0 -0
  456. data/test/TestSuite/Syntax/Correct/icons/flag-red.png +0 -0
  457. data/test/TestSuite/Syntax/Correct/icons/flag-yellow.png +0 -0
  458. data/test/TestSuite/Syntax/Correct/icons/resource.png +0 -0
  459. data/test/TestSuite/Syntax/Correct/icons/resourcegroup.png +0 -0
  460. data/test/TestSuite/Syntax/Correct/icons/task.png +0 -0
  461. data/test/TestSuite/Syntax/Correct/icons/taskgroup.png +0 -0
  462. data/test/TestSuite/Syntax/Correct/scripts/wz_tooltip.js +1301 -0
  463. data/test/TestSuite/Syntax/Correct/tutorial.tjp +113 -14
  464. data/test/TestSuite/Syntax/Errors/macro_stack_overflow.tjp +28 -0
  465. data/test/TestSuite/Syntax/Errors/unsupported_token.tjp +12 -0
  466. data/test/all.rb +2 -2
  467. data/test/test_BatchProcessor.rb +42 -13
  468. data/test/test_CSV-Reports.rb +1 -1
  469. data/test/test_Journal.rb +176 -0
  470. data/test/test_Limits.rb +1 -1
  471. data/test/test_LogicalExpression.rb +14 -5
  472. data/test/test_MacroTable.rb +1 -1
  473. data/test/test_Project.rb +1 -1
  474. data/test/test_PropertySet.rb +1 -1
  475. data/test/test_Query.rb +1 -1
  476. data/test/test_RealFormat.rb +1 -1
  477. data/test/test_RichText.rb +30 -20
  478. data/test/test_Scheduler.rb +1 -1
  479. data/test/test_ShiftAssignments.rb +2 -2
  480. data/test/test_Syntax.rb +1 -1
  481. data/test/test_TextScanner.rb +1 -1
  482. data/test/test_TjTime.rb +1 -1
  483. data/test/test_TjpExample.rb +1 -1
  484. data/test/test_UTF8String.rb +1 -1
  485. data/test/test_WorkingHours.rb +1 -1
  486. data/test/test_deep_copy.rb +2 -2
  487. metadata +610 -532
  488. data/doc/files/lib/ms_test_rb.html +0 -90
  489. data/examples/ContactList.html +0 -1467
  490. data/examples/Deliveries.html +0 -485
  491. data/examples/Development.html +0 -2525
  492. data/examples/Overview.html +0 -747
  493. data/examples/Resource Graph.html +0 -616
  494. data/lib/ms_test.rb +0 -27
  495. data/test/TestSuite/HTML-Reports/reference-export.html +0 -187
data/lib/TjpExample.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # = TjpExample.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
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # = TjpSyntaxRules.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
@@ -40,7 +40,7 @@ EOT
40
40
  optional
41
41
  pattern(%w( !account))
42
42
  pattern(%w( !accountScenarioAttributes ))
43
- pattern(%w( !scenarioId !accountScenarioAttributes ), lambda {
43
+ pattern(%w( !scenarioIdCol !accountScenarioAttributes ), lambda {
44
44
  @scenarioIdx = 0
45
45
  })
46
46
  # Other attributes will be added automatically.
@@ -91,9 +91,39 @@ EOT
91
91
  example('Account', '1')
92
92
  arg(2, 'description', 'Short description of the transaction')
93
93
  arg(3, 'amount', 'Amount to be booked.')
94
+
95
+ pattern(%w( !flags ))
96
+ doc('flags.account', <<'EOT'
97
+ Attach a set of flags. The flags can be used in logical expressions to filter
98
+ properties from the reports.
99
+ EOT
100
+ )
101
+
94
102
  # Other attributes will be added automatically.
95
103
  end
96
104
 
105
+ def rule_alertLevel
106
+ pattern(%w( $ID ), lambda {
107
+ level = @project.alertLevelIndex(@val[0])
108
+ unless level
109
+ error('bad_alert', "Unknown alert level #{@val[1]}. Must be " +
110
+ 'green, yellow or red')
111
+ end
112
+ level
113
+ })
114
+ doc('alert level', <<'EOT'
115
+ Specify the alert level for this entry. Supported values are green, yellow and
116
+ red. The default value is green. This attribute is inteded to be used for
117
+ status reporting. When used for a journal entry that is associated with a
118
+ property, the value can be reported in the alert column. When multiple entries
119
+ have been specified for the property, the entry with the date closest to the
120
+ report end date will be used. Container properties will inherit the highest
121
+ alert level of all its sub properties unless it has an own journal entry dated
122
+ closer to the report end than all of its sub properties.
123
+ EOT
124
+ )
125
+ end
126
+
97
127
  def rule_allocate
98
128
  pattern(%w( _allocate !allocations ), lambda {
99
129
  checkContainer('allocate')
@@ -146,7 +176,7 @@ EOT
146
176
  end
147
177
  end
148
178
  })
149
- doc('allocate.limits', 'This keyword is deprecated. Don\'t use it anymore!')
179
+ doc('limits.allocate', 'This keyword is deprecated. Don\'t use it anymore!')
150
180
 
151
181
  pattern(%w( _select !allocationSelectionMode ), lambda {
152
182
  @allocate.setSelectionMode(@val[1])
@@ -247,12 +277,11 @@ EOT
247
277
  end
248
278
 
249
279
  def rule_argument
250
- pattern(%w( $ID ), lambda {
251
- @val[0]
252
- })
253
- pattern(%w( $DATE ), lambda {
254
- @val[0]
255
- })
280
+ singlePattern('$ABSOLUTE_ID')
281
+ singlePattern('!date')
282
+ singlePattern('$ID')
283
+ singlePattern('$INTEGER')
284
+ singlePattern('$FLOAT')
256
285
  end
257
286
 
258
287
  def rule_argumentList
@@ -269,6 +298,17 @@ EOT
269
298
  })
270
299
  end
271
300
 
301
+ def rule_author
302
+ pattern(%w( _author !resourceId ), lambda {
303
+ @journalEntry.author = @val[1]
304
+ })
305
+ doc('author', <<'EOT'
306
+ This attribute can be used to capture the authorship or source of the
307
+ information.
308
+ EOT
309
+ )
310
+ end
311
+
272
312
  def rule_balance
273
313
  pattern(%w( _balance !accountId !accountId ), lambda {
274
314
  if @val[1].parent
@@ -434,6 +474,22 @@ EOT
434
474
  descr('Set chart resolution to 1 year.')
435
475
  end
436
476
 
477
+ def rule_color
478
+ pattern(%w( $STRING ), lambda {
479
+ col = @val[0]
480
+ unless /#[0-9A-Fa-f]{3}/ =~ col || /#[0-9A-Fa-f]{3}/ =~ col
481
+ error('bad_color',
482
+ "Color values must be specified as '#RGB' or '#RRGGBB' values")
483
+ end
484
+ col
485
+ })
486
+ arg(0, 'color', <<'EOT'
487
+ The RGB color values of the color. The following formats are supported: #RGB
488
+ and #RRGGBB. Where R, G, B are hexadecimal values. See
489
+ [http://en.wikipedia.org/wiki/Web_colors Wikipedia] for more details.
490
+ EOT
491
+ )
492
+ end
437
493
 
438
494
  def rule_columnBody
439
495
  optionsRule('columnOptions')
@@ -462,51 +518,84 @@ EOT
462
518
  optional
463
519
  repeatable
464
520
 
465
- pattern(%w( _celltext $STRING ), lambda {
466
- @column.cellText = @val[1]
521
+ pattern(%w( _celltext !logicalExpression $STRING ), lambda {
522
+ @column.cellText.addPattern(
523
+ CellSettingPattern.new(newRichText(@val[2]), @val[1]))
467
524
  })
468
525
  doc('celltext.column', <<'EOT'
469
526
  Specifies an alternative content that is used for the cells of the column.
470
- Usually such a text contains a runtime macro, otherwise all cells of the
471
- column will have the same fixed value.
527
+ Usually such a text contains a query function. Otherwise all cells of the
528
+ column will have the same fixed value. The logical expression specifies for
529
+ which cells the text should be used. If multiple celltext patterns are
530
+ provided for a column, the first matching one is taken for each cell.
472
531
  EOT
473
532
  )
474
- arg(1, 'text', 'Alterntive cell text')
533
+ arg(1, 'text',
534
+ 'Alterntive cell text specified as [[Rich_Text_Attributes Rich Text]]')
475
535
 
476
- pattern(%w( _cellurl $STRING ), lambda {
477
- @column.cellURL = @val[1]
536
+ pattern(%w( _cellcolor !logicalExpression !color ), lambda {
537
+ @column.cellColor.addPattern(
538
+ CellSettingPattern.new(@val[2], @val[1]))
478
539
  })
479
- doc('cellurl.column', <<'EOT'
480
- Specifies a URL that is associated with the content of the cell.
481
- Usually such a URL contains a runtime macro, otherwise all cells of the
482
- column will have the same fixed URL.
540
+ doc('cellcolor.column', <<'EOT'
541
+ Specifies an alternative background color for the cells of this column. The
542
+ logical expression specifies for which cells the color should be used. If
543
+ multiple cellcolor patterns are provided for a column, the first
544
+ matching one is used for each cell.
483
545
  EOT
484
- )
485
- arg(1, 'text', 'Hyperlink address (e.g. http://www.taskjuggler.org)')
546
+ )
486
547
 
487
- pattern(%w( _hidecelltext !logicalExpression ), lambda {
488
- @column.hideCellText = @val[1]
548
+ pattern(%w( _end !date ), lambda {
549
+ @column.end = @val[1]
489
550
  })
490
- doc('hidecelltext', <<'EOT'
491
- This logical expression is evaluated during report generation for each report
492
- cell. If it evaluates to true, the cell will have no content.
551
+ doc('end.column', <<'EOT'
552
+ Normally, columns with calculated values take the specified report period into
553
+ account when calculating their values. With this attribute, the user can
554
+ specify an end date for the period that should be used when calculating the
555
+ values of this column. It does not have an impact on column with time
556
+ invariant values.
493
557
  EOT
494
- )
558
+ )
495
559
 
496
- pattern(%w( _hidecellurl !logicalExpression ), lambda {
497
- @column.hideCellURL = @val[1]
560
+ pattern(%w( _fontcolor !logicalExpression !color ), lambda {
561
+ @column.fontColor.addPattern(
562
+ CellSettingPattern.new(@val[2], @val[1]))
498
563
  })
499
- doc('hidecellurl', <<'EOT'
500
- This logical expression is evaluated during report generation for each report
501
- cell. If it evaluates to true, the cell will have no URL attached.
564
+ doc('fontcolor.column', <<'EOT'
565
+ Specifies an alternative font color for the cells of this column. The
566
+ logical expression specifies for which cells the color should be used. If
567
+ multiple fontcolor patterns are provided for a column, the first
568
+ matching one is used for each cell.
502
569
  EOT
503
- )
570
+ )
571
+
572
+ pattern(%w( _period !interval ), lambda {
573
+ @column.start = @val[1].start
574
+ @column.end = @val[1].end
575
+ })
576
+ doc('period.column', <<'EOT'
577
+ This property is a shortcut for setting the [[start.column start]] and
578
+ [[end.column end]] property at the same time.
579
+ EOT
580
+ )
504
581
 
505
582
  pattern(%w( _scale !chartScale ), lambda {
506
583
  @column.scale = @val[1]
507
584
  })
508
585
  doc('scale.column', <<'EOT'
509
586
  Specifies the scale that should be used for a chart column. This value is ignored for all other columns.
587
+ EOT
588
+ )
589
+
590
+ pattern(%w( _start !date ), lambda {
591
+ @column.start = @val[1]
592
+ })
593
+ doc('start.column', <<'EOT'
594
+ Normally, columns with calculated values take the specified report period into
595
+ account when calculating their values. With this attribute, the user can
596
+ specify a start date for the period that should be used when calculating the
597
+ values of this column. It does not have an impact on column with time
598
+ invariant values.
510
599
  EOT
511
600
  )
512
601
 
@@ -519,20 +608,39 @@ EOT
519
608
  )
520
609
  arg(1, 'text', 'The new column title.')
521
610
 
611
+ pattern(%w( _tooltip !logicalExpression $STRING ), lambda {
612
+ @column.tooltip.addPattern(
613
+ CellSettingPattern.new(newRichText(@val[2]), @val[1]))
614
+ })
615
+ doc('tooltip.column', <<'EOT'
616
+ Specifies an alternative content for the tooltip. This will replace the
617
+ original content of the tooltip that would be available for columns with text
618
+ that does not fit the column with. The logical expression specifies for which
619
+ cells the text should be used. If multiple tooltip patterns are provided for a
620
+ column, the first matching one is taken for each cell.
621
+ EOT
622
+ )
623
+ arg(2, 'text', <<'EOT'
624
+ The content of the tooltip. The text is interpreted as [[Rich_Text_Attributes
625
+ Rich Text]].
626
+ EOT
627
+ )
628
+
522
629
  pattern(%w( _width !number ), lambda {
523
630
  @column.width = @val[1]
524
631
  })
525
632
  doc('width.column', <<'EOT'
526
633
  Specifies the width of the column in screen pixels. If the content of the
527
634
  column does not fit into this width, it will be cut off. In some cases a
528
- scrollbar is added or a popup window is shown when the mouse is moved over the
529
- column. The latter is only supported in interactive output formats.
635
+ scrollbar is added or a tooltip window with the complete content is shown when
636
+ the mouse is moved over the column. The latter is only supported in
637
+ interactive output formats.
530
638
  EOT
531
639
  )
532
640
  end
533
641
 
534
642
  def rule_date
535
- pattern(%w( $DATE ), lambda {
643
+ pattern(%w( !dateCalcedOrNot ), lambda {
536
644
  resolution = @project.nil? ? Project.maxScheduleGranularity :
537
645
  @project['scheduleGranularity']
538
646
  if @val[0] % resolution != 0
@@ -547,15 +655,59 @@ A DATE is an ISO-compliant date in the format
547
655
  ''''<nowiki>YYYY-MM-DD[-hh:mm[:ss]][-TIMEZONE]</nowiki>''''. Hour, minutes,
548
656
  seconds, and the ''''TIMEZONE'''' are optional. If not specified, the values
549
657
  are set to 0. ''''TIMEZONE'''' must be an offset to GMT or UTC, specified as
550
- ''''+HHMM'''' or ''''-HHMM''''. Dates must always be aligned with the [[timingresolution]].
658
+ ''''+HHMM'''' or ''''-HHMM''''. Dates must always be aligned with the
659
+ [[timingresolution]].
660
+
661
+ TaskJuggler also supports simple date calculations. You can add or substract a
662
+ given interval from a fixed date.
663
+
664
+ %{2009-11-01 + 8m}
665
+
666
+ This will result in an actual date of around 2009-07-01. Keep in mind that due to the varying lengths of months TaskJuggler cannot add exactly 8 calendar months. The date calculation functionality makes most sense when used with macros.
667
+
668
+ %{${now} - 2w}
669
+
670
+ This is result in a date 2 weeks earlier than the current (or specified) date.
671
+ See [[duration]] for a complete list of supported time intervals. Don't forget
672
+ to put at least one space character after the date to prevent TaskJuggler from
673
+ interpreting the interval as an hour.
551
674
  EOT
552
675
  )
553
676
  end
554
677
 
678
+ def rule_dateCalcedOrNot
679
+ singlePattern('$DATE')
680
+ pattern(%w( _% _{ $DATE !plusOrMinus !intervalDuration _} ), lambda {
681
+ @val[2] + ((@val[3] == '+' ? 1 : -1) * @val[4])
682
+ })
683
+ end
684
+
555
685
  def rule_declareFlagList
556
686
  listRule('moreDeclareFlagList', '$ID')
557
687
  end
558
688
 
689
+ def rule_details
690
+ pattern(%w( _details $STRING ), lambda {
691
+ rtTokenSetMore =
692
+ %w( LINEBREAK SPACE WORD BOLD ITALIC CODE BOLDITALIC PRE HREF HREFEND
693
+ REF REFEND HLINE TITLE2 TITLE3 TITLE2END TITLE3END BULLET1 BULLET2
694
+ BULLET3 NUMBER1 NUMBER2 NUMBER3 )
695
+ @journalEntry.details = newRichText(@val[1], rtTokenSetMore)
696
+ })
697
+ doc('details', <<'EOT'
698
+ This is a continuation of the [[summary]] of the journal or status entry. It
699
+ can be several paragraphs long.
700
+ EOT
701
+ )
702
+ arg(1, 'text', <<'EOT'
703
+ The text will be interpreted as [[Rich_Text_Attributes Rich Text]]. Only a
704
+ subset of the markup is supported for this attribute. You can use word
705
+ formatting, paragraphs, hyperlinks, lists, section and subsection
706
+ headers.
707
+ EOT
708
+ )
709
+ end
710
+
559
711
  def rule_durationUnit
560
712
  pattern(%w( _min ), lambda { 0 })
561
713
  descr('minutes')
@@ -844,15 +996,38 @@ EOT
844
996
  doc('functions', <<'EOT'
845
997
  The following functions are supported in logical expressions. These functions
846
998
  are evaluated in logical conditions such as hidetask or rollupresource. For
847
- the evaluation, implicit and explicit parameters are used. All functions may
848
- operate on the current property and the scope property. The scope property is
849
- the enclosing property in reports with nested properties. E. g. in a task
850
- report with nested resources, the task is the scope property and the the
851
- resource is the property the the function is called for the resource line. The
852
- explicit parameters are passed in the function call. These arguments may vary
853
- from function to function.
999
+ the evaluation, implicit and explicit parameters are used.
1000
+
1001
+ All functions may operate on the current property and the scope property. The
1002
+ scope property is the enclosing property in reports with nested properties.
1003
+ Imagine e. g a task report with nested resources. When the function is called
1004
+ for a task line, the task is the property and we don't have a scope property.
1005
+ When the function is called for a resource line, the resource is the property
1006
+ and the enclosing task is the scope property.
1007
+
1008
+ These number of arguments that are passed in brackets to the function depends
1009
+ on the specific function. See the reference for details on each function.
1010
+
1011
+ All functions can be suffixed with an underscore character. In that case, the
1012
+ function is operating on the scope property as if it were the property. The
1013
+ original property is ignored in that case. In our task report example from
1014
+ above, calling a function with an appended dash would mean that a task
1015
+ line would be evaluated for the enclosing resource.
1016
+
1017
+ In the example below you can see how this can be used. To generate a task
1018
+ report that lists all assigned leaf resources for leaf task lines only we use
1019
+ the expression
1020
+
1021
+ hideresource ~(isleaf() & isleaf_())
1022
+
1023
+ The tilde in front of the bracketed expression means not that expression. In
1024
+ other words: show resources that are leaf resources and show them for leaf
1025
+ tasks only. The regular form isleaf() (without the appended underscore)
1026
+ operates on the resource. The isleaf_() variant operates on the
1027
+ enclosing task.
854
1028
  EOT
855
1029
  )
1030
+ example('LogicalFunction', '1')
856
1031
  end
857
1032
 
858
1033
  def rule_functionsBody
@@ -862,15 +1037,65 @@ EOT
862
1037
 
863
1038
  def rule_functionPatterns
864
1039
  # This rule is not used by the parser. It's only for the documentation.
1040
+ pattern(%w( _hasalert _( $INTEGER _, !date _) ))
1041
+ doc('hasalert', <<'EOT'
1042
+ Will evaluate to true if the current property has a current alert message within the report time frame and with at least the provided alert level.
1043
+ EOT
1044
+ )
1045
+ arg(2, 'Level', 'The minimum required alert level to be considered.')
1046
+
1047
+ pattern(%w( _isactive _( $ID _) ))
1048
+ doc('isactive', <<'EOT'
1049
+ Will evaluate to true for tasks and resources if they have bookings in
1050
+ the scenario during the report time frame.
1051
+ EOT
1052
+ )
1053
+ arg(2, 'ID', 'A scenario ID')
1054
+
1055
+ pattern(%w( _isdependencyof _( $ID _, $ID _, $INTEGER _) ))
1056
+ doc('isdependencyof', <<'EOT'
1057
+ Will evaluate to true for tasks that depend on the specified task in
1058
+ the specified scenario and are no more than distance tasks away. If
1059
+ distance is 0, all dependencies are considered independent of their
1060
+ distance.
1061
+ EOT
1062
+ )
1063
+ arg(2, 'Task ID', 'The ID of a defined task')
1064
+ arg(4, 'Scenario ID', 'A scenario ID')
1065
+ arg(6, 'Distance', 'The maximum task distance to be considered')
1066
+
1067
+ pattern(%w( _isdutyof _( $ID _, $ID _) ))
1068
+ doc('isdutyof', <<'EOT'
1069
+ Will evaluate to true for tasks that have the specified resource
1070
+ assigned to it in the specified scenario.
1071
+ EOT
1072
+ )
1073
+ arg(2, 'Resource ID', 'The ID of a defined resource')
1074
+ arg(4, 'Scenario ID', 'A scenario ID')
1075
+
865
1076
  pattern(['_isleaf', '_(', '_)' ])
866
1077
  doc('isleaf', 'The result is true if the property is not a container.')
867
1078
 
868
- pattern(['_isresource', '_(', '$ID', '_)' ])
869
- doc('isresource', <<'EOT'
870
- The result is true if the property is a resource with the specified ID.
1079
+ pattern(%w( _isongoing _( $ID _) ))
1080
+ doc('isongoing', <<'EOT'
1081
+ Will evaluate to true for tasks that overlap with the report period in given
1082
+ scenario.
1083
+ EOT
1084
+ )
1085
+ arg(2, 'ID', 'A scenario ID')
1086
+
1087
+ pattern(['_isresource', '_(', '_)' ])
1088
+ doc('isresource', 'The result is true if the property is a resource.')
1089
+
1090
+ pattern(['_istask', '_(', '_)' ])
1091
+ doc('istask', 'The result is true if the property is a task.')
1092
+
1093
+ pattern(%w( _treelevel _( _) ))
1094
+ doc('treelevel', <<'EOT'
1095
+ Returns the nesting level of a property in the property tree.
1096
+ Top level properties have a level of 1, their children 2 and so on.
871
1097
  EOT
872
1098
  )
873
- arg(2, 'ID', 'A resource ID')
874
1099
  end
875
1100
 
876
1101
  def rule_hideresource
@@ -897,6 +1122,11 @@ EOT
897
1122
  )
898
1123
  end
899
1124
 
1125
+ def rule_idOrAbsoluteId
1126
+ singlePattern('$ID')
1127
+ singlePattern('$ABSOLUTE_ID')
1128
+ end
1129
+
900
1130
  def rule_includeAttributes
901
1131
  optionsRule('includeAttributesBody')
902
1132
  end
@@ -950,24 +1180,32 @@ EOT
950
1180
  end
951
1181
 
952
1182
  def rule_includeFile
953
- pattern(%w( $STRING ), lambda {
1183
+ pattern(%w( !includeFileName ), lambda {
954
1184
  @scanner.include(@val[0])
955
1185
  })
1186
+ end
1187
+
1188
+ def rule_includeFileName
1189
+ pattern(%w( $STRING ), lambda {
1190
+ unless @val[0][-4, 4] == '.tji'
1191
+ error('bad_include_suffix', "Included files must have a '.tji'" +
1192
+ "extension: '#{@val[0]}'")
1193
+ end
1194
+ @val[0]
1195
+ })
956
1196
  arg(0, 'filename', <<'EOT'
957
- Name of the file to include. This must have a ''''.tji'''' extension. The name may have an absolute or relative path. You need to use ''''/'''' characters to separate directories.
1197
+ Name of the file to include. This must have a ''''.tji'''' extension. The name
1198
+ may have an absolute or relative path. You need to use ''''/'''' characters to
1199
+ separate directories.
958
1200
  EOT
959
1201
  )
960
1202
  end
961
1203
 
962
1204
  def rule_includeProperties
963
- pattern(%w( $STRING !includeAttributes ), lambda {
1205
+ pattern(%w( !includeFileName !includeAttributes ), lambda {
964
1206
  pushFileStack
965
1207
  @scanner.include(@val[0])
966
1208
  })
967
- arg(0, 'filename', <<'EOT'
968
- Name of the file to include. This must have a ''''.tji'''' extension. The name may have an absolute or relative path. You need to use ''''/'''' characters to separate directories.
969
- EOT
970
- )
971
1209
  end
972
1210
 
973
1211
  def rule_intervalOrDate
@@ -1077,11 +1315,18 @@ EOT
1077
1315
  @val[0]
1078
1316
  })
1079
1317
  doc('journalentry', <<'EOT'
1080
- This attribute adds an entry to the journal of the project. A journal can be used to record events, decisions or news that happened at a particular moment during the project. Depending on the context, a journal entry may or may not be associated with a specific property.
1318
+ This attribute adds an entry to the journal of the project. A journal can be
1319
+ used to record events, decisions or news that happened at a particular moment
1320
+ during the project. Depending on the context, a journal entry may or may not
1321
+ be associated with a specific property or author.
1081
1322
 
1082
- A journal entry consists of three parts. The headline is mandatory and should be only 5 to 10 words long. The introduction is optional and should be only one or two sentences long. All other details should be put into the third part.
1323
+ A journal entry can consists of up to three parts. The headline is mandatory
1324
+ and should be only 5 to 10 words long. The introduction is optional and should
1325
+ be only one or two sentences long. All other details should be put into the
1326
+ third part.
1083
1327
 
1084
- Depending on the context, journal entries are listed with headlines only, as headlines plus introduction or in full.
1328
+ Depending on the context, journal entries are listed with headlines only, as
1329
+ headlines plus introduction or in full.
1085
1330
  EOT
1086
1331
  )
1087
1332
  end
@@ -1090,31 +1335,35 @@ EOT
1090
1335
  optional
1091
1336
  repeatable
1092
1337
 
1093
- pattern(%w( _intro $STRING ), lambda {
1094
- @journalEntry.intro = newRichText(@val[1])
1338
+ pattern(%w( _alert $ID ), lambda {
1339
+ level = @project.alertLevelIndex(@val[1])
1340
+ unless level
1341
+ error('bad_alert', "Unknown alert level #{@val[1]}. Must be " +
1342
+ 'green, yellow or red')
1343
+ end
1344
+ @journalEntry.alertLevel = level
1095
1345
  })
1096
- doc('intro', <<'EOT'
1097
- This is the introductory part of the journal entry. It should summarize the
1098
- full entry but should contain more details than the headline.
1099
- EOT
1100
- )
1101
- arg(1, 'text', <<'EOT'
1102
- The text will be interpreted as [[Rich_Text_Attributes Rich Text]].
1346
+ doc('alert', <<'EOT'
1347
+ Specify the alert level for this entry. Supported values are green, yellow and
1348
+ red. The default value is green. This attribute is inteded to be used for
1349
+ status reporting. When used for a journal entry that is associated with a
1350
+ property, the value can be reported in the alert column. When multiple entries
1351
+ have been specified for the property, the entry with the date closest to the
1352
+ report end date will be used. Container properties will inherit the highest
1353
+ alert level of all its sub properties unless it has an own journal entry dated
1354
+ closer to the report end than all of its sub properties.
1103
1355
  EOT
1104
1356
  )
1105
1357
 
1106
- pattern(%w( _more $STRING ), lambda {
1107
- @journalEntry.more = newRichText(@val[1])
1358
+ pattern(%w( !author ))
1359
+
1360
+ pattern(%w( !summary ), lambda {
1361
+ @journalEntry.summary = @val[0]
1362
+ })
1363
+
1364
+ pattern(%w( !details ), lambda {
1365
+ @journalEntry.details = @val[0]
1108
1366
  })
1109
- doc('more', <<'EOT'
1110
- This is a continuation of the [[intro introduction]] of the journal entry. It
1111
- is usually several paragraphs long.
1112
- EOT
1113
- )
1114
- arg(1, 'text', <<'EOT'
1115
- The text will be interpreted as [[Rich_Text_Attributes Rich Text]].
1116
- EOT
1117
- )
1118
1367
  end
1119
1368
 
1120
1369
  def rule_journalEntryBody
@@ -1124,8 +1373,13 @@ EOT
1124
1373
  def rule_journalEntryHeader
1125
1374
  pattern(%w( _journalentry !valDate $STRING ), lambda {
1126
1375
  @journalEntry = JournalEntry.new(@project['journal'], @val[1], @val[2],
1127
- @property)
1376
+ @property, @scanner.sourceFileInfo)
1128
1377
  })
1378
+ arg(2, 'headline', <<'EOT'
1379
+ The headline of the journal entry. It will be interpreted as
1380
+ [[Rich_Text_Attributes Rich Text]].
1381
+ EOT
1382
+ )
1129
1383
  end
1130
1384
  def rule_leafResourceId
1131
1385
  pattern(%w( !resourceId ), lambda {
@@ -1311,36 +1565,36 @@ EOT
1311
1565
  end
1312
1566
 
1313
1567
  def rule_loadunit
1314
- singlePattern('_days')
1568
+ pattern([ '_days' ], lambda { :days })
1315
1569
  descr('Display all load and duration values as days.')
1316
1570
 
1317
- singlePattern('_hours')
1571
+ pattern([ '_hours' ], lambda { :hours })
1318
1572
  descr('Display all load and duration values as hours.')
1319
1573
 
1320
- singlePattern('_longauto')
1574
+ pattern([ '_longauto'] , lambda { :longauto })
1321
1575
  descr(<<'EOT'
1322
1576
  Automatically select the unit that produces the shortest and most readable
1323
1577
  value. The unit name will not be abbreviated.
1324
1578
  EOT
1325
1579
  )
1326
1580
 
1327
- singlePattern('_minutes')
1581
+ pattern([ '_minutes' ], lambda { :minutes })
1328
1582
  descr('Display all load and duration values as minutes.')
1329
1583
 
1330
- singlePattern('_months')
1584
+ pattern([ '_months' ], lambda { :months })
1331
1585
  descr('Display all load and duration values as monts.')
1332
1586
 
1333
- singlePattern('_shortauto')
1587
+ pattern([ '_shortauto' ], lambda { :shortauto })
1334
1588
  descr(<<'EOT'
1335
1589
  Automatically select the unit that produces the shortest and most readable
1336
1590
  value. The unit name will be abbreviated.
1337
1591
  EOT
1338
1592
  )
1339
1593
 
1340
- singlePattern('_weeks')
1594
+ pattern([ '_weeks' ], lambda { :weeks })
1341
1595
  descr('Display all load and duration values as weeks.')
1342
1596
 
1343
- singlePattern('_years')
1597
+ pattern([ '_years' ], lambda { :years })
1344
1598
  descr('Display all load and duration values as years.')
1345
1599
  end
1346
1600
 
@@ -1351,13 +1605,15 @@ EOT
1351
1605
  doc('logicalexpression', <<'EOT'
1352
1606
  A logical expression is a combination of operands and mathematical operations.
1353
1607
  The final result of a logical expression is always true or false. Logical
1354
- expressions are used the reduce the properties in a report to a certain
1355
- subset. If the logical expression evaluates to true for a certain property,
1356
- this property is hidden or rolled-up in the report.
1608
+ expressions are used the reduce the properties in a report to a certain subset
1609
+ or to select alternatives for the cell content of a table. When used with
1610
+ attributes like [[hidetask]] or [[hideresource]] the logical expression
1611
+ evaluates to true for a certain property, this property is hidden or rolled-up
1612
+ in the report.
1357
1613
 
1358
- Operands can be declared flags, built-in functions, property attributes
1614
+ Operands can be declared flags, built-in [[functions]], property attributes
1359
1615
  (specified as scenario.attribute) or another logical expression. The latter
1360
- should be enclosed in brackets to avoid ambiguities.
1616
+ should be enclosed in brackets to avoid ambiguities. An operand can also be just a number. 0 evaluates to false, all other numbers to true.
1361
1617
  EOT
1362
1618
  )
1363
1619
  also(%w( functions ))
@@ -1392,6 +1648,10 @@ Macros may call other macros.
1392
1648
  User defined macro IDs must have at least one uppercase letter as all
1393
1649
  lowercase letter IDs are reserved for built-in macros.
1394
1650
 
1651
+ Macro definitions may contain ''''<nowiki>]</nowiki>'''' as long as each
1652
+ ''''<nowiki>]</nowiki>'''' is preceeded by a corresponding
1653
+ ''''<nowiki>[</nowiki>''''.
1654
+
1395
1655
  In macro calls the macro names can be prefixed by a question mark. In this
1396
1656
  case the macro will expand to nothing if the macro is not defined. Otherwise
1397
1657
  the undefined macro would be flagged with an error message.
@@ -1406,6 +1666,12 @@ EOT
1406
1666
  example('Macro-1')
1407
1667
  end
1408
1668
 
1669
+ def rule_moreBangs
1670
+ optional
1671
+ repeatable
1672
+ singlePattern('_!')
1673
+ end
1674
+
1409
1675
  def rule_moreAlternatives
1410
1676
  commaListRule('!resourceId')
1411
1677
  end
@@ -1551,23 +1817,44 @@ EOT
1551
1817
  end
1552
1818
 
1553
1819
  def rule_operation
1554
- pattern(%w( !operand !operatorAndOperand ), lambda {
1820
+ pattern(%w( !operand !operatorAndOperand !operationChain ), lambda {
1555
1821
  operation = LogicalOperation.new(@val[0])
1556
1822
  unless @val[1].nil?
1557
1823
  operation.operator = @val[1][0]
1558
1824
  operation.operand2 = @val[1][1]
1559
1825
  end
1826
+ if @val[2]
1827
+ # Further operators/operands create an operation tree.
1828
+ @val[2].each do |ops|
1829
+ operation = LogicalOperation.new(operation)
1830
+ operation.operator = ops[0]
1831
+ operation.operand2 = ops[1]
1832
+ end
1833
+ end
1560
1834
  operation
1561
1835
  })
1562
1836
  arg(0, 'operand', <<'EOT'
1563
- An operand can consist of a date, a text string or a numerical value. It can
1564
- also be the name of a declared flag. Finally, an operand can be a negated
1565
- operand by prefixing a ~ charater or it can be another logical expression
1566
- enclosed in braces.
1837
+ An operand can consist of a date, a text string, a [[functions function]], a
1838
+ property attribute or a numerical value. It can also be the name of a declared
1839
+ flag. Use the scenario.attribute notation to use an attribute of the currently
1840
+ evaluated property. The scenario ID always has to be specified, also for
1841
+ non-scenario specific attributes. This is necessary to distinguish them from
1842
+ flags.
1843
+
1844
+ An operand can be a negated operand by prefixing a ~ charater or it can be
1845
+ another logical expression enclosed in braces.
1567
1846
  EOT
1568
1847
  )
1569
1848
  end
1570
1849
 
1850
+ def rule_operationChain
1851
+ optional
1852
+ repeatable
1853
+ pattern(%w( !operatorAndOperand), lambda {
1854
+ @val[0]
1855
+ })
1856
+ end
1857
+
1571
1858
  def rule_operatorAndOperand
1572
1859
  optional
1573
1860
  pattern(%w( !operator !operand), lambda{
@@ -1600,6 +1887,9 @@ EOT
1600
1887
 
1601
1888
  singlePattern('_<=')
1602
1889
  descr('The \'smaller-or-equal\' operator')
1890
+
1891
+ singlePattern('_!=')
1892
+ descr('The \'not-equal\' operator')
1603
1893
  end
1604
1894
 
1605
1895
  def rule_optionalID
@@ -1660,6 +1950,11 @@ EOT
1660
1950
  })
1661
1951
  end
1662
1952
 
1953
+ def rule_plusOrMinus
1954
+ singlePattern('_+')
1955
+ singlePattern('_ - ')
1956
+ end
1957
+
1663
1958
  def rule_project
1664
1959
  pattern(%w( !projectProlog !projectDeclaration !properties ), lambda {
1665
1960
  @val[1]
@@ -1732,6 +2027,8 @@ EOT
1732
2027
  @project['now'] = @val[1]
1733
2028
  @scanner.addMacro(Macro.new('now', @val[1].to_s,
1734
2029
  @scanner.sourceFileInfo))
2030
+ @scanner.addMacro(Macro.new('today', @val[1].to_s(@project['timeFormat']),
2031
+ @scanner.sourceFileInfo))
1735
2032
  })
1736
2033
  doc('now', <<'EOT'
1737
2034
  Specify the date that TaskJuggler uses for calculation as current
@@ -1969,6 +2266,7 @@ EOT
1969
2266
  })
1970
2267
 
1971
2268
  pattern(%w( !export ))
2269
+ pattern(%w( !timeSheetReport ))
1972
2270
 
1973
2271
  pattern(%w( _flags !declareFlagList ), lambda {
1974
2272
  unless @project['flags'].include?(@val[1])
@@ -2029,6 +2327,7 @@ EOT
2029
2327
  pattern(%w( !report ))
2030
2328
  pattern(%w( !resource ))
2031
2329
  pattern(%w( !shift ))
2330
+ pattern(%w( !statusSheet ))
2032
2331
 
2033
2332
  pattern(%w( _supplement !supplement ))
2034
2333
  doc('supplement', <<'EOT'
@@ -2044,6 +2343,7 @@ EOT
2044
2343
  )
2045
2344
 
2046
2345
  pattern(%w( !task ))
2346
+ pattern(%w( !timeSheet ))
2047
2347
  pattern(%w( _vacation !vacationName !intervals ), lambda {
2048
2348
  @project['vacations'] = @project['vacations'] + @val[2]
2049
2349
  })
@@ -2055,6 +2355,16 @@ part-time, or vice versa, please refer to the 'Shift' property.
2055
2355
  EOT
2056
2356
  )
2057
2357
  arg(1, 'name', 'Name or purpose of the vacation')
2358
+
2359
+ pattern(%w( _trackingscenario !scenarioId ), lambda {
2360
+ @project['trackingScenarioIdx'] = @val[1]
2361
+ })
2362
+ doc('trackingscenario', <<'EOT'
2363
+ Specifies which scenario should be used for time sheet reports. By default,
2364
+ the top-level scenario will be used.
2365
+ EOT
2366
+ )
2367
+
2058
2368
  end
2059
2369
 
2060
2370
  def rule_propertiesInclude
@@ -2122,6 +2432,15 @@ EOT
2122
2432
  optionsRule('referenceAttributes')
2123
2433
  end
2124
2434
 
2435
+ def rule_relativeId
2436
+ pattern(%w( _! !moreBangs !idOrAbsoluteId ), lambda {
2437
+ str = '!'
2438
+ @val[1].each { |bang| str += bang }
2439
+ str += @val[2]
2440
+ str
2441
+ })
2442
+ end
2443
+
2125
2444
  def rule_report
2126
2445
  pattern(%w( !reportHeader !reportBody ), lambda {
2127
2446
  @property = @property.parent
@@ -2133,14 +2452,56 @@ with report attributes. Reports can be nested to create structured document
2133
2452
  trees. As with other properties, the resource attributes can be inherited from
2134
2453
  the enclosing report or the project.
2135
2454
 
2455
+ By default, report definitions do not generate any files. With more complex
2456
+ projects, most report definitions will be used to describe elements of
2457
+ composed reports. If you want to generate a file from this report, you must
2458
+ specify the list of [[formats]] that you want to generate. The report name
2459
+ will then be used as a base name to create the file. The suffix will be
2460
+ appended based on the generated format.
2461
+
2136
2462
  Reports have a local name space. All IDs must be unique within the reports
2137
- that belong to the same enclosing report.
2463
+ that belong to the same enclosing report. To reference a report for inclusion
2464
+ into another report, you need to specify the full report ID. This is composed
2465
+ of the report ID, prefixed by a dot-separated list of all parent report IDs.
2138
2466
  EOT
2139
2467
  )
2468
+ also(%w( resourcereport taskreport textreport ))
2140
2469
  end
2141
2470
 
2142
2471
 
2143
2472
  def rule_reportableAttributes
2473
+ singlePattern('_alert')
2474
+ descr(<<'EOT'
2475
+ The alert level of the property that was reported with the date closest to the
2476
+ end date of the report. Container properties that don't have their own alert
2477
+ level reported with a date equal or newer than the alert levels of all their
2478
+ sub properties will get the highest alert level of their direct sub
2479
+ properties.
2480
+ EOT
2481
+ )
2482
+
2483
+ singlePattern('_alertmessage')
2484
+ descr(<<'EOT'
2485
+ The headlines, the summary and the details of the message from the journal
2486
+ entries that caused the current alert level for this task.
2487
+ EOT
2488
+ )
2489
+
2490
+ singlePattern('_alertsummary')
2491
+ descr(<<'EOT'
2492
+ The headlines and the summary message from the journal entries that caused the
2493
+ current alert level for this task.
2494
+ EOT
2495
+ )
2496
+
2497
+ singlePattern('_alerttrend')
2498
+ descr(<<'EOT'
2499
+ Shows how the alert level at the end of the report period compares to the
2500
+ alert level at the begining of the report period. Possible values are up, down
2501
+ or flat.
2502
+ EOT
2503
+ )
2504
+
2144
2505
  singlePattern('_chart')
2145
2506
  descr(<<'EOT'
2146
2507
  A Gantt chart. This column type requires all lines to have the same fixed
@@ -2186,7 +2547,13 @@ EOT
2186
2547
  descr('Measure for how efficient a resource can perform tasks')
2187
2548
 
2188
2549
  singlePattern('_effort')
2189
- descr('The total allocated effort')
2550
+ descr('The allocated effort during the reporting period')
2551
+
2552
+ singlePattern('_effortdone')
2553
+ descr('The already completed effort as of now')
2554
+
2555
+ singlePattern('_effortleft')
2556
+ descr('The remaining allocated effort as of now')
2190
2557
 
2191
2558
  singlePattern('_email')
2192
2559
  descr('The email address of a resource')
@@ -2197,6 +2564,20 @@ EOT
2197
2564
  singlePattern('_flags')
2198
2565
  descr('List of attached flags')
2199
2566
 
2567
+ singlePattern('_freetime')
2568
+ descr(<<'EOT'
2569
+ The amount of unallocated work time of a resource during the reporting period.
2570
+ EOT
2571
+ )
2572
+
2573
+ singlePattern('_freework')
2574
+ descr(<<'EOT'
2575
+ The amount of unallocated work capacity of a resource during the reporting
2576
+ period. This is the product of unallocated work time times the efficiency of
2577
+ the resource.
2578
+ EOT
2579
+ )
2580
+
2200
2581
  singlePattern('_fte')
2201
2582
  descr('The Full-Time-Equivalent of a resource or group')
2202
2583
 
@@ -2283,6 +2664,16 @@ EOT
2283
2664
  singlePattern('_start')
2284
2665
  descr('The start date of the task')
2285
2666
 
2667
+ singlePattern('_status')
2668
+ descr(<<'EOT'
2669
+ The status of a task. It is determined based on the current date or the date
2670
+ specified by [[now]].
2671
+ EOT
2672
+ )
2673
+
2674
+ singlePattern('_targets')
2675
+ descr('A list of tasks that depend in the current task.')
2676
+
2286
2677
  singlePattern('_wbs')
2287
2678
  descr('The hierarchical or work breakdown structure index')
2288
2679
 
@@ -2330,14 +2721,10 @@ EOT
2330
2721
  @property.set('columns', columns)
2331
2722
  })
2332
2723
  doc('columns', <<'EOT'
2333
- Specifies which columns shall be included in a report.
2334
-
2335
- All columns support macro expansion. Contrary to the normal macro expansion,
2336
- these macros are expanded during the report generation. So the value of the
2337
- macro is being changed after each table cell or table line. Consequently only
2338
- build in macros can be used. To protect the macro calls against expansion
2339
- during the initial file processing, the report macros must be prefixed with an
2340
- additional ''''$''''.
2724
+ Specifies which columns shall be included in a report. Some columns show
2725
+ values that are constant over the course of the project. Other columns show
2726
+ calculated values that depend on the time period that was chosen for the
2727
+ report.
2341
2728
  EOT
2342
2729
  )
2343
2730
 
@@ -2353,6 +2740,13 @@ EOT
2353
2740
  )
2354
2741
  also(%w( footer header prolog ))
2355
2742
 
2743
+ pattern(%w( !flags ))
2744
+ doc('flags.report', <<'EOT'
2745
+ Attach a set of flags. The flags can be used in logical expressions to filter
2746
+ properties from the reports.
2747
+ EOT
2748
+ )
2749
+
2356
2750
  pattern(%w( _footer $STRING ), lambda {
2357
2751
  @property.set('footer', newRichText(@val[1]))
2358
2752
  })
@@ -2381,10 +2775,15 @@ EOT
2381
2775
  also(%w( epilog footer prolog ))
2382
2776
 
2383
2777
  pattern(%w( _headline $STRING ), lambda {
2384
- @property.set('headline', @val[1])
2778
+ @property.set('headline', newRichText(@val[1]))
2385
2779
  })
2386
2780
  doc('headline', <<'EOT'
2387
2781
  Specifies the headline for a report.
2782
+ EOT
2783
+ )
2784
+ arg(1, 'text', <<'EOT'
2785
+ The text used for the headline. It is interpreted as
2786
+ [[Rich_Text_Attributes Rich Text]].
2388
2787
  EOT
2389
2788
  )
2390
2789
 
@@ -2403,13 +2802,15 @@ EOT
2403
2802
  )
2404
2803
 
2405
2804
  pattern(%w( _loadunit !loadunit ), lambda {
2406
- @property.set('loadUnit', "#{@val[1]}")
2805
+ @property.set('loadUnit', @val[1])
2407
2806
  })
2408
2807
  doc('loadunit', <<'EOT'
2409
2808
  Determines what unit should be used to display all load values in this report.
2410
2809
  EOT
2411
2810
  )
2412
2811
 
2812
+ pattern(%w( !reportPeriod ))
2813
+
2413
2814
  pattern(%w( _prolog $STRING ), lambda {
2414
2815
  @property.set('prolog', newRichText(@val[1]))
2415
2816
  })
@@ -2439,7 +2840,6 @@ EOT
2439
2840
  )
2440
2841
 
2441
2842
  pattern(%w( !report ))
2442
- pattern(%w( !reportPeriod ))
2443
2843
 
2444
2844
  pattern(%w( _right $STRING ), lambda {
2445
2845
  @property.set('right', newRichText(@val[1]))
@@ -2466,6 +2866,16 @@ EOT
2466
2866
  })
2467
2867
  doc('scenarios', <<'EOT'
2468
2868
  List of scenarios that should be included in the report.
2869
+ EOT
2870
+ )
2871
+
2872
+ pattern(%w( _selfcontained !yesNo ), lambda {
2873
+ @property.set('selfcontained', @val[1])
2874
+ })
2875
+ doc('selfcontained', <<'EOT'
2876
+ Try to generate selfcontained output files when the format supports this. E.
2877
+ g. for HTML reports, the style sheet will be included and no icons will be
2878
+ used.
2469
2879
  EOT
2470
2880
  )
2471
2881
 
@@ -2507,6 +2917,15 @@ EOT
2507
2917
  pattern(%w( !timeformat ), lambda {
2508
2918
  @property.set('timeFormat', @val[0])
2509
2919
  })
2920
+
2921
+ pattern(%w( _title $STRING ), lambda {
2922
+ @property.set('title', @val[1])
2923
+ })
2924
+ doc('title', <<'EOT'
2925
+ The title of the report will be used in external references to the report. It
2926
+ will not show up in the reports directly. It's used e. g. by [[navigator]].
2927
+ EOT
2928
+ )
2510
2929
  end
2511
2930
 
2512
2931
  def rule_reportEnd
@@ -2524,6 +2943,27 @@ EOT
2524
2943
  )
2525
2944
  example('Export', '2')
2526
2945
  end
2946
+ def rule_reportId
2947
+ pattern(%w( !reportIdUnverifd ), lambda {
2948
+ id = @val[0]
2949
+ if @property && @property.is_a?(Report)
2950
+ id = @property.fullId + '.' + id
2951
+ else
2952
+ id = @reportprefix + '.' + id unless @reportprefix.empty?
2953
+ end
2954
+ # In case we have a nested supplement, we need to prepend the parent ID.
2955
+ if (report = @project.report(id)).nil?
2956
+ error('report_id_expected', "#{id} is not a defined report.")
2957
+ end
2958
+ report
2959
+ })
2960
+ arg(0, 'report', 'The ID of a defined report')
2961
+ end
2962
+
2963
+ def rule_reportIdUnverifd
2964
+ singlePattern('$ABSOLUTE_ID')
2965
+ singlePattern('$ID')
2966
+ end
2527
2967
 
2528
2968
  def rule_reportPeriod
2529
2969
  pattern(%w( _period !interval ), lambda {
@@ -2573,39 +3013,61 @@ EOT
2573
3013
  case @val[0]
2574
3014
  when 'taskreport'
2575
3015
  @property.typeSpec = :taskreport
2576
- # Set the default columns for this report.
2577
- %w( wbs name start end effort chart ).each do |col|
2578
- @property.get('columns') <<
2579
- TableColumnDefinition.new(col, columnTitle(col))
3016
+ unless @property.modified?('columns')
3017
+ # Set the default columns for this report.
3018
+ %w( wbs name start end effort chart ).each do |col|
3019
+ @property.get('columns') <<
3020
+ TableColumnDefinition.new(col, columnTitle(col))
3021
+ end
2580
3022
  end
2581
3023
  # Show all tasks, sorted by tree, start-up, seqno-up.
2582
- @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0)))
2583
- @property.set('sortTasks',
2584
- [ [ 'tree', true, -1 ],
2585
- [ 'start', true, 0 ],
2586
- [ 'seqno', true, -1 ] ])
3024
+ unless @property.modified?('hideTask')
3025
+ @property.set('hideTask',
3026
+ LogicalExpression.new(LogicalOperation.new(0)))
3027
+ end
3028
+ unless @property.modified?('softTask')
3029
+ @property.set('sortTasks',
3030
+ [ [ 'tree', true, -1 ],
3031
+ [ 'start', true, 0 ],
3032
+ [ 'seqno', true, -1 ] ])
3033
+ end
2587
3034
  # Show no resources, but set sorting to id-up.
2588
- @property.set('hideResource',
2589
- LogicalExpression.new(LogicalOperation.new(1)))
2590
- @property.set('sortResources', [ [ 'id', true, -1 ] ])
3035
+ unless @property.modified?('hideResource')
3036
+ @property.set('hideResource',
3037
+ LogicalExpression.new(LogicalOperation.new(1)))
3038
+ end
3039
+ unless @property.modified?('sortResources')
3040
+ @property.set('sortResources', [ [ 'id', true, -1 ] ])
3041
+ end
2591
3042
  when 'resourcereport'
2592
3043
  @property.typeSpec = :resourcereport
2593
- # Set the default columns for this report.
2594
- %w( no name ).each do |col|
2595
- @property.get('columns') <<
2596
- TableColumnDefinition.new(col, columnTitle(col))
3044
+ if @property.modified?('columns')
3045
+ # Set the default columns for this report.
3046
+ %w( no name ).each do |col|
3047
+ @property.get('columns') <<
3048
+ TableColumnDefinition.new(col, columnTitle(col))
3049
+ end
2597
3050
  end
2598
3051
  # Show all resources, sorted by tree and id-up.
2599
- @property.set('hideResource',
2600
- LogicalExpression.new(LogicalOperation.new(0)))
2601
- @property.set('sortResources', [ [ 'tree', true, -1 ],
2602
- [ 'id', true, -1 ] ])
3052
+ unless @property.modified?('hideResource')
3053
+ @property.set('hideResource',
3054
+ LogicalExpression.new(LogicalOperation.new(0)))
3055
+ end
3056
+ unless @property.modified?('sortResources')
3057
+ @property.set('sortResources', [ [ 'tree', true, -1 ],
3058
+ [ 'id', true, -1 ] ])
3059
+ end
2603
3060
  # Hide all resources, but set sorting to tree, start-up, seqno-up.
2604
- @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(1)))
2605
- @property.set('sortTasks',
2606
- [ [ 'tree', true, -1 ],
2607
- [ 'start', true, 0 ],
2608
- [ 'seqno', true, -1 ] ])
3061
+ unless @property.modified?('hideTask')
3062
+ @property.set('hideTask',
3063
+ LogicalExpression.new(LogicalOperation.new(1)))
3064
+ end
3065
+ unless @property.modified?('sortTasks')
3066
+ @property.set('sortTasks',
3067
+ [ [ 'tree', true, -1 ],
3068
+ [ 'start', true, 0 ],
3069
+ [ 'seqno', true, -1 ] ])
3070
+ end
2609
3071
  when 'textreport'
2610
3072
  @property.typeSpec = :textreport
2611
3073
  else
@@ -2624,18 +3086,29 @@ EOT
2624
3086
  singlePattern('_resourcereport')
2625
3087
  doc('resourcereport', <<'EOT'
2626
3088
  The report lists resources and their respective values in a table. The task
2627
- that are the resources are allocated to can be listed as well.
3089
+ that are the resources are allocated to can be listed as well. See [[report]]
3090
+ for further details.
2628
3091
  EOT
2629
3092
  )
2630
3093
  singlePattern('_taskreport')
2631
3094
  doc('taskreport', <<'EOT'
2632
- The report lists tasks and their respective values in a table. The
2633
- resources that are allocated to each task can be listed as well.
3095
+ The report lists tasks and their respective values in a table. To reduce the
3096
+ list of included tasks, you can use the [[hidetask]], [[rolluptask]] or
3097
+ [[taskroot]] attributes. The order of the task can be controlled with
3098
+ [[sorttasks]]. If the first sorting criteria is tree sorting, the parent tasks
3099
+ will unconditionally be included to form the tree. Tree sorting is the
3100
+ default. You need to change it if you do not want certain parent tasks to be
3101
+ included in the report.
3102
+
3103
+ The resources that are allocated to each task can be listed as well. See
3104
+ [[report]] for further details.
2634
3105
  EOT
2635
3106
  )
2636
3107
  singlePattern('_textreport')
2637
3108
  doc('textreport', <<'EOT'
2638
- This report consists of 5 RichText sections, a header, a center section with a left and right margin and a footer. The sections may contain the output of other defined reports.
3109
+ This report consists of 5 RichText sections, a header, a center section with a
3110
+ left and right margin and a footer. The sections may contain the output of
3111
+ other defined reports. See [[report]] for further details.
2639
3112
  EOT
2640
3113
  )
2641
3114
  end
@@ -2662,7 +3135,7 @@ EOT
2662
3135
  pattern(%w( !purge ))
2663
3136
  pattern(%w( !resource ))
2664
3137
  pattern(%w( !resourceScenarioAttributes ))
2665
- pattern(%w( !scenarioId !resourceScenarioAttributes ), lambda {
3138
+ pattern(%w( !scenarioIdCol !resourceScenarioAttributes ), lambda {
2666
3139
  @scenarioIdx = 0
2667
3140
  })
2668
3141
 
@@ -2940,6 +3413,15 @@ EOT
2940
3413
  end
2941
3414
 
2942
3415
  def rule_scenarioId
3416
+ pattern(%w( $ID ), lambda {
3417
+ if (@scenarioIdx = @project.scenarioIdx(@val[0])).nil?
3418
+ error('unknown_scenario_id', "Unknown scenario: #{@val[0]}")
3419
+ end
3420
+ })
3421
+ arg(0, 'scenario', 'ID of a defined scenario')
3422
+ end
3423
+
3424
+ def rule_scenarioIdCol
2943
3425
  pattern(%w( $ID_WITH_COLON ), lambda {
2944
3426
  if (@scenarioIdx = @project.scenarioIdx(@val[0])).nil?
2945
3427
  error('unknown_scenario_id', "Unknown scenario: @val[0]")
@@ -3016,7 +3498,7 @@ EOT
3016
3498
 
3017
3499
  pattern(%w( !shift ))
3018
3500
  pattern(%w( !shiftScenarioAttributes ))
3019
- pattern(%w( !scenarioId !shiftScenarioAttributes ), lambda {
3501
+ pattern(%w( !scenarioIdCol !shiftScenarioAttributes ), lambda {
3020
3502
  @scenarioIdx = 0
3021
3503
  })
3022
3504
  end
@@ -3154,10 +3636,135 @@ EOT
3154
3636
  'Use \'tree\' as first criteria to keep the breakdown structure.')
3155
3637
  end
3156
3638
 
3639
+ def rule_ssStatusAttributes
3640
+ optional
3641
+ repeatable
3642
+
3643
+ pattern(%w( !author ))
3644
+ pattern(%w( !details ))
3645
+ pattern(%w( !summary ))
3646
+ end
3647
+
3648
+ def rule_ssStatusBody
3649
+ optional
3650
+ pattern(%w( _{ !ssStatusAttributes _} ))
3651
+ end
3652
+
3653
+ def rule_ssStatusHeader
3654
+ pattern(%w( _status !alertLevel $STRING ), lambda {
3655
+ @journalEntry = JournalEntry.new(@project['journal'], @sheetEnd,
3656
+ @val[2], @property,
3657
+ @scanner.sourceFileInfo)
3658
+ @journalEntry.alertLevel = @val[1]
3659
+ @journalEntry.author = @sheetAuthor
3660
+
3661
+ })
3662
+ end
3663
+
3664
+ def rule_ssStatus
3665
+ pattern(%w( !ssStatusHeader !ssStatusBody ))
3666
+ doc('status.statussheet', <<'EOT'
3667
+ The status attribute can be used to describe the current status of the task or
3668
+ resource. The content of the status messages is added to the project journal.
3669
+ EOT
3670
+ )
3671
+ end
3672
+
3673
+ def rule_statusSheet
3674
+ pattern(%w( !statusSheetHeader !statusSheetBody ))
3675
+ doc('statussheet', <<'EOT'
3676
+ A status sheet can be used to capture the status of various tasks outside of
3677
+ the regular task tree definition. It is intended for use by managers that
3678
+ don't directly work with the full project plan, but need to report the current
3679
+ status of each task or task-tree that they are responsible for.
3680
+ EOT
3681
+ )
3682
+ example('StatusSheet')
3683
+ end
3684
+
3685
+ def rule_statusSheetAttributes
3686
+ optional
3687
+ repeatable
3688
+
3689
+ pattern(%w( !statusSheetTask ))
3690
+ end
3691
+
3692
+ def rule_statusSheetBody
3693
+ optionsRule('statusSheetAttributes')
3694
+ end
3695
+
3696
+ def rule_statusSheetHeader
3697
+ pattern(%w( _statussheet !resourceId !date ), lambda {
3698
+ @sheetAuthor = @val[1]
3699
+ @sheetEnd = @val[2]
3700
+ })
3701
+ arg(1, 'reporter', <<'EOT'
3702
+ The ID of a defined resource. This identifies the status reporter. Unless the
3703
+ status entries provide a different author, the sheet author will be used as
3704
+ status entry author.
3705
+ EOT
3706
+ )
3707
+ end
3708
+
3709
+ def rule_statusSheetTask
3710
+ pattern(%w( !statusSheetTaskHeader !statusSheetTaskBody), lambda {
3711
+ @property = @propertyStack.pop
3712
+ })
3713
+ doc('task.statussheet', <<'EOT'
3714
+ Opens the task with the specified ID to add a status report. Child task can be
3715
+ opened inside this context by specifying their relative ID to this parent.
3716
+ EOT
3717
+ )
3718
+ end
3719
+
3720
+ def rule_statusSheetTaskAttributes
3721
+ optional
3722
+ repeatable
3723
+ pattern(%w( !ssStatus ))
3724
+ pattern(%w( !statusSheetTask ), lambda {
3725
+ })
3726
+ end
3727
+
3728
+ def rule_statusSheetTaskBody
3729
+ optionsRule('statusSheetTaskAttributes')
3730
+ end
3731
+
3732
+ def rule_statusSheetTaskHeader
3733
+ pattern(%w( _task !taskId ), lambda {
3734
+ if @property
3735
+ @propertyStack.push(@property)
3736
+ else
3737
+ @propertyStack = []
3738
+ end
3739
+ @property = @val[1]
3740
+ })
3741
+ end
3742
+ def rule_summary
3743
+ pattern(%w( _summary $STRING ), lambda {
3744
+ rtTokenSetIntro =
3745
+ %w( LINEBREAK SPACE WORD BOLD ITALIC CODE BOLDITALIC HREF HREFEND )
3746
+ @journalEntry.summary = newRichText(@val[1], rtTokenSetIntro)
3747
+ })
3748
+ doc('summary', <<'EOT'
3749
+ This is the introductory part of the journal or status entry. It should
3750
+ summarize the full entry but should contain more details than the headline.
3751
+ EOT
3752
+ )
3753
+ arg(1, 'text', <<'EOT'
3754
+ The text will be interpreted as [[Rich_Text_Attributes Rich Text]]. Only a
3755
+ small subset of the markup is supported for this attribute. You can use word
3756
+ formatting, hyperlinks and paragraphs.
3757
+ EOT
3758
+ )
3759
+ end
3760
+
3157
3761
  def rule_supplement
3158
3762
  pattern(%w( !supplementAccount !accountBody ), lambda {
3159
3763
  @property = nil
3160
3764
  })
3765
+ pattern(%w( !supplementReport !reportBody ), lambda {
3766
+ @property = nil
3767
+ })
3161
3768
  pattern(%w( !supplementResource !resourceBody ), lambda {
3162
3769
  @property = nil
3163
3770
  })
@@ -3173,6 +3780,13 @@ EOT
3173
3780
  arg(1, 'account ID', 'The ID of an already defined account.')
3174
3781
  end
3175
3782
 
3783
+ def rule_supplementReport
3784
+ pattern(%w( _report !reportId ), lambda {
3785
+ @property = @val[1]
3786
+ })
3787
+ arg(1, 'report ID', 'The ID of an already defined report.')
3788
+ end
3789
+
3176
3790
  def rule_supplementResource
3177
3791
  pattern(%w( _resource !resourceId ), lambda {
3178
3792
  @property = @val[1]
@@ -3237,7 +3851,7 @@ EOT
3237
3851
 
3238
3852
  pattern(%w( !task ))
3239
3853
  pattern(%w( !taskScenarioAttributes ))
3240
- pattern(%w( !scenarioId !taskScenarioAttributes ), lambda {
3854
+ pattern(%w( !scenarioIdCol !taskScenarioAttributes ), lambda {
3241
3855
  @scenarioIdx = 0
3242
3856
  })
3243
3857
  # Other attributes will be added automatically.
@@ -3323,7 +3937,7 @@ EOT
3323
3937
 
3324
3938
  def rule_taskDepId
3325
3939
  singlePattern('$ABSOLUTE_ID')
3326
- descr(<<'EOT'
3940
+ arg(0, 'ABSOLUTE ID', <<'EOT'
3327
3941
  A reference using the full qualified ID of a task. The IDs of all enclosing
3328
3942
  parent tasks must be prepended to the task ID and separated with a dot, e.g.
3329
3943
  ''''proj.plan.doc''''.
@@ -3331,9 +3945,9 @@ EOT
3331
3945
  )
3332
3946
 
3333
3947
  singlePattern('$ID')
3334
- descr('Just the ID of the task without and parent IDs.')
3948
+ arg(0, 'ID', 'Just the ID of the task without and parent IDs.')
3335
3949
 
3336
- pattern(%w( $RELATIVE_ID ), lambda {
3950
+ pattern(%w( !relativeId ), lambda {
3337
3951
  task = @property
3338
3952
  id = @val[0]
3339
3953
  while task && id[0] == ?!
@@ -3349,7 +3963,7 @@ EOT
3349
3963
  id
3350
3964
  end
3351
3965
  })
3352
- descr(<<'EOT'
3966
+ arg(0, 'RELATIVE ID', <<'EOT'
3353
3967
  A relative task ID always starts with one or more exclamation marks and is
3354
3968
  followed by a task ID. Each exclamation mark lifts the scope where the ID is
3355
3969
  looked for to the enclosing task. The ID may contain some of the parent IDs
@@ -3386,9 +4000,12 @@ EOT
3386
4000
  def rule_taskId
3387
4001
  pattern(%w( !taskIdUnverifd ), lambda {
3388
4002
  id = @val[0]
3389
- id = @taskprefix + '.' + id unless @taskprefix.empty?
3390
- # In case we have a nested supplement, we need to prepend the parent ID.
3391
- id = @property.fullId + '.' + id if @property && @property.is_a?(Task)
4003
+ if @property && @property.is_a?(Task)
4004
+ # In case we have a nested supplement, we need to prepend the parent ID.
4005
+ id = @property.fullId + '.' + id
4006
+ else
4007
+ id = @taskprefix + '.' + id unless @taskprefix.empty?
4008
+ end
3392
4009
  if (task = @project.task(id)).nil?
3393
4010
  error('unknown_task', "Unknown task #{id}")
3394
4011
  end
@@ -3998,6 +4615,108 @@ EOT
3998
4615
  })
3999
4616
  end
4000
4617
 
4618
+ def rule_timeSheet
4619
+ pattern(%w( !timeSheetHeader !timeSheetBody ), lambda {
4620
+
4621
+ })
4622
+ doc('timesheet', <<'EOT'
4623
+ This feature is not yet functional!
4624
+
4625
+ A time sheet record can be used to capture the current status of the tasks
4626
+ assigned to a specific resource and the achieved progress for a given period
4627
+ of time. The status is assumed to be for the end of this time period. There
4628
+ must be a separate time sheet record for each resource per period. Different
4629
+ resources can use different reporting periods and reports for the same
4630
+ resource may have different reporting periods as long as they don't overlap.
4631
+ For the time after the last time sheet, TaskJuggler will project the result
4632
+ based on the plan data. For periods without a time sheet record prior to the
4633
+ last record for this resource, TaskJuggler assumes that no work has been done.
4634
+ The work is booked for the scenario specified by [[trackingscenario]].
4635
+
4636
+ The intended use for time sheets is to have all resources report a time sheet
4637
+ every day, week or month. All time sheets can be added to the project plan.
4638
+ The status information is always used to determin the current status of the
4639
+ project. The [[work]], [[remaining]] and [[end.timesheet end]] attributes are
4640
+ ignored if there are also [[booking bookings]] for the resource in the time
4641
+ sheet period. The non-ignored attributes of the time sheets
4642
+ will be converted into [[booking]] statements internally. These bookings can
4643
+ then be [[export exported]] into a file which can then be added to the project
4644
+ again. This way, you can use time sheets to incrementally record progress of
4645
+ your project. There is a possibility that time sheets conflict with other data
4646
+ in the plan. In case TaskJuggler cannot automatically resolve them, these
4647
+ conflicts have to be manually resolved by either changing the plan or the time
4648
+ sheet.
4649
+
4650
+ The status messages are interpreted as [[journalentry journal entries]]. The
4651
+ alert level will be evaluated and the current state of the project can be put
4652
+ into a dashboard using the ''''alert'''' and ''''alertmessage'''' [[columnid
4653
+ columns]].
4654
+ EOT
4655
+ )
4656
+ example('TimeSheet')
4657
+ end
4658
+
4659
+ def rule_timeSheetAttributes
4660
+ optional
4661
+ repeatable
4662
+
4663
+ pattern(%w( !tsNewTaskHeader !tsTaskBody ))
4664
+ doc('newtask', <<'EOT'
4665
+ The keyword can be used add a new task to the project. If the task ID requires
4666
+ further parent task that don't exist yet, these tasks will be created as well.
4667
+ If the task exists already, an error is generated. The new task can be used
4668
+ immediately to report progress and status against it.
4669
+ EOT
4670
+ )
4671
+
4672
+ pattern(%w( _shift !shiftId ), lambda {
4673
+
4674
+ })
4675
+ doc('shift.timesheet', <<'EOT'
4676
+ Specifies an alternative [[shift]] for the time sheet period. This shift will
4677
+ override any existing working hour definitions for the resource. It will not
4678
+ override already declared [[vacation vacations]] though.
4679
+
4680
+ The primary use of this feature is to let the resources report different total
4681
+ work time for the report period.
4682
+ EOT
4683
+ )
4684
+
4685
+ pattern(%w( !tsTaskHeader !tsTaskBody ))
4686
+ doc('task.timesheet', <<'EOT'
4687
+ Specifies an existing task that progress and status should be reported
4688
+ against.
4689
+ EOT
4690
+ )
4691
+ end
4692
+
4693
+ def rule_timeSheetBody
4694
+ pattern(%w( _{ !timeSheetAttributes _} ), lambda {
4695
+
4696
+ })
4697
+ end
4698
+
4699
+ def rule_timeSheetHeader
4700
+ pattern(%w( _timesheet !resourceId !valIntervalOrDate ),
4701
+ lambda {
4702
+ @sheetAuthor = @val[1]
4703
+ @sheetStart = @val[2].start
4704
+ @sheetEnd = @val[2].end
4705
+ })
4706
+ end
4707
+
4708
+ def rule_timeSheetReport
4709
+ pattern(%w( !tsReportHeader !tsReportBody ))
4710
+ doc('timesheetreport', <<'EOT'
4711
+ For projects that flow mostly according to plan, TaskJuggler already knows
4712
+ much of the information that should be contained in the time sheets. With this
4713
+ property, you can generate a report that contains drafts of the time sheets
4714
+ for one or more resources. The time sheet drafts will be for the
4715
+ specified report period.
4716
+ EOT
4717
+ )
4718
+ end
4719
+
4001
4720
  def rule_timezone
4002
4721
  pattern(%w( _timezone !validTimeZone ), lambda{
4003
4722
  ENV['TZ'] = @project['timezone'] = @val[1]
@@ -4029,6 +4748,172 @@ EOT
4029
4748
  )
4030
4749
  end
4031
4750
 
4751
+ def rule_tsNewTaskHeader
4752
+ pattern(%w( _newtask !taskIdUnverifd ), lambda {
4753
+
4754
+ })
4755
+ arg(1, 'task', 'ID of the new task')
4756
+ end
4757
+ def rule_tsReportHeader
4758
+ pattern(%w( _timesheetreport $STRING ), lambda {
4759
+ if (fileName = @val[1]) != '.'
4760
+ suffix = fileName[-4, 4]
4761
+ if suffix != '.tji'
4762
+ error('tsreport_bad_extn',
4763
+ 'time sheet report files must have a .tji extension.')
4764
+ end
4765
+
4766
+ if @project.reports[fileName]
4767
+ error('report_redefinition',
4768
+ "A report with the name '#{fileName}' has already been defined.")
4769
+ end
4770
+ else
4771
+ fileName = "timeSheet#{@project.reports.length + 1}"
4772
+ end
4773
+ newReport(fileName, :timeSheet, sourceFileInfo)
4774
+ })
4775
+ arg(1, 'file name', <<'EOT'
4776
+ The name of the time sheet report file to generate. It must end with a .tji
4777
+ extension, or use . to use the standard output channel.
4778
+ EOT
4779
+ )
4780
+ end
4781
+
4782
+ def rule_tsReportAttributes
4783
+ optional
4784
+ repeatable
4785
+
4786
+ pattern(%w( !hideresource ))
4787
+ pattern(%w( !reportEnd ))
4788
+ pattern(%w( !reportPeriod ))
4789
+ pattern(%w( !reportStart ))
4790
+ end
4791
+
4792
+ def rule_tsReportBody
4793
+ optionsRule('tsReportAttributes')
4794
+ end
4795
+
4796
+ def rule_tsStatusAttributes
4797
+ optional
4798
+ repeatable
4799
+
4800
+ pattern(%w( !details ))
4801
+ pattern(%w( !summary ))
4802
+ end
4803
+
4804
+ def rule_tsStatusBody
4805
+ optional
4806
+ pattern(%w( _{ !tsStatusAttributes _} ))
4807
+ end
4808
+
4809
+ def rule_tsStatusHeader
4810
+ pattern(%w( _status !alertLevel $STRING ), lambda {
4811
+ @journalEntry = JournalEntry.new(@project['journal'], @sheetEnd,
4812
+ @val[2], @property,
4813
+ @scanner.sourceFileInfo)
4814
+ @journalEntry.alertLevel = @val[1]
4815
+ @journalEntry.author = @sheetAuthor
4816
+
4817
+ })
4818
+ end
4819
+
4820
+ def rule_tsStatus
4821
+ pattern(%w( !tsStatusHeader !tsStatusBody ))
4822
+ doc('status.timesheet', <<'EOT'
4823
+ The status attribute can be used to describe the current status of the task or
4824
+ resource. The content of the status messages is added to the project journal.
4825
+ EOT
4826
+ )
4827
+ end
4828
+
4829
+ def rule_tsTaskAttributes
4830
+ optional
4831
+ repeatable
4832
+
4833
+ pattern(%w( _end !valDate ), lambda {
4834
+
4835
+ })
4836
+ doc('end.timesheet', <<'EOT'
4837
+ The expected end date for the task. This can only be used for duration based
4838
+ task. For effort based task [[remaining]] has to be used.
4839
+ EOT
4840
+ )
4841
+
4842
+ pattern(%w( _priority $INTEGER ), lambda {
4843
+
4844
+ })
4845
+ doc('priority.timesheet', <<'EOT'
4846
+ The priority is a value between 1 and 1000. It is used to determine the
4847
+ sequence of task when converting [[work]] to [[booking bookings]]. Tasks that
4848
+ need to finish earlier in the period should have a high priority, tasks that
4849
+ end later in the period should have a low priority. For tasks that don't get
4850
+ finished in the reported period the priority should be set to 1.
4851
+ EOT
4852
+ )
4853
+
4854
+ pattern(%w( _remaining !workingDuration ), lambda {
4855
+
4856
+ })
4857
+ doc('remaining', <<'EOT'
4858
+ The remaining effort for the task. This value is ignored if there are
4859
+ [[booking bookings]] for the resource that overlap with the time sheet period.
4860
+ If there are no bookings, the value is compared with the [[effort]]
4861
+ specification of the task. If there a mismatch between the accumulated effort
4862
+ specified with bookings, [[work]] and [[remaining]] on one side and the
4863
+ specified [[effort]] on the other, a warning is generated.
4864
+
4865
+ This attribute can only be used with tasks that are effort based. Duration
4866
+ based tasks need to have an [[end.timesheet end]] attribute.
4867
+ EOT
4868
+ )
4869
+
4870
+ pattern(%w( !tsStatus ))
4871
+
4872
+ pattern(%w( _work !workingDuration ), lambda {
4873
+
4874
+ })
4875
+ doc('work', <<'EOT'
4876
+ The amount of time that the resource has spend with the task during the
4877
+ reported period. This value is ignored when there are [[booking bookings]] for
4878
+ the resource overlapping with the time sheet period. If there are no bookings,
4879
+ TaskJuggler will try to convert the work specification into bookings
4880
+ internally before the actual scheduling is started.
4881
+
4882
+ Every task listed in the time sheet needs to have a work attribute. The total
4883
+ accumulated work time that is reported must match exactly the total working
4884
+ hours for the resource for that period.
4885
+
4886
+ If a resource has no vacation during the week that is reported and it has a
4887
+ regular 40 hour work week, exactly 40 hours total or 5 working days have to be
4888
+ reported.
4889
+ EOT
4890
+ )
4891
+ end
4892
+
4893
+ def rule_tsTaskBody
4894
+ pattern(%w( _{ !tsTaskAttributes _} ), lambda {
4895
+ @property = nil
4896
+ })
4897
+ end
4898
+
4899
+ def rule_tsTaskHeader
4900
+ pattern(%w( _task !taskId ), lambda {
4901
+ @property = @val[1]
4902
+ # TODO: This is not too useful here. Needs to be done in postScheduling.
4903
+ #scenarioIdx = @project['trackingScenarioIdx']
4904
+ #taskStart = @property['start', scenarioIdx] || @project['start']
4905
+ #taskEnd = @property['end', scenarioIdx] || @project['end']
4906
+
4907
+ #if !Interval.new(@sheetStart, @sheetEnd).
4908
+ # overlaps?(Interval.new(taskStart, taskEnd))
4909
+ # warning('ts_task_not_active',
4910
+ # "Task #{@property.fullId} is not active during the time sheet " +
4911
+ # "reporting period")
4912
+ #end
4913
+ })
4914
+ arg(1, 'task', 'ID of an already existing task')
4915
+ end
4916
+
4032
4917
  def rule_vacationName
4033
4918
  optional
4034
4919
  pattern(%w( $STRING )) # We just throw the name away
@@ -4217,6 +5102,15 @@ EOT
4217
5102
  )
4218
5103
  end
4219
5104
 
5105
+ def rule_yesNo
5106
+ pattern(%w( _yes ), lambda {
5107
+ true
5108
+ })
5109
+ pattern(%w( _no ), lambda {
5110
+ false
5111
+ })
5112
+ end
5113
+
4220
5114
  end
4221
5115
 
4222
5116
  end