ischedule: actually add attendee to freebusy reply ics

This commit is contained in:
Rob Ostensen 2012-01-31 00:39:32 -06:00 committed by Andrew McMillan
parent 9540e01cd4
commit e00310a56a

View File

@ -116,6 +116,7 @@ else {
function ischedule_freebusy_request( $ic, $attendees, $attendees_fail) {
global $c, $session, $request;
$reply = new XMLDocument( array( "urn:ietf:params:xml:ns:ischedule" => "I" ) );
$icalAttendees = $ic->GetAttendees();
$responses = array();
$ical = $ic->GetComponents('VFREEBUSY');
$ical = $ical[0];
@ -134,11 +135,14 @@ function ischedule_freebusy_request( $ic, $attendees, $attendees_fail) {
$fb->AddProperty( 'UID', $ical->GetPValue('UID') );
$fb->SetProperties( $ic->GetProperties('ORGANIZER'), 'ORGANIZER');
$fb->AddProperty( $attendee );
foreach( $icalAttendees AS $ia ) {
if ( $ia->Value() == 'mailto:' . $attendee ) { // FIXME: this is probably wrong
$fb->AddProperty( $ia );
}
}
$vcal = new vCalendar( array('METHOD' => 'REPLY') );
$vcal->AddComponent( $fb );
$vcal->AddComponent( $fb );
$response = $reply->NewXMLElement( "response", false, false, 'urn:ietf:params:xml:ns:ischedule' );
$response->NewElement( "recipient", 'mailto:'.$attendee->email, false, 'urn:ietf:params:xml:ns:ischedule' );