List folders that have been opened through the api

Added button in MDMDeviceGeneralTab
Created MDMManageSharedFolderContentPanel and MDMManageSharedFolderPanel to show a dialog with multi select hierarchy
Created substore sharedfolder
Added proxy and response handler to handel device response

Used message class instead of object type,
Override hierarchy tree , hierarchy loader and folder node ui
This commit is contained in:
csoni
2017-04-20 17:19:55 +05:30
committed by root
parent 42dda5a34b
commit 568eb9170d
21 changed files with 808 additions and 69 deletions

View File

@ -171,6 +171,20 @@ class PluginMDMModule extends Module
$this->addActionData('list', $data);
$GLOBALS['bus']->addData($this->getResponseData());
break;
case 'open':
$data = array();
$rawData = $this->getDevices();
foreach($rawData as $device){
if($device->data['deviceid'] === $actionData['entryid']) {
$data['props'] = $this->getDeviceProps($device->data);
$data["sharedfolders"] = array("item" => $this->getAdditionalFolderList($actionData['entryid']));
}
}
$item = array("item" => $data);
$this->addActionData('item', $item);
$GLOBALS['bus']->addData($this->getResponseData());
break;
default:
$this->handleUnknownActionType($actionType);
}
@ -212,6 +226,7 @@ class PluginMDMModule extends Module
'lastsynctime', 'lastupdatetime', 'wipestatus', 'policyname', 'koeversion', 'koebuild', 'koebuilddate'];
$item['entryid'] = $device['deviceid'];
$item['message_class'] = "IPM.MDM";
foreach ($propsList as $prop) {
if (isset($device[$prop])) {
$item[$prop] = $device[$prop];
@ -262,11 +277,11 @@ class PluginMDMModule extends Module
$synchronizedFolders += $value;
$syncFoldersProps[strtolower($key) . 'folder'] = $value;
}
$syncFoldersProps["totalfolders"] = count($folders);
$client = $this->getSoapClient();
$items = $client->AdditionalFolderList($device['deviceid']);
$syncFoldersProps['sharedfolders'] = count($items);
$syncFoldersProps["shortfolderids"] = $device['hasfolderidmapping'] ? dgettext('plugin_mdm', "Yes") : dgettext('plugin_mdm', "No");
$syncFoldersProps['synchronizedfolders'] = $synchronizedFolders;
$syncFoldersProps['synchronizedfolders'] = $synchronizedFolders + count($items);
return $syncFoldersProps;
}
@ -309,5 +324,34 @@ class PluginMDMModule extends Module
}
return $folderType;
}
/**
* Function which is use to get list of additional folders which was shared with given device
* @param string $devid device id
* @return array has list of properties related to shared folders
*/
function getAdditionalFolderList($devid)
{
$stores = $GLOBALS["mapisession"]->getAllMessageStores();
$client = $this->getSoapClient();
$items = $client->AdditionalFolderList($devid);
$data = array();
foreach ($items as $item)
{
foreach ($stores as $store)
{
try {
$entryid = mapi_msgstore_entryidfromsourcekey($store, hex2bin($item->folderid));
} catch (MAPIException $me) {
continue;
}
}
if (isset($entryid)) {
$item->entryid = bin2hex($entryid);
}
array_push($data, array("props" => $item));
}
return $data;
}
};
?>