Revision 3733,
903 bytes
checked in by gabriel.malheiros, 14 years ago
(diff) |
Ticket #1541 - <Davical customizado para o Expresso.Utiliza Caldav e CardDav?>
|
Rev | Line | |
---|
[3733] | 1 | <?php |
---|
| 2 | /** |
---|
| 3 | * Handle the FREE-BUSY-QUERY variant of REPORT |
---|
| 4 | */ |
---|
| 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 | |
---|
| 17 | /** We use the same code for the REPORT, the POST and the freebusy GET... */ |
---|
| 18 | $freebusy = get_freebusy( '^'.$request->path.$request->DepthRegexTail(), $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 | |
---|
Note: See
TracBrowser
for help on using the repository browser.