Skip to content

Commit

Permalink
Adding CalendarAPI::declineMeeting and setting release date for 0.7…
Browse files Browse the repository at this point in the history
….5 to today
  • Loading branch information
Garethp committed Apr 18, 2016
1 parent 8cfad36 commit ea8d178
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 1 addition & 4 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
49 changes: 43 additions & 6 deletions src/Calendar/CalendarAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit ea8d178

Please sign in to comment.