From 64571a284e4de720fe6f9ba15af00b3d0760e95f Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 11 Oct 2009 15:06:52 -0700 Subject: [PATCH] Non-working start on the expand-property report from webdav-versioning. --- inc/caldav-REPORT-expand-property.php | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 inc/caldav-REPORT-expand-property.php diff --git a/inc/caldav-REPORT-expand-property.php b/inc/caldav-REPORT-expand-property.php new file mode 100644 index 00000000..a4da7fad --- /dev/null +++ b/inc/caldav-REPORT-expand-property.php @@ -0,0 +1,32 @@ +GetPath('/DAV::expand-property/DAV::property'); +$proplist = array(); +foreach( $props AS $k => $v ) { + $proplist[] = $v->GetContent(); +} +function display_status( $status_code ) { + return sprintf( 'HTTP/1.1 %03d %s', $status_code, getStatusMessage($status_code) ); +} + +$sql = "SELECT * FROM sync_changes LEFT JOIN calendar_item USING (dav_id) LEFT JOIN caldav_data USING (dav_id) WHERE sync_time > (SELECT modification_time FROM sync_tokens WHERE sync_token = ?)"; +$qry = new PgQuery($sql); + +if ( $qry->Exec("REPORT",__LINE__,__FILE__) && $qry->rows > 0 ) { + while( $object = $qry->Fetch() ) { + $href = new XMLElement( 'dav_name', ConstructURL($change->href) ); + $status = new XMLElement( 'status', display_status($change->status) ); + if ( $status != 404 ) { + $propstat = $request->ObjectPropStat($proplist, $object); + } + $responses[] = new XMLElement( 'sync-response', array() ); + } +} + +$multistatus = new XMLElement( "multistatus", $responses, $reply->GetXmlNsArray() ); + +$request->XMLResponse( 207, $multistatus );