diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8511ef..238a953d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog -## 0.7.5 - TBD +## 0.7.5 - 2016-04-18 * Removed `NTLMSoapClient\Exchange`. Folded the few lines of functionality in to `NTLMSoapClient` * Added `API::getServerTimezones($timezoneIDs = array(), $fullTimezoneData = false)` * Added `CalendarAPI::acceptMeeting($itemId, $message, $sensitivity = 'Private', $options = array()` + * Added `CalendarAPI::declineMeeting($itemId, $message, $sensitivity = 'Private', $options = array()` * Added `ContactsAPI::createContacts($contact, $options=array())` * Added `ContactsAPI::updateContactItem($itemId, $changes)` * Added some contact examples diff --git a/TODO.md b/TODO.md index d523a265..2c2ae4a1 100644 --- a/TODO.md +++ b/TODO.md @@ -12,10 +12,7 @@ ### Test Coverage * Increase to at least 90% - -### Compatibility - * Think about swapping out Guzzle to reduce PHP version requirement to 5.4 - + ### Code Generation * Modify generator to include the SOAP functions as Doc Blocks on ExchangeWebServices class diff --git a/src/Calendar/CalendarAPI.php b/src/Calendar/CalendarAPI.php index 824c12a5..abd4e6ae 100644 --- a/src/Calendar/CalendarAPI.php +++ b/src/Calendar/CalendarAPI.php @@ -227,13 +227,50 @@ public function listChanges($syncState = null, $options = array()) */ public function acceptMeeting($itemId, $message, $sensitivity = 'Private', $options = array()) { - $acceptItem = array( - 'Sensitivity' => $sensitivity, - 'Body' => $message, - 'ReferenceItemId' => $itemId->toArray() + $request = array( + 'AcceptItem' => array( + 'Sensitivity' => $sensitivity, + 'Body' => array('BodyType' => 'HTML', '_value' => $message), + 'ReferenceItemId' => $itemId->toArray() + ) + ); + + $defaultOptions = array('MessageDisposition' => 'SendOnly'); + $options = array_replace_recursive($defaultOptions, $options); + + $return = $this->createItems($request, $options)->getCalendarItem(); + if (!is_array($request)) { + $return = array($return); + } + + return $return; + } + + /** + * @param $itemId + * @param $message + * @param string $sensitivity + * @param array $options + * @return Type\ItemIdType[] + */ + public function declineMeeting($itemId, $message, $sensitivity = 'Private', $options = array()) + { + $request = array( + 'DeclineItem' => array( + 'Sensitivity' => $sensitivity, + 'Body' => array('BodyType' => 'HTML', '_value' => $message), + 'ReferenceItemId' => $itemId->toArray() + ) ); - $acceptItem = array('AcceptItem' => array(array_replace_recursive($acceptItem, $options))); - return $this->createItems($acceptItem, array('MessageDisposition'=>'SendOnly')); + $defaultOptions = array('MessageDisposition' => 'SendOnly'); + $options = array_replace_recursive($defaultOptions, $options); + + $return = $this->createItems($request, $options)->getCalendarItem(); + if (!is_array($request)) { + $return = array($return); + } + + return $return; } }