Add support for more resource attributes

This commit is contained in:
Christian Egli 2010-03-23 11:09:10 +01:00
parent 020bb514a4
commit fd89c73c6a
1 changed files with 15 additions and 5 deletions

View File

@ -382,12 +382,22 @@ more parts of the headline or finally add more underscore characters (\"_\")."
(let ((id (org-taskjuggler-clean-id (cdr (assoc "ID" resource))))
(unique-id (org-taskjuggler-clean-id (cdr (assoc "unique-id" resource))))
(headline (cdr (assoc "headline" resource)))
(limits (cdr (assoc "limits" resource)))
(vacation (cdr (assoc "vacation" resource))))
(attributes '(limits vacation shift booking efficiency journalentry rate)))
(insert
(concat "resource " (or id unique-id) " \"" headline "\" {\n "
(and limits (concat "\n limits { " limits " }\n"))
(and vacation (concat "\n vacation " vacation "\n"))))))
(concat
"resource " (or id unique-id) " \"" headline "\" {\n "
(mapconcat
'identity
(remq
nil
(mapcar
(lambda (attribute)
(let ((value (cdr (assoc (symbol-name attribute) resource))))
(and value
(if (equal attribute 'limits)
(format "%s { %s }" (symbol-name attribute) value)
(format "%s %s" (symbol-name attribute) value)))))
attributes)) "\n") "\n"))))
(defun org-taskjuggler-clean-effort (effort)
"Translate effort strings into a format acceptable to taskjuggler,