emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH 1/5] Add some minimal infrastructure to handle export to both


From: Christian Egli
Subject: [O] [PATCH 1/5] Add some minimal infrastructure to handle export to both tj2 and tj3
Date: Wed, 16 Mar 2011 12:04:58 +0100

* org-taskjuggler.el (org-export-taskjuggler-target-version):
(org-taskjuggler-targeting-tj3-p): Add some minimal infrastructure to
handle export to both tj2 and tj3.
(org-taskjuggler-open-task): Use a different way to purge allocations
for tj2 and tj3.
---
 lisp/org-taskjuggler.el |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el
index 8d6318e..ec6bb30 100644
--- a/lisp/org-taskjuggler.el
+++ b/lisp/org-taskjuggler.el
@@ -181,6 +181,11 @@ resources for the project."
   :group 'org-export-taskjuggler
   :type 'string)
 
+(defcustom org-export-taskjuggler-target-version 2.4
+  "Which version of TaskJuggler the exporter is targeting."
+  :group 'org-export-taskjuggler
+  :type 'number)
+
 (defcustom org-export-taskjuggler-default-project-version "1.0"
   "Default version string for the project."
   :group 'org-export-taskjuggler
@@ -331,6 +336,10 @@ with the TaskJuggler GUI."
         (command (concat process-name " " file-name)))
     (start-process-shell-command process-name nil command)))
 
+(defun org-taskjuggler-targeting-tj3-p ()
+  "Return true if we are targeting TaskJuggler III."
+  (< org-export-taskjuggler-target-version 3.0))
+
 (defun org-taskjuggler-parent-is-ordered-p ()
   "Return true if the parent of the current node has a property
 \"ORDERED\". Return nil otherwise."
@@ -623,7 +632,10 @@ org-mode priority string."
       (if (and parent-ordered previous-sibling)
          (format " depends %s\n" previous-sibling)
        (and depends (format " depends %s\n" depends)))
-      (and allocate (format " purge allocations\n allocate %s\n" allocate))
+      (and allocate (format " purge %s\n allocate %s\n"
+                           (or (and (org-taskjuggler-targeting-tj3-p) 
"allocations")
+                               "allocate")
+                           allocate))
       (and complete (format " complete %s\n" complete))
       (and effort (format " effort %s\n" effort))
       (and priority (format " priority %s\n" priority))
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]