2015-10-21 3 views
0

Привет, я в настоящее время зациклился на том, как установить цвет категории через php-ews при создании или обновлении события календаря.цвет набора категорий через php-ews в Outlook

Я использую сервер обмена 2013.

См основной пример ниже:

<?php 
$ews = new ExchangeWebServices($host, $username, $password, $version); 

// Start building the request. 
$request = new EWSType_CreateItemType(); 
$request->Items = new EWSType_NonEmptyArrayOfAllItemsType(); 
$request->Items->CalendarItem = new EWSType_CalendarItemType(); 

// Set the subject. 
$request->Items->CalendarItem->Subject = 'Basic Calendar Item Insertion'; 

// Set the start and end times. 
$date = new DateTime('8:00 AM'); 
$request->Items->CalendarItem->Start = $date->format('c'); 
$date->modify('+1 hour'); 
$request->Items->CalendarItem->End = $date->format('c'); 

// Set no reminders 
$request->Items->CalendarItem->ReminderIsSet = false; 

// Or use this to specify when reminder is displayed (if this is not set, the default is 15 minutes) 
$request->Items->CalendarItem->ReminderMinutesBeforeStart = 15; 

// Build the body. 
$request->Items->CalendarItem->Body = new EWSType_BodyType(); 
$request->Items->CalendarItem->Body->BodyType = EWSType_BodyTypeType::HTML; 
$request->Items->CalendarItem->Body->_ = 'This is <b>the</b> body'; 

// Set the item class type (not required). 
$request->Items->CalendarItem->ItemClass = new EWSType_ItemClassType(); 
$request->Items->CalendarItem->ItemClass->_ = EWSType_ItemClassType::APPOINTMENT; 

// Set the sensativity of the event (defaults to normal). 
$request->Items->CalendarItem->Sensitivity = new EWSType_SensitivityChoicesType(); 
$request->Items->CalendarItem->Sensitivity->_ = EWSType_SensitivityChoicesType::NORMAL; 

// Add some categories to the event. 
$request->Items->CalendarItem->Categories = new EWSType_ArrayOfStringsType(); 
$request->Items->CalendarItem->Categories->String = array('Testing', 'php-ews'); 

// Set the importance of the event. 
$request->Items->CalendarItem->Importance = new EWSType_ImportanceChoicesType(); 
$request->Items->CalendarItem->Importance->_ = EWSType_ImportanceChoicesType::NORMAL; 

// Don't send meeting invitations. 
$request->SendMeetingInvitations = EWSType_CalendarItemCreateOrDeleteOperationType::SEND_TO_NONE; 

$response = $ews->CreateItem($request); 

Как вы можете видеть, что я могу добавить несколько категорий.

Кто-нибудь знает, можно ли включать цвета категорий?

Должен ли я настроить библиотеку php-ews для включения кода, подобного примеру C# here?

ответ

3

Цвет категории зависит от списка основных категорий, который является элементом конфигурации почтового ящика. Вы получаете доступ/устанавливаете их с помощью EWS, см. http://www.infinitec.de/post/2011/07/28/Working-with-the-Master-Category-List%E2%80%93EWS-edition.aspx, но это делается для каждого почтового ящика.

Приветствия Глен

+1

Благодаря Глен. Поэтому мне нужно будет сделать это с помощью библиотеки php-ews. По крайней мере, я уже нашел запись [wiki] (https://github.com/jamesiarmes/php-ews/wiki/Calendar:-Get-Event-Colors) о том, как получить цвета календаря. – rogaa

Смежные вопросы