summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2014-08-25 09:24:17 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2014-08-25 09:24:17 (GMT)
commit0b2686173fced31528d93748ce8dadfef9e6efb3 (patch)
tree1bcc30f88350cfa28224d77ed12d56e6e8d61db3
parent2453e6c360e8b0898a6065f1aba4c85bac2fdfdc (diff)
downloadlibkolabxml-0b2686173fced31528d93748ce8dadfef9e6efb3.tar.gz
Support for PARTSTAT INPROCESS and DELEGATED.
Patch by Thomas BrĂ¼derli.
-rw-r--r--src/containers/kolabcontainers.h4
-rw-r--r--src/python/test.py17
-rw-r--r--src/xcalconversions.h10
3 files changed, 30 insertions, 1 deletions
diff --git a/src/containers/kolabcontainers.h b/src/containers/kolabcontainers.h
index 7bd1d2b..af44c24 100644
--- a/src/containers/kolabcontainers.h
+++ b/src/containers/kolabcontainers.h
@@ -336,7 +336,9 @@ enum PartStatus {
PartAccepted,
PartDeclined,
PartTentative,
- PartDelegated
+ PartDelegated,
+ PartInProcess,
+ PartCompleted
};
enum Role {
diff --git a/src/python/test.py b/src/python/test.py
index df3bc83..998059c 100644
--- a/src/python/test.py
+++ b/src/python/test.py
@@ -55,6 +55,23 @@ class TestKolabformat(unittest.TestCase):
delegatees = attendees_[0].delegatedTo()
self.assertEqual(delegatees[0].email(), "jane@doe.org")
+ def test_todo_partstat(self):
+ t = kolabformat.Todo()
+ t.setSummary("test")
+ t.setPercentComplete(40)
+
+ att = kolabformat.Attendee(kolabformat.ContactReference("john@doe.org"))
+ att.setRole(kolabformat.Required)
+ att.setPartStat(kolabformat.PartInProcess)
+ t.setAttendees([att])
+
+ xml = kolabformat.writeTodo(t)
+ self.assertTrue("<text>IN-PROCESS</text>" in xml)
+
+ t1 = kolabformat.readTodo(xml, False)
+ attendees = t1.attendees()
+ self.assertEqual(attendees[0].partStat(), kolabformat.PartInProcess)
+
if __name__ == '__main__':
unittest.main() \ No newline at end of file
diff --git a/src/xcalconversions.h b/src/xcalconversions.h
index b30053f..176470c 100644
--- a/src/xcalconversions.h
+++ b/src/xcalconversions.h
@@ -75,6 +75,8 @@ const char* const PARTDECLINED = "DECLINED";
const char* const PARTDELEGATED = "DELEGATED";
const char* const PARTNEEDSACTION = "NEEDS-ACTION";
const char* const PARTTENTATIVE = "TENTATIVE";
+const char* const PARTINPROCESS = "IN-PROCESS";
+const char* const PARTCOMPLETED = "COMPLETED";
const char* const CHAIR = "CHAIR";
const char* const NONPARTICIPANT = "NON-PARTICIPANT";
@@ -600,6 +602,10 @@ std::string mapPartStat(PartStatus status)
return PARTNEEDSACTION;
case PartTentative:
return PARTTENTATIVE;
+ case PartInProcess:
+ return PARTINPROCESS;
+ case PartCompleted:
+ return PARTCOMPLETED;
}
ERROR("PartStat not handled: " + status);
return std::string();
@@ -617,6 +623,10 @@ PartStatus mapPartStat(const std::string &status)
return PartNeedsAction;
} else if (status == PARTTENTATIVE) {
return PartTentative;
+ } else if (status == PARTINPROCESS) {
+ return PartInProcess;
+ } else if (status == PARTCOMPLETED) {
+ return PartCompleted;
}
ERROR("PartStat not handled: " + status);
return PartNeedsAction;