taskjuggler 3.1.0 → 3.2.0

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 (410) hide show
  1. data/CHANGELOG +44 -0
  2. data/bin/tj3webd +4 -0
  3. data/data/css/tjreport.css +14 -5
  4. data/data/tjp.vim +22 -7
  5. data/examples/Fedora-20/reports.tji +2 -4
  6. data/examples/Scrum/Product Burndown.csv +26 -0
  7. data/examples/Scrum/Sprint 1 Burndown.csv +26 -0
  8. data/examples/Scrum/Sprint 2 Burndown.csv +26 -0
  9. data/examples/Scrum/Sprint 3 Burndown.csv +26 -0
  10. data/examples/Scrum/scrum.tjp +141 -0
  11. data/examples/Tutorial/tutorial.tjp +13 -7
  12. data/lib/taskjuggler/Attributes.rb +2 -3
  13. data/lib/taskjuggler/HTMLDocument.rb +25 -18
  14. data/lib/taskjuggler/Journal.rb +85 -65
  15. data/lib/taskjuggler/KeywordDocumentation.rb +25 -13
  16. data/lib/taskjuggler/LeaveList.rb +1 -1
  17. data/lib/taskjuggler/Limits.rb +3 -5
  18. data/lib/taskjuggler/MessageHandler.rb +173 -19
  19. data/lib/taskjuggler/Painter.rb +75 -0
  20. data/lib/taskjuggler/Painter/BasicShapes.rb +76 -0
  21. data/lib/taskjuggler/Painter/Color.rb +273 -0
  22. data/lib/taskjuggler/Painter/Element.rb +56 -0
  23. data/lib/taskjuggler/Painter/FontData.rb +221 -0
  24. data/lib/taskjuggler/Painter/FontMetrics.rb +125 -0
  25. data/lib/taskjuggler/Painter/FontMetricsData.rb +151 -0
  26. data/lib/taskjuggler/Painter/Group.rb +77 -0
  27. data/lib/taskjuggler/Painter/Points.rb +47 -0
  28. data/lib/taskjuggler/Painter/Primitives.rb +100 -0
  29. data/lib/taskjuggler/Painter/SVGSupport.rb +36 -0
  30. data/lib/taskjuggler/Painter/Text.rb +36 -0
  31. data/lib/taskjuggler/Project.rb +46 -29
  32. data/lib/taskjuggler/ProjectFileParser.rb +24 -22
  33. data/lib/taskjuggler/ProjectFileScanner.rb +2 -2
  34. data/lib/taskjuggler/PropertyTreeNode.rb +26 -34
  35. data/lib/taskjuggler/Query.rb +8 -5
  36. data/lib/taskjuggler/RealFormat.rb +3 -0
  37. data/lib/taskjuggler/Resource.rb +3 -5
  38. data/lib/taskjuggler/ResourceScenario.rb +19 -7
  39. data/lib/taskjuggler/RichText.rb +4 -6
  40. data/lib/taskjuggler/RichText/FunctionExample.rb +1 -1
  41. data/lib/taskjuggler/RichText/FunctionHandler.rb +5 -6
  42. data/lib/taskjuggler/RichText/Parser.rb +4 -6
  43. data/lib/taskjuggler/RichText/RTFNavigator.rb +1 -1
  44. data/lib/taskjuggler/RichText/RTFQuery.rb +2 -3
  45. data/lib/taskjuggler/RichText/RTFReport.rb +1 -1
  46. data/lib/taskjuggler/RichText/RTFReportLink.rb +1 -2
  47. data/lib/taskjuggler/RichText/RTFWithQuerySupport.rb +1 -1
  48. data/lib/taskjuggler/RichText/Scanner.rb +6 -6
  49. data/lib/taskjuggler/RichText/Snip.rb +1 -2
  50. data/lib/taskjuggler/RuntimeConfig.rb +9 -6
  51. data/lib/taskjuggler/ScenarioData.rb +4 -3
  52. data/lib/taskjuggler/Scoreboard.rb +6 -0
  53. data/lib/taskjuggler/SheetHandlerBase.rb +25 -8
  54. data/lib/taskjuggler/SimpleQueryExpander.rb +14 -5
  55. data/lib/taskjuggler/SyntaxReference.rb +1 -2
  56. data/lib/taskjuggler/TableColumnSorter.rb +84 -0
  57. data/lib/taskjuggler/Task.rb +3 -5
  58. data/lib/taskjuggler/TaskJuggler.rb +36 -29
  59. data/lib/taskjuggler/TaskScenario.rb +154 -66
  60. data/lib/taskjuggler/TextParser.rb +24 -17
  61. data/lib/taskjuggler/TextParser/Scanner.rb +16 -11
  62. data/lib/taskjuggler/TextParser/SourceFileInfo.rb +20 -15
  63. data/lib/taskjuggler/TimeSheets.rb +6 -12
  64. data/lib/taskjuggler/Tj3AppBase.rb +35 -16
  65. data/lib/taskjuggler/Tj3Config.rb +1 -1
  66. data/lib/taskjuggler/TjpSyntaxRules.rb +239 -49
  67. data/lib/taskjuggler/XMLElement.rb +9 -2
  68. data/lib/taskjuggler/apps/Tj3.rb +43 -37
  69. data/lib/taskjuggler/apps/Tj3Client.rb +62 -112
  70. data/lib/taskjuggler/apps/Tj3Daemon.rb +66 -29
  71. data/lib/taskjuggler/apps/Tj3Man.rb +5 -5
  72. data/lib/taskjuggler/apps/Tj3SsReceiver.rb +10 -13
  73. data/lib/taskjuggler/apps/Tj3SsSender.rb +13 -16
  74. data/lib/taskjuggler/apps/Tj3TsReceiver.rb +10 -13
  75. data/lib/taskjuggler/apps/Tj3TsSender.rb +12 -15
  76. data/lib/taskjuggler/apps/Tj3TsSummary.rb +12 -15
  77. data/lib/taskjuggler/apps/Tj3WebD.rb +99 -0
  78. data/lib/taskjuggler/daemon/Daemon.rb +50 -10
  79. data/lib/taskjuggler/daemon/DaemonConnector.rb +127 -0
  80. data/lib/taskjuggler/daemon/ProcessIntercom.rb +36 -21
  81. data/lib/taskjuggler/daemon/ProjectBroker.rb +122 -112
  82. data/lib/taskjuggler/daemon/ProjectServer.rb +78 -46
  83. data/lib/taskjuggler/daemon/ReportServer.rb +52 -28
  84. data/lib/taskjuggler/daemon/ReportServlet.rb +92 -21
  85. data/lib/taskjuggler/daemon/WebServer.rb +75 -22
  86. data/lib/taskjuggler/daemon/WelcomePage.rb +1 -0
  87. data/lib/taskjuggler/reports/AccountListRE.rb +3 -3
  88. data/lib/taskjuggler/reports/CSVFile.rb +9 -2
  89. data/lib/taskjuggler/reports/ChartPlotter.rb +453 -0
  90. data/lib/taskjuggler/reports/Navigator.rb +1 -0
  91. data/lib/taskjuggler/reports/NikuReport.rb +4 -4
  92. data/lib/taskjuggler/reports/Report.rb +6 -18
  93. data/lib/taskjuggler/reports/ReportBase.rb +9 -9
  94. data/lib/taskjuggler/reports/ReportContext.rb +2 -2
  95. data/lib/taskjuggler/reports/StatusSheetReport.rb +6 -6
  96. data/lib/taskjuggler/reports/TableReport.rb +24 -15
  97. data/lib/taskjuggler/reports/TimeSheetReport.rb +5 -5
  98. data/lib/taskjuggler/reports/TraceReport.rb +251 -0
  99. data/lib/tj3webd.rb +17 -0
  100. data/manual/Day_To_Day_Juggling +10 -3
  101. data/manual/Installation +38 -19
  102. data/manual/Software +25 -19
  103. data/manual/Tutorial +119 -110
  104. data/manual/html/Day_To_Day_Juggling.html +7 -5
  105. data/manual/html/Getting_Started.html +4 -4
  106. data/manual/html/How_To_Contribute.html +4 -4
  107. data/manual/html/Installation.html +19 -11
  108. data/manual/html/Intro.html +4 -4
  109. data/manual/html/Reporting_Bugs.html +4 -4
  110. data/manual/html/Rich_Text_Attributes.html +4 -4
  111. data/manual/html/Software.html +15 -11
  112. data/manual/html/TaskJuggler_2x_Migration.html +4 -4
  113. data/manual/html/TaskJuggler_Internals.html +4 -4
  114. data/manual/html/The_TaskJuggler_Syntax.html +4 -4
  115. data/manual/html/Tutorial.html +41 -32
  116. data/manual/html/account.html +4 -4
  117. data/manual/html/account.task.html +4 -4
  118. data/manual/html/accountprefix.html +4 -4
  119. data/manual/html/accountreport.html +27 -9
  120. data/manual/html/accountroot.html +5 -5
  121. data/manual/html/active.html +4 -4
  122. data/manual/html/adopt.task.html +4 -4
  123. data/manual/html/aggregate.html +4 -4
  124. data/manual/html/alert.html +4 -4
  125. data/manual/html/alertlevels.html +4 -4
  126. data/manual/html/allocate.html +5 -5
  127. data/manual/html/alphabet.html +4 -4
  128. data/manual/html/alternative.html +4 -4
  129. data/manual/html/author.html +4 -4
  130. data/manual/html/balance.html +5 -5
  131. data/manual/html/booking.resource.html +4 -4
  132. data/manual/html/booking.task.html +4 -4
  133. data/manual/html/caption.html +5 -5
  134. data/manual/html/cellcolor.column.html +43 -8
  135. data/manual/html/celltext.column.html +4 -4
  136. data/manual/html/center.html +5 -5
  137. data/manual/html/charge.html +4 -4
  138. data/manual/html/chargeset.html +4 -4
  139. data/manual/html/columnid.html +27 -15
  140. data/manual/html/columns.html +5 -5
  141. data/manual/html/complete.html +4 -4
  142. data/manual/html/copyright.html +4 -4
  143. data/manual/html/credits.html +4 -4
  144. data/manual/html/css/tjreport.css +14 -5
  145. data/manual/html/currency.html +4 -4
  146. data/manual/html/currencyformat.html +5 -5
  147. data/manual/html/dailymax.html +5 -5
  148. data/manual/html/dailymin.html +5 -5
  149. data/manual/html/dailyworkinghours.html +4 -4
  150. data/manual/html/date.extend.html +4 -4
  151. data/manual/html/date.html +5 -5
  152. data/manual/html/definitions.html +4 -4
  153. data/manual/html/depends.html +4 -4
  154. data/manual/html/details.html +4 -4
  155. data/manual/html/disabled.html +4 -4
  156. data/manual/html/duration.html +4 -4
  157. data/manual/html/efficiency.html +4 -4
  158. data/manual/html/effort.html +4 -4
  159. data/manual/html/email.html +4 -4
  160. data/manual/html/enabled.html +4 -4
  161. data/manual/html/end.column.html +4 -4
  162. data/manual/html/end.html +4 -4
  163. data/manual/html/end.limit.html +4 -4
  164. data/manual/html/end.report.html +5 -5
  165. data/manual/html/end.timesheet.html +4 -4
  166. data/manual/html/endcredit.html +4 -4
  167. data/manual/html/epilog.html +5 -5
  168. data/manual/html/export.html +4 -4
  169. data/manual/html/extend.html +4 -4
  170. data/manual/html/fail.html +43 -8
  171. data/manual/html/fdl.html +4 -4
  172. data/manual/html/flags.account.html +4 -4
  173. data/manual/html/flags.html +4 -4
  174. data/manual/html/flags.journalentry.html +4 -4
  175. data/manual/html/flags.report.html +5 -5
  176. data/manual/html/flags.resource.html +4 -4
  177. data/manual/html/flags.statussheet.html +4 -4
  178. data/manual/html/flags.task.html +4 -4
  179. data/manual/html/flags.timesheet.html +4 -4
  180. data/manual/html/fontcolor.column.html +43 -8
  181. data/manual/html/footer.html +5 -5
  182. data/manual/html/formats.html +5 -5
  183. data/manual/html/functions.html +4 -4
  184. data/manual/html/gapduration.html +4 -4
  185. data/manual/html/gaplength.html +4 -4
  186. data/manual/html/halign.center.html +4 -4
  187. data/manual/html/halign.column.html +43 -8
  188. data/manual/html/halign.left.html +4 -4
  189. data/manual/html/halign.right.html +4 -4
  190. data/manual/html/hasalert.html +4 -4
  191. data/manual/html/header.html +5 -5
  192. data/manual/html/headline.html +7 -7
  193. data/manual/html/height.html +72 -0
  194. data/manual/html/hideaccount.html +46 -11
  195. data/manual/html/hidejournalentry.html +5 -5
  196. data/manual/html/hidereport.html +43 -8
  197. data/manual/html/hideresource.html +44 -9
  198. data/manual/html/hidetask.html +44 -9
  199. data/manual/html/icalreport.html +4 -4
  200. data/manual/html/include.macro.html +4 -4
  201. data/manual/html/include.project.html +4 -4
  202. data/manual/html/include.properties.html +4 -4
  203. data/manual/html/index.html +2 -1
  204. data/manual/html/inherit.extend.html +4 -4
  205. data/manual/html/interval1.html +4 -4
  206. data/manual/html/interval2.html +4 -4
  207. data/manual/html/interval3.html +4 -4
  208. data/manual/html/interval4.html +4 -4
  209. data/manual/html/isactive.html +4 -4
  210. data/manual/html/ischildof.html +4 -4
  211. data/manual/html/isdependencyof.html +4 -4
  212. data/manual/html/isdutyof.html +4 -4
  213. data/manual/html/isfeatureof.html +4 -4
  214. data/manual/html/isleaf.html +4 -4
  215. data/manual/html/ismilestone.html +4 -4
  216. data/manual/html/isongoing.html +4 -4
  217. data/manual/html/isresource.html +4 -4
  218. data/manual/html/isresponsibilityof.html +4 -4
  219. data/manual/html/istask.html +4 -4
  220. data/manual/html/journalattributes.html +11 -7
  221. data/manual/html/journalentry.html +4 -4
  222. data/manual/html/journalmode.html +5 -5
  223. data/manual/html/leaveallowance.html +5 -5
  224. data/manual/html/leaves.html +5 -6
  225. data/manual/html/left.html +5 -5
  226. data/manual/html/length.html +4 -4
  227. data/manual/html/limits.allocate.html +4 -4
  228. data/manual/html/limits.html +4 -4
  229. data/manual/html/limits.resource.html +4 -4
  230. data/manual/html/limits.task.html +4 -4
  231. data/manual/html/listitem.column.html +4 -4
  232. data/manual/html/listtype.column.html +4 -4
  233. data/manual/html/loadunit.html +5 -5
  234. data/manual/html/logicalexpression.html +8 -44
  235. data/manual/html/logicalflagexpression.html +4 -4
  236. data/manual/html/macro.html +4 -4
  237. data/manual/html/managers.html +4 -4
  238. data/manual/html/mandatory.html +4 -4
  239. data/manual/html/maxend.html +4 -4
  240. data/manual/html/maximum.html +5 -5
  241. data/manual/html/maxstart.html +4 -4
  242. data/manual/html/milestone.html +4 -4
  243. data/manual/html/minend.html +4 -4
  244. data/manual/html/minimum.html +5 -5
  245. data/manual/html/minstart.html +4 -4
  246. data/manual/html/monthlymax.html +5 -5
  247. data/manual/html/monthlymin.html +5 -5
  248. data/manual/html/navbar.html +10 -4
  249. data/manual/html/navigator.html +4 -4
  250. data/manual/html/newtask.html +4 -4
  251. data/manual/html/nikureport.html +4 -4
  252. data/manual/html/note.task.html +4 -4
  253. data/manual/html/now.html +4 -4
  254. data/manual/html/numberformat.html +5 -5
  255. data/manual/html/onend.html +4 -4
  256. data/manual/html/onstart.html +4 -4
  257. data/manual/html/opennodes.html +5 -5
  258. data/manual/html/overtime.booking.html +4 -4
  259. data/manual/html/period.column.html +4 -4
  260. data/manual/html/period.limit.html +4 -4
  261. data/manual/html/period.report.html +5 -5
  262. data/manual/html/period.task.html +4 -4
  263. data/manual/html/persistent.html +4 -4
  264. data/manual/html/precedes.html +4 -4
  265. data/manual/html/priority.html +4 -4
  266. data/manual/html/priority.timesheet.html +4 -4
  267. data/manual/html/project.html +4 -4
  268. data/manual/html/projectid.html +4 -4
  269. data/manual/html/projectid.task.html +4 -4
  270. data/manual/html/projectids.html +4 -4
  271. data/manual/html/projection.html +5 -7
  272. data/manual/html/prolog.html +5 -5
  273. data/manual/html/properties.html +11 -5
  274. data/manual/html/purge.html +5 -5
  275. data/manual/html/rate.html +4 -4
  276. data/manual/html/rate.resource.html +4 -4
  277. data/manual/html/reference.extend.html +4 -4
  278. data/manual/html/remaining.html +4 -4
  279. data/manual/html/replace.html +4 -4
  280. data/manual/html/reportprefix.html +4 -4
  281. data/manual/html/resource.html +4 -10
  282. data/manual/html/resourceattributes.html +4 -4
  283. data/manual/html/resourceprefix.html +4 -4
  284. data/manual/html/resourcereport.html +28 -10
  285. data/manual/html/resourceroot.html +5 -5
  286. data/manual/html/resources.limit.html +4 -4
  287. data/manual/html/responsible.html +4 -4
  288. data/manual/html/richtext.extend.html +4 -4
  289. data/manual/html/right.html +5 -5
  290. data/manual/html/rollupaccount.html +44 -9
  291. data/manual/html/rollupresource.html +44 -9
  292. data/manual/html/rolluptask.html +44 -9
  293. data/manual/html/scale.column.html +4 -4
  294. data/manual/html/scenario.html +4 -22
  295. data/manual/html/scenario.ical.html +4 -4
  296. data/manual/html/scenarios.export.html +4 -4
  297. data/manual/html/scenarios.html +5 -5
  298. data/manual/html/scenariospecific.extend.html +4 -4
  299. data/manual/html/scheduled.html +4 -4
  300. data/manual/html/scheduling.html +4 -4
  301. data/manual/html/select.html +4 -4
  302. data/manual/html/selfcontained.html +5 -5
  303. data/manual/html/shift.allocate.html +4 -4
  304. data/manual/html/shift.html +4 -4
  305. data/manual/html/shift.resource.html +5 -5
  306. data/manual/html/shift.task.html +4 -4
  307. data/manual/html/shift.timesheet.html +4 -4
  308. data/manual/html/shifts.allocate.html +4 -4
  309. data/manual/html/shifts.resource.html +4 -4
  310. data/manual/html/shifts.task.html +4 -4
  311. data/manual/html/shorttimeformat.html +4 -4
  312. data/manual/html/sloppy.booking.html +4 -4
  313. data/manual/html/sloppy.projection.html +5 -5
  314. data/manual/html/sortaccounts.html +5 -5
  315. data/manual/html/sortjournalentries.html +5 -5
  316. data/manual/html/sortresources.html +5 -5
  317. data/manual/html/sorttasks.html +5 -5
  318. data/manual/html/start.column.html +4 -4
  319. data/manual/html/start.html +4 -4
  320. data/manual/html/start.limit.html +4 -4
  321. data/manual/html/start.report.html +5 -5
  322. data/manual/html/startcredit.html +4 -4
  323. data/manual/html/status.statussheet.html +4 -4
  324. data/manual/html/status.timesheet.html +4 -4
  325. data/manual/html/statussheet.html +4 -4
  326. data/manual/html/statussheetreport.html +4 -4
  327. data/manual/html/strict.projection.html +5 -5
  328. data/manual/html/summary.html +4 -4
  329. data/manual/html/supplement.html +4 -4
  330. data/manual/html/supplement.resource.html +4 -10
  331. data/manual/html/supplement.task.html +4 -28
  332. data/manual/html/tagfile.html +4 -4
  333. data/manual/html/task.html +4 -28
  334. data/manual/html/task.statussheet.html +4 -4
  335. data/manual/html/task.timesheet.html +4 -4
  336. data/manual/html/taskattributes.html +4 -4
  337. data/manual/html/taskprefix.html +4 -4
  338. data/manual/html/taskreport.html +28 -10
  339. data/manual/html/taskroot.html +5 -5
  340. data/manual/html/text.extend.html +4 -4
  341. data/manual/html/textreport.html +27 -9
  342. data/manual/html/timeformat.html +5 -5
  343. data/manual/html/timeoff.nikureport.html +4 -4
  344. data/manual/html/timesheet.html +4 -4
  345. data/manual/html/timesheetreport.html +23 -5
  346. data/manual/html/timezone.export.html +4 -4
  347. data/manual/html/timezone.html +4 -4
  348. data/manual/html/timezone.report.html +5 -5
  349. data/manual/html/timezone.shift.html +4 -4
  350. data/manual/html/timingresolution.html +4 -4
  351. data/manual/html/title.column.html +4 -4
  352. data/manual/html/title.html +5 -5
  353. data/manual/html/toc.html +207 -179
  354. data/manual/html/tooltip.column.html +45 -10
  355. data/manual/html/tracereport.html +405 -0
  356. data/manual/html/trackingscenario.html +6 -6
  357. data/manual/html/treelevel.html +4 -4
  358. data/manual/html/vacation.html +4 -4
  359. data/manual/html/vacation.resource.html +4 -4
  360. data/manual/html/vacation.shift.html +4 -4
  361. data/manual/html/warn.html +43 -8
  362. data/manual/html/weeklymax.html +5 -5
  363. data/manual/html/weeklymin.html +5 -5
  364. data/manual/html/weekstartsmonday.html +4 -4
  365. data/manual/html/weekstartssunday.html +6 -6
  366. data/manual/html/width.column.html +6 -6
  367. data/manual/html/width.html +72 -0
  368. data/manual/html/work.html +4 -4
  369. data/manual/html/workinghours.project.html +4 -4
  370. data/manual/html/workinghours.resource.html +4 -4
  371. data/manual/html/workinghours.shift.html +4 -4
  372. data/manual/html/yearlyworkingdays.html +4 -4
  373. data/spec/Color_spec.rb +60 -0
  374. data/spec/ProjectBroker_spec.rb +3 -2
  375. data/spec/StatusSheets_spec.rb +5 -4
  376. data/spec/TableColumnSorter_spec.rb +78 -0
  377. data/spec/TimeSheets_spec.rb +6 -2
  378. data/spec/Tj3Daemon_spec.rb +2 -2
  379. data/spec/TraceReport_spec.rb +117 -0
  380. data/taskjuggler.gemspec +1 -1
  381. data/test/MessageChecker.rb +3 -1
  382. data/test/ReferenceGenerator.rb +1 -1
  383. data/test/TestSuite/CSV-Reports/Leave.tjp +1 -1
  384. data/test/TestSuite/CSV-Reports/refs/resourcereport_with_tasks.csv +3 -0
  385. data/test/TestSuite/CSV-Reports/refs/taskcounter.csv +9 -0
  386. data/test/TestSuite/CSV-Reports/refs/taskreport_with_resources.csv +19 -16
  387. data/test/TestSuite/CSV-Reports/refs/weekly.csv +1 -0
  388. data/test/TestSuite/Export-Reports/refs/LogicalExpression.tjp +14 -2
  389. data/test/TestSuite/Export-Reports/refs/tutorial.tjp +98 -86
  390. data/test/TestSuite/Scheduler/Correct/Leaves.tjp +25 -0
  391. data/test/TestSuite/Syntax/Correct/Leave.tjp +1 -1
  392. data/test/TestSuite/Syntax/Correct/LogicalExpression.tjp +9 -1
  393. data/test/TestSuite/Syntax/Correct/TraceReport.tjp +10 -0
  394. data/test/TestSuite/Syntax/Correct/tutorial.tjp +10 -4
  395. data/test/test_CSV-Reports.rb +3 -3
  396. data/test/test_Export-Reports.rb +91 -86
  397. data/test/test_Journal.rb +15 -12
  398. data/test/test_Limits.rb +3 -3
  399. data/test/test_Project.rb +1 -2
  400. data/test/test_ProjectFileScanner.rb +1 -1
  401. data/test/test_PropertySet.rb +1 -1
  402. data/test/test_Query.rb +5 -6
  403. data/test/test_ReportGenerator.rb +15 -7
  404. data/test/test_RichText.rb +4 -3
  405. data/test/test_Scheduler.rb +19 -7
  406. data/test/test_ShiftAssignments.rb +2 -2
  407. data/test/test_SimpleQueryExpander.rb +29 -2
  408. data/test/test_Syntax.rb +14 -5
  409. metadata +49 -10
  410. data/lib/taskjuggler/LogFile.rb +0 -73
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = Group.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012
7
+ # by Chris Schlaeger <chris@linux.com>
8
+ #
9
+ # This program is free software; you can redistribute it and/or modify
10
+ # it under the terms of version 2 of the GNU General Public License as
11
+ # published by the Free Software Foundation.
12
+ #
13
+
14
+ require 'taskjuggler/Painter/Primitives'
15
+ require 'taskjuggler/Painter/SVGSupport'
16
+
17
+ class TaskJuggler
18
+
19
+ class Painter
20
+
21
+ # The Group can be used to group Elements together and define common
22
+ # attributes in a single place.
23
+ class Group
24
+
25
+ include Primitives
26
+ include SVGSupport
27
+
28
+ def initialize(values, &block)
29
+ @attributes = [
30
+ :fill, :font_family, :font_size, :stroke, :stroke_width
31
+ ]
32
+ values.each do |k, v|
33
+ unless @attributes.include?(k)
34
+ raise ArgumentError, "Unsupported attribute #{k}. " +
35
+ "Use one of #{@attributes.join(', ')}."
36
+ end
37
+ end
38
+
39
+ @values = values
40
+ @elements = []
41
+
42
+ if block
43
+ if block.arity == 1
44
+ # This is the traditional case where self is passed to the block.
45
+ # All Primitives methods now must be prefixed with the block
46
+ # variable to call them.
47
+ yield self
48
+ else
49
+ # In order to have the primitives easily available in the block,
50
+ # we use instance_eval to switch self to this object. But this
51
+ # makes the methods of the original self no longer accessible. We
52
+ # work around this by saving the original self and using
53
+ # method_missing to delegate the method call to the original self.
54
+ @originalSelf = eval('self', block.binding)
55
+ instance_eval(&block)
56
+ end
57
+ end
58
+ end
59
+
60
+ # Delegator to @originalSelf.
61
+ def method_missing(method, *args, &block)
62
+ @originalSelf.send(method, *args, &block)
63
+ end
64
+
65
+ # Convert the Group into an XMLElement tree using SVG syntax.
66
+ def to_svg
67
+ XMLElement.new('g', valuesToSVG) do
68
+ @elements.map { |el| el.to_svg }
69
+ end
70
+ end
71
+
72
+ end
73
+
74
+ end
75
+
76
+ end
77
+
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = Points.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012
7
+ # by Chris Schlaeger <chris@linux.com>
8
+ #
9
+ # This program is free software; you can redistribute it and/or modify
10
+ # it under the terms of version 2 of the GNU General Public License as
11
+ # published by the Free Software Foundation.
12
+ #
13
+
14
+ class TaskJuggler
15
+
16
+ class Painter
17
+
18
+ # Utility class to describe a list of x, y coordinates. Each coordinate is
19
+ # an Array with 2 elements. The whole list is another Array.
20
+ class Points
21
+
22
+ # Store the list after doing some error checking.
23
+ def initialize(arr)
24
+ arr.each do |point|
25
+ unless point.is_a?(Array) && point.length == 2
26
+ raise ArgumentError, 'Points must be an Array with 2 coordinates'
27
+ end
28
+ end
29
+ @points = arr
30
+ end
31
+
32
+ # Conver the list of coordinates into a String that is compatible with
33
+ # SVG syntax.
34
+ def to_s
35
+ str = ''
36
+ @points.each do |point|
37
+ str += "#{point[0]},#{point[1]} "
38
+ end
39
+ str
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+
46
+ end
47
+
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = Primitives.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012
7
+ # by Chris Schlaeger <chris@linux.com>
8
+ #
9
+ # This program is free software; you can redistribute it and/or modify
10
+ # it under the terms of version 2 of the GNU General Public License as
11
+ # published by the Free Software Foundation.
12
+ #
13
+
14
+ require 'taskjuggler/Painter/Color'
15
+ require 'taskjuggler/Painter/Points'
16
+
17
+ class TaskJuggler
18
+
19
+ class Painter
20
+
21
+ # This module contains utility methods to create the canvas Elements with
22
+ # minimal overhead. The element is added to it's current parent and
23
+ # mandatory arguments are enforced. It also eliminates the need to call
24
+ # 'new' methods of each Element.
25
+ module Primitives
26
+
27
+ unless defined?(StrokeAttrs)
28
+ StrokeAttrs = [ :stroke, :stroke_opacity, :stroke_width ]
29
+ FillAttrs = [ :fill, :fill_opacity ]
30
+ FillAndStrokeAttrs = StrokeAttrs + FillAttrs
31
+ TextAttrs = FillAndStrokeAttrs + [ :font_family, :font_size ]
32
+ end
33
+
34
+ def color(*args)
35
+ Color.new(*args)
36
+ end
37
+
38
+ def points(arr)
39
+ Points.new(arr)
40
+ end
41
+
42
+ def group(attrs = {}, &block)
43
+ @elements << (g = Group.new(attrs, &block))
44
+ g
45
+ end
46
+
47
+ def circle(cx, cy, r, attrs = {})
48
+ attrs[:cx] = cx
49
+ attrs[:cy] = cy
50
+ attrs[:r] = r
51
+ @elements << (c = Circle.new(attrs))
52
+ c
53
+ end
54
+
55
+ def ellipse(cx, cy, rx, ry, attrs = {})
56
+ attrs[:cx] = cx
57
+ attrs[:cy] = cy
58
+ attrs[:rx] = rx
59
+ attrs[:ry] = ry
60
+ @elements << (e = Ellipse.new(attrs))
61
+ e
62
+ end
63
+
64
+ def line(x1, y1, x2, y2, attrs = {})
65
+ attrs[:x1] = x1
66
+ attrs[:y1] = y1
67
+ attrs[:x2] = x2
68
+ attrs[:y2] = y2
69
+ @elements << (l = Line.new(attrs))
70
+ l
71
+ end
72
+
73
+ def polyline(points, attrs = {})
74
+ attrs[:points] = points.is_a?(Array) ? Points.new(points) : points
75
+ @elements << (l = PolyLine.new(attrs))
76
+ l
77
+ end
78
+
79
+ def rect(x, y, width, height, attrs = {})
80
+ attrs[:x] = x
81
+ attrs[:y] = y
82
+ attrs[:width] = width
83
+ attrs[:height] = height
84
+ @elements << (r = Rect.new(attrs))
85
+ r
86
+ end
87
+
88
+ def text(x, y, str, attrs = {})
89
+ attrs[:x] = x
90
+ attrs[:y] = y
91
+ @elements << (t = Text.new(str, attrs))
92
+ t
93
+ end
94
+
95
+ end
96
+
97
+ end
98
+
99
+ end
100
+
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = SVGSupport.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012
7
+ # by Chris Schlaeger <chris@linux.com>
8
+ #
9
+ # This program is free software; you can redistribute it and/or modify
10
+ # it under the terms of version 2 of the GNU General Public License as
11
+ # published by the Free Software Foundation.
12
+ #
13
+
14
+ class TaskJuggler
15
+
16
+ class Painter
17
+
18
+ # Utility module to convert the attributes into SVG compatible syntax.
19
+ module SVGSupport
20
+
21
+ def valuesToSVG
22
+ values = {}
23
+ @values.each do |k, v|
24
+ unit = k == :font_size ? 'pt' : ''
25
+ # Convert the underscores to dashes and the symbols to Strings.
26
+ values[k.to_s.gsub(/[_]/, '-')] = v.to_s + unit
27
+ end
28
+ values
29
+ end
30
+
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby -w
2
+ # encoding: UTF-8
3
+ #
4
+ # = Text.rb -- The TaskJuggler III Project Management Software
5
+ #
6
+ # Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012
7
+ # by Chris Schlaeger <chris@linux.com>
8
+ #
9
+ # This program is free software; you can redistribute it and/or modify
10
+ # it under the terms of version 2 of the GNU General Public License as
11
+ # published by the Free Software Foundation.
12
+ #
13
+
14
+ require 'taskjuggler/XMLElement'
15
+ require 'taskjuggler/Painter/Element'
16
+
17
+ class TaskJuggler
18
+
19
+ class Painter
20
+
21
+ # A text element.
22
+ class Text < Element
23
+
24
+ # Create a text of _str_ at x, y coordinates.
25
+ def initialize(str, attrs)
26
+ super('text', [ :x, :y ] + TextAttrs, attrs)
27
+ @text = str
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ end
35
+
36
+
@@ -54,16 +54,15 @@ class TaskJuggler
54
54
  # the list of known Attributes.
55
55
  class Project
56
56
 
57
+ include MessageHandler
58
+
57
59
  attr_reader :accounts, :shifts, :tasks, :resources, :scenarios,
58
- :timeSheets, :reports, :messageHandler, :inputFiles
60
+ :timeSheets, :reports, :inputFiles
59
61
  attr_accessor :reportContexts, :outputDir, :warnTsDeltas
60
62
 
61
63
  # Create a project with the specified +id+, +name+ and +version+.
62
- # +messageHandler+ is a MessageHandler reference that is used to handle
63
- # all error and warning messages that might occur during processing. The
64
- # constructor will set default values for all project attributes.
65
- def initialize(id, name, version, messageHandler)
66
- @messageHandler = messageHandler
64
+ # The constructor will set default values for all project attributes.
65
+ def initialize(id, name, version)
67
66
  AttributeBase.setMode(0)
68
67
  @attributes = {
69
68
  # This nested Array defines the supported alert levels. The lowest
@@ -73,7 +72,7 @@ class TaskJuggler
73
72
  # associated color as RGB byte array.
74
73
  'alertLevels' => AlertLevelDefinitions.new,
75
74
  'copyright' => nil,
76
- 'costAccount' => nil,
75
+ 'costaccount' => nil,
77
76
  'currency' => "EUR",
78
77
  'currencyFormat' => RealFormat.new([ '-', '', '', ',', 2 ]),
79
78
  'dailyworkinghours' => 8.0,
@@ -91,7 +90,7 @@ class TaskJuggler
91
90
  'projectid' => id || "prj",
92
91
  'projectids' => [ id ],
93
92
  'rate' => 0.0,
94
- 'revenueAccount' => nil,
93
+ 'revenueaccount' => nil,
95
94
  'scheduleGranularity' => Project.maxScheduleGranularity,
96
95
  'shortTimeFormat' => "%H:%M",
97
96
  'start' => nil,
@@ -333,7 +332,7 @@ class TaskJuggler
333
332
  attrs = [
334
333
  # ID Name Type
335
334
  # Inh. Inh.Prj Scen. Default
336
- [ 'accountRoot', 'Account Root', PropertyAttribute,
335
+ [ 'accountroot', 'Account Root', PropertyAttribute,
337
336
  true, false, false, nil ],
338
337
  [ 'bsi', 'BSI', StringAttribute,
339
338
  false, false, false, "" ],
@@ -343,7 +342,7 @@ class TaskJuggler
343
342
  true, false, false, nil ],
344
343
  [ 'columns', 'Columns', ColumnListAttribute,
345
344
  true, false, false, [] ],
346
- [ 'costAccount', 'Cost Account', AccountAttribute,
345
+ [ 'costaccount', 'Cost Account', AccountAttribute,
347
346
  true, true, false, nil ],
348
347
  [ 'currencyFormat', 'Currency Format', RealFormatAttribute,
349
348
  true, true, false, nil ],
@@ -373,6 +372,8 @@ class TaskJuggler
373
372
  true, false, false, nil ],
374
373
  [ 'hideTask', 'Hide Task', LogicalExpressionAttribute,
375
374
  true, false, false, nil ],
375
+ [ 'height', 'Height', FixnumAttribute,
376
+ false, false, false, 480 ],
376
377
  [ 'id', 'ID', StringAttribute,
377
378
  false, false, false, nil ],
378
379
  [ 'index', 'Index', FixnumAttribute,
@@ -399,9 +400,9 @@ class TaskJuggler
399
400
  true, false, false, nil],
400
401
  [ 'resourceAttributes', 'Resource Attributes', FormatListAttribute,
401
402
  true, false, false, KeywordArray.new([ '*' ]) ],
402
- [ 'resourceRoot', 'resource Root', PropertyAttribute,
403
+ [ 'resourceroot', 'resource Root', PropertyAttribute,
403
404
  true, false, false, nil ],
404
- [ 'revenueAccount', 'Revenue Account', AccountAttribute,
405
+ [ 'revenueaccount', 'Revenue Account', AccountAttribute,
405
406
  true, true, false, nil ],
406
407
  [ 'right', 'Right', RichTextAttribute,
407
408
  true, false, false, nil ],
@@ -431,7 +432,7 @@ class TaskJuggler
431
432
  true, true, false, nil ],
432
433
  [ 'taskAttributes', 'Task Attributes', FormatListAttribute,
433
434
  true, false, false, KeywordArray.new([ '*' ]) ],
434
- [ 'taskRoot', 'Task Root', PropertyAttribute,
435
+ [ 'taskroot', 'Task Root', PropertyAttribute,
435
436
  true, false, false, nil ],
436
437
  [ 'timeFormat', 'Time Format', StringAttribute,
437
438
  true, true, false, nil ],
@@ -446,7 +447,9 @@ class TaskJuggler
446
447
  [ 'tree', 'Tree Index', StringAttribute,
447
448
  false, false, false, "" ],
448
449
  [ 'weekStartsMonday', 'Week Starts Monday', BooleanAttribute,
449
- true, true, false, false ]
450
+ true, true, false, false ],
451
+ [ 'width', 'Width', FixnumAttribute,
452
+ true, false, false, 640 ]
450
453
  ]
451
454
  attrs.each { |a| @reports.addAttributeType(AttributeDefinition.new(*a)) }
452
455
 
@@ -653,6 +656,24 @@ class TaskJuggler
653
656
  true
654
657
  end
655
658
 
659
+ # Add the CSV output format to all reports of type 'tracereport' if
660
+ # _enable_ is true. Otherwise remove all CSV output formats.
661
+ def enableTraceReports(enable)
662
+ @reports.each do |report|
663
+ next unless report.typeSpec == :tracereport
664
+
665
+ if enable
666
+ # Enable the CSV format for the tracereport
667
+ unless report.get('formats').include?(:csv)
668
+ report.get('formats') << :csv
669
+ end
670
+ else
671
+ # Disabe CSV format for the tracereport
672
+ report.get('formats').delete(:csv)
673
+ end
674
+ end
675
+ end
676
+
656
677
  # Make sure that we have a least one report defined that has an output
657
678
  # format.
658
679
  def checkReports
@@ -665,8 +686,8 @@ class TaskJuggler
665
686
  unless @accounts.empty?
666
687
  @reports.each do |report|
667
688
  if (report.typeSpec != :accountreport) &&
668
- (report.get('costAccount').nil? ||
669
- report.get('revenueAccount').nil?)
689
+ (report.get('costaccount').nil? ||
690
+ report.get('revenueaccount').nil?)
670
691
  warning('report_without_balance',
671
692
  "The report #{report.fullId} has no 'balance' defined. " +
672
693
  "No cost or revenue computation will be possible.",
@@ -690,7 +711,10 @@ class TaskJuggler
690
711
  @reports.index
691
712
  if maxCpuCores == 1
692
713
  @reports.each do |report|
714
+ # Skip reports that don't have any format specified or trace reports
715
+ # when generateTraces is false.
693
716
  next if report.get('formats').empty?
717
+
694
718
  Log.startProgressMeter("Report #{report.name}")
695
719
  @reportContexts.push(ReportContext.new(self, report))
696
720
  report.generate
@@ -702,7 +726,11 @@ class TaskJuggler
702
726
  # BatchProcessor queue.
703
727
  bp = BatchProcessor.new(maxCpuCores)
704
728
  @reports.each do |report|
705
- next if report.get('formats').empty?
729
+ # Skip reports that don't have any format specified or trace reports
730
+ # when generateTraces is false.
731
+ next if report.get('formats').empty? ||
732
+ (report.typeSpec == :trace && !generateTraces)
733
+
706
734
  bp.queue(report) {
707
735
  @reportContexts.push(ReportContext.new(self, report))
708
736
  res = report.generate
@@ -751,7 +779,7 @@ class TaskJuggler
751
779
  if dynamicAttributes
752
780
  unless dynamicAttributes.empty?
753
781
  context.attributeBackup = report.backupAttributes
754
- parser = ProjectFileParser.new(@messageHandler)
782
+ parser = ProjectFileParser.new
755
783
  parser.parseReportAttributes(report, dynamicAttributes)
756
784
  end
757
785
  report.set('interactive', true)
@@ -1013,17 +1041,6 @@ class TaskJuggler
1013
1041
  str
1014
1042
  end
1015
1043
 
1016
- # Generate an error message via the message handler.
1017
- def error(id, text, sourceFileInfo = nil)
1018
- @messageHandler.error(id, text, sourceFileInfo)
1019
- end
1020
-
1021
- # Generate a warning message via the message handle.
1022
- def warning(id, text, sourceFileInfo = nil)
1023
- @messageHandler.warning(id, text, sourceFileInfo)
1024
- end
1025
-
1026
-
1027
1044
  protected
1028
1045
 
1029
1046
  def prepareScenario(scIdx)