diff --git a/inc/caldav-PROPPATCH.php b/inc/caldav-PROPPATCH.php
index 4adef33b..b013057e 100644
--- a/inc/caldav-PROPPATCH.php
+++ b/inc/caldav-PROPPATCH.php
@@ -1,7 +1,64 @@
Unimplemented
Unfortunately this function is planned, but not yet implemented
Well, actually, perhaps 'planned' is too strong a word. It is on the roadmap, and if you want to
-contribute to the planning, please add your two cents to the Sourceforge forums or tracker items.";
- echo "It would also be useful if you could find a client which uses it, maybe even a log of it
-doing so, and so on.
";
+/**
+* CalDAV Server - handle PROPPATCH method
+*
+* @package rscds
+* @subpackage caldav
+* @author Andrew McMillan
+* @copyright Catalyst .Net Ltd
+* @license http://gnu.org/copyleft/gpl.html GNU GPL v2
+*/
+dbg_error_log("PROPPATCH", "method handler");
+
+// if ( ! $request->AllowedTo('write-properties') ) {
+// $request->DoResponse( 403 );
+// }
+
+$tree - new XMLTree();
+
+foreach( $request->xml_tags AS $k => $v ) {
+
+ $fulltag = $v['tag'];
+ dbg_error_log("PROPPATCH", "Handling %s", $fulltag);
+ // dbg_log_array( "PROPPATCH", 'values', $v, true );
+ if ( $v['type'] == "open" ) {
+ echo "Entering $fulltag\n";
+ if ( isset($current) ) {
+ echo "Type of \$current is ".gettype($current)."\n";
+ $child = new XMLElement($fulltag);
+ $child->SetParent($current);
+ $current->AddSubTag($child);
+ $current =& $child;
+ }
+ else {
+ echo "Root of tree is $fulltag\n";
+ $root = new XMLElement($fulltag);
+ $current =& $root;
+ }
+ }
+ else if ( $v['type'] == "close" ) {
+ echo "Leaving $fulltag\n";
+ $parent =& $current->GetParent();
+ $current =& $parent;
+ }
+ else if ( $v['type'] == "complete" ) {
+ $value = $v['value'];
+ printf( "Adding '%s' with content '%s'\n", $fulltag, $value );
+ $child = new XMLElement($fulltag, $value);
+ $current->AddSubTag($child);
+ }
+ else {
+ printf( "Unhandled type '%s' for tag '%s'\n", $v['type'], $v['tag'] );
+ }
+
+
+// echo $root->Render(). "\n";
+// switch ( $fulltag ) {
+}
+
+
+echo $root->Render(). "\n";
+
+exit(0);
+
?>
\ No newline at end of file