emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [taskjuggler] small edits to org-taskjuggler.el for tj3
@ 2011-04-04 19:58 Sullivan, Gregory (US SSA)
  2011-04-05  7:43 ` Christian Egli
  0 siblings, 1 reply; 3+ messages in thread
From: Sullivan, Gregory (US SSA) @ 2011-04-04 19:58 UTC (permalink / raw)
  To: Emacs-orgmode@gnu.org

Appended is a patch with a couple of small changes to org-taskjuggler.el, addressing the following issues:

General:

* in org-taskjuggler-open-project, the duration is never calculated (default is always used).

Specific to tj3:

* the reports need a "formats" attribute

* tj3 does not support the "utilization" and "freeload" columns in reports. 

* the "sorttasks startup" attribute in the default resourcereport does not make sense anymore. 

Not addressed in the patch:

* I wasn't sure about how best to maintain backwards compatibility with the default report strings, as I override the taskjuggler version in the .org file (not in my .emacs file).

* for tj3, I found that I needed to put a "scheduling" property in the top level task, with value "asap". 

Org-mode version 7.5 (release_7.5.134.gb869b.dirty)
TaskJuggler III v0.0.11

-- Greg
-- 
Greg Sullivan          gregory.sullivan@baesystems.com
(781)262-4553 (office) (978)430-3461 (cell)



--- ../../../git-org-mode-new/org-mode/lisp/org-taskjuggler.el	2011-04-04 13:12:56.758073400 -0400
+++ ./org-taskjuggler.el	2011-04-04 15:32:33.789346200 -0400
@@ -204,13 +204,14 @@
   columns hierarchindex, name, start, end, effort, duration, completed, chart
   timeformat \"%Y-%m-%d\"
   hideresource 1
+  formats html
   loadunit shortauto
 }"
 "resourcereport \"Resource Graph\" {
   headline \"Resource Allocation Graph\"
-  columns no, name, utilization, freeload, chart
+  columns no, name, effortleft, freetime, chart
   loadunit shortauto
-  sorttasks startup
+  formats html
   hidetask ~isleaf()
 }")
   "Default reports for the project."
@@ -553,11 +554,16 @@
 	(headline (cdr (assoc "headline" project)))
 	(version (cdr (assoc "version" project)))
 	(start (cdr (assoc "start" project)))
-	(end (cdr (assoc "end" project))))
+	(end (cdr (assoc "end" project)))
+	(duration (if (and start end)
+		      (- (time-to-days
+			  (date-to-time (format "%s 00:01:00" end)))
+			 (time-to-days
+			  (date-to-time (format "%s 00:01:00" start))))
+		    org-export-taskjuggler-default-project-duration)))
     (insert
      (format "project %s \"%s\" \"%s\" %s +%sd {\n }\n"
-	     unique-id headline version start
-	     org-export-taskjuggler-default-project-duration))))
+	     unique-id headline version start duration))))
 
 (defun org-taskjuggler-filter-and-join (items)
   "Filter all nil elements from ITEMS and join the remaining ones

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [taskjuggler] small edits to org-taskjuggler.el for tj3
  2011-04-04 19:58 [taskjuggler] small edits to org-taskjuggler.el for tj3 Sullivan, Gregory (US SSA)
@ 2011-04-05  7:43 ` Christian Egli
  2011-04-05  8:58   ` Christian Egli
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Egli @ 2011-04-05  7:43 UTC (permalink / raw)
  To: emacs-orgmode

Hi Gregory

"Sullivan, Gregory (US SSA)" <gregory.sullivan@baesystems.com> writes:

> Appended is a patch with a couple of small changes to
> org-taskjuggler.el, addressing the following issues:

Thanks for your patch. 

> General:
>
> * in org-taskjuggler-open-project, the duration is never calculated
> (default is always used).

Good catch and thanks for your patch. Unfortunately the patch causes
problems with my export. The duration is now correctly calculated,
however the root task now also has an end attribute which causes
problems down the road and TJ2 tells me that "End of task foo does not
fit into the project time frame. Try using a later project end date".
But no matter how much I put the end date into the future the issue
remains. If I remove the end attribute from the root task it seems to
work. 

This might be an inherent problem with the fact that the exporter uses
the root task also as a container for project specific information.

> Specific to tj3:
> * the reports need a "formats" attribute
> * I wasn't sure about how best to maintain backwards compatibility
> with the default report strings, as I override the taskjuggler version
> in the .org file (not in my .emacs file). 

The reports are a problem. Right now they are defined in a custom
definition. To maintain backwards compatibility we could probably just
add a new custom definition for tj3 reports and use that one if we're
exporting to tj3.

> * for tj3, I found that I needed to put a "scheduling" property in the
> top level task, with value "asap". TaskJuggler III v0.0.11

Are you suggesting we should insert this automatically? Shouldn't this
be at the users discretion?

Thanks
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [taskjuggler] small edits to org-taskjuggler.el for tj3
  2011-04-05  7:43 ` Christian Egli
@ 2011-04-05  8:58   ` Christian Egli
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Egli @ 2011-04-05  8:58 UTC (permalink / raw)
  To: emacs-orgmode

Christian Egli <christian.egli@sbs.ch> writes:

>> * in org-taskjuggler-open-project, the duration is never calculated
>> (default is always used).
>
> Good catch and thanks for your patch. Unfortunately the patch causes
> problems with my export. The duration is now correctly calculated,
> however the root task now also has an end attribute which causes
> problems down the road and TJ2 tells me that "End of task foo does not
> fit into the project time frame. Try using a later project end date".
> But no matter how much I put the end date into the future the issue
> remains. If I remove the end attribute from the root task it seems to
> work. 

The following patch seems to work. If you're OK with it I will commit.

diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el
index f891634..20bd91f 100644
--- a/lisp/org-taskjuggler.el
+++ b/lisp/org-taskjuggler.el
@@ -553,11 +553,11 @@ specified it is calculated
 	(headline (cdr (assoc "headline" project)))
 	(version (cdr (assoc "version" project)))
 	(start (cdr (assoc "start" project)))
-	(end (cdr (assoc "end" project))))
+	(period (or (cdr (assoc "period" project))
+		    (format "%s +%sd" start org-export-taskjuggler-default-project-duration))))
     (insert
-     (format "project %s \"%s\" \"%s\" %s +%sd {\n }\n"
-	     unique-id headline version start
-	     org-export-taskjuggler-default-project-duration))))
+     (format "project %s \"%s\" \"%s\" %s {\n }\n"
+	     unique-id headline version period))))
 
 (defun org-taskjuggler-filter-and-join (items)
   "Filter all nil elements from ITEMS and join the remaining ones

Thanks
Christian
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-05  8:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-04 19:58 [taskjuggler] small edits to org-taskjuggler.el for tj3 Sullivan, Gregory (US SSA)
2011-04-05  7:43 ` Christian Egli
2011-04-05  8:58   ` Christian Egli

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).