DAViCal
 All Classes Namespaces Functions Variables Pages
caldav-REPORT-freebusy.php
1 <?php
5 include_once("freebusy-functions.php");
6 
7 $fbq_content = $xmltree->GetContent('urn:ietf:params:xml:ns:caldav:free-busy-query');
8 $fbq_start = $fbq_content[0]->GetAttribute('start');
9 $fbq_end = $fbq_content[0]->GetAttribute('end');
10 if ( ! ( isset($fbq_start) || isset($fbq_end) ) ) {
11  $request->DoResponse( 400, 'All valid freebusy requests MUST contain a time-range filter' );
12 }
13 $range_start = new RepeatRuleDateTime($fbq_start);
14 $range_end = new RepeatRuleDateTime($fbq_end);
15 
16 
18 $freebusy = get_freebusy( '^' . $request->path . $request->DepthRegexTail(true), $range_start, $range_end );
19 
20 $result = new iCalComponent();
21 $result->VCalendar();
22 $result->AddComponent($freebusy);
23 
24 $request->DoResponse( 200, $result->Render(), 'text/calendar' );
25 // Won't return from that
26