2014-04-07 89 views
1

嗨,大家好:)我想從資源會議框中採取所有會議,但是當我試圖採取這樣的主題$ subject = $ event->主題它顯示名稱由誰開會被創建。 $ request-> ParentFolderIds-> DistinguishedFolderId-> Mailbox-> EmailAddress =「[email protected]」這是我如何選擇資源會議框的代碼。會議主題從資源郵箱PHP-EWS

我想借此滿足其他方式問題,我會很高興,如果你能幫助我:)

$request = new EWSType_FindItemType(); 
// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED 
// to identify "soft deleted" items, i.e. not visible and not in the trash can. 
$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW; 
// This identifies the set of properties to return in an item or folder response 
$request->ItemShape = new EWSType_ItemResponseShapeType(); 
$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES; 
// Define the timeframe to load calendar items 
$request->CalendarView = new EWSType_CalendarViewType(); 
$request->CalendarView->StartDate ='2014-03-28T15:00:00+04:00';// an ISO8601 date e.g. 2012-06-12T15:18:34+03:00 "Y-m-d\TH:i:sO" 
$request->CalendarView->EndDate = '2015-03-28T15:00:00+04:00';// an ISO8601 date later than the above "Y-m-d\TH:i:sO" 

// Only look in the "calendars folder" 
$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType(); 
$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType(); 
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR; 
$request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = "[email protected]"; 

// Send request 
$response = $ews->FindItem($request); 
// Loop through each item if event(s) were found in the timeframe specified 
if ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){ 
    $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem; 


//  $db_selected = mysql_select_db('meeting_room',$con); 
//  $res=mysql_query("SELECT ID FROM meeting"); 
//  while($row = mysql_fetch_array($res)){ 
//  echo $row['ID']; 
//  echo "<br>"; 
//  } 
    foreach ($events as $event){ 

     $id = $event->ItemId->Id; 
     $change_key = $event->ItemId->ChangeKey; 
     $start = $event->Start; 
     $end = $event->End; 
     $subject = $event->Subject; 
     $location = $event->Location; 

由誰這個主題顯示會議的創建。我希望這個信息太多,但我想題目太大..請幫助:)

+0

您的代碼看起來正確。你可以在你的'foreach'循環中使用print_r($ event);來驗證整個事件參數嗎?我現在唯一的其他建議是將DefaultShapeNamesType改爲$ request-> ItemShape-> BaseShape = EWSType_DefaultShapeNamesType :: ALL_PROPERTIES; – ThomasEllis

回答

0

這是交易所(不是你的代碼,或者PHP庫,或EWS)

幾個博客,一個問題像這樣一個:http://www.slipstick.com/exchange/cmdlets/meeting-organizers-name-appears-in-subject-line/表示您可以執行一些PowerShell命令來更改Exchange服務器配置。請注意,如果您更改配置,它將應用於配置更改後添加的所有新會議/約會(現有會議/約會將保持原樣)。

如果您沒有對Exchange服務器的PowerShell訪問權限,但通過其他系統具有管理員訪問權限,則可以通過該系統的界面實現相同的配置更改。例如,在Parallels託管交換系統上,以管理員身份登錄到Parallels,轉到Exchange,轉到資源郵箱,編輯房間資源,並取消選中「資源調度」選項卡下的「添加管理器到主題」複選框。據我所知,這只是在幕後執行相同的PowerShell操作。

在其他系統(例如Office 365)中可能有類似的選項,雖然我沒有看過。

說了這麼多,我發現改變這個配置對我來說並沒有什麼幫助:我創建了一個新的會議來對待一個房間資源,然而主題以「」(空字符串)而不是正確的主題或組織者的名字。無論如何,隨着其他人顯然獲得成功,嘗試改變配置。