Improve design of read-only pop up device info dialog

Re design device details dialog
Aldo did some folder info related changes at server side php file
This commit is contained in:
csoni
2017-02-21 12:42:13 +05:30
committed by Ronald Toussaint
parent 1b0d83f0e2
commit 1ff20da262
12 changed files with 489 additions and 247 deletions

View File

@ -111,7 +111,7 @@ class PluginMDMModule extends Module
/**
function which calls the wipeDevice soap call
* function which calls the wipeDevice soap call
* @param int $deviceid of phone which has to be wiped
* @return json $response object contains the response of the soap request from Z-Push
*/
@ -232,7 +232,6 @@ class PluginMDMModule extends Module
$contentData = $device['contentdata'];
$folders = array_keys($contentData);
$synchedFolderTypes = array();
$synchronizedData = '';
$synchronizedFolders = 0;
$hierarchyCache = isset($device['hierarchycache']) ? $device['hierarchycache'] : false;
@ -253,27 +252,21 @@ class PluginMDMModule extends Module
$folderType = $this->getSyncFolderType($type, $name);
if (isset($contentData[$folderid][self::FOLDERUUID])) {
$synchedFolderTypes[$folderType]++;
}
if (isset($contentData[$folderid][self::FOLDERUUID])) {
$synchedFolderTypes[$folderType]++;
}
}
}
foreach ($synchedFolderTypes as $key => $value) {
$synchronizedData = $synchronizedData . $key;
$synchronizedFolders += $value;
if ($value > 1) {
$synchronizedData = $synchronizedData . "(" . $value . ") ";
} else {
$synchronizedData = $synchronizedData . " ";
}
}
$syncFoldersProps = array();
foreach ($synchedFolderTypes as $key => $value) {
$synchronizedFolders += $value;
$syncFoldersProps[strtolower($key) . 'folder'] = $value;
}
$syncFoldersProps["totalfolders"] = count($folders);
$syncFoldersProps["shortfolderids"] = $device['hasfolderidmapping'] ? dgettext('plugin_mdm', "Yes") : dgettext('plugin_mdm', "No") ;
$syncFoldersProps["shortfolderids"] = $device['hasfolderidmapping'] ? dgettext('plugin_mdm', "Yes") : dgettext('plugin_mdm', "No");
$syncFoldersProps['synchronizedfolders'] = $synchronizedFolders;
$syncFoldersProps['synchronizeddata'] = $synchronizedData;
return $syncFoldersProps;
}