From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Egli Subject: [PATCH 1/5] Add some minimal infrastructure to handle export to both tj2 and tj3 Date: Wed, 16 Mar 2011 12:04:58 +0100 Message-ID: <1300273502-12977-2-git-send-email-christian.egli@alumni.ethz.ch> References: <1300273502-12977-1-git-send-email-christian.egli@alumni.ethz.ch> Return-path: Received: from [140.186.70.92] (port=36582 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzoXU-0006Gu-VB for emacs-orgmode@gnu.org; Wed, 16 Mar 2011 07:05:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzoXN-0005f0-2o for emacs-orgmode@gnu.org; Wed, 16 Mar 2011 07:05:10 -0400 Received: from mail.sbszh.ch ([217.162.18.84]:40933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzoXM-0005eN-Sr for emacs-orgmode@gnu.org; Wed, 16 Mar 2011 07:05:09 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.sbszh.ch (Postfix) with ESMTP id A1A5E86D0 for ; Wed, 16 Mar 2011 12:05:05 +0100 (CET) Received: from mail.sbszh.ch ([127.0.0.1]) by localhost (mail01.dmz.sbszh.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5RDnWZgy5pl8 for ; Wed, 16 Mar 2011 12:05:02 +0100 (CET) Received: from s05.sbszh.ch (s05.sbszh.ch [10.0.9.9]) by mail.sbszh.ch (Postfix) with ESMTP id AB53186E2 for ; Wed, 16 Mar 2011 12:05:02 +0100 (CET) Received: from localhost (unknown [127.0.0.1]) by localhost.sbszh.ch (Postfix) with ESMTP id 7F24015C2BA for ; Wed, 16 Mar 2011 11:05:03 +0000 (UTC) Received: from s05.sbszh.ch ([127.0.0.1]) by localhost (s05.sbszh.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12687-04 for ; Wed, 16 Mar 2011 12:05:03 +0100 (CET) Received: from wharton.sbszh.ch (w302.sbszh.ch [10.0.41.2]) by s05.sbszh.ch (Postfix) with ESMTP id 589DF15C1F5 for ; Wed, 16 Mar 2011 12:05:03 +0100 (CET) In-Reply-To: <1300273502-12977-1-git-send-email-christian.egli@alumni.ethz.ch> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * 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