Commit aeebcf25 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #249 in ZP/z-push from...

Merge pull request #249 in ZP/z-push from feature/ZP-939-z-push-admin-can-show-foldernames to develop

* commit 'cf877ef6':
  ZP-939 Now with file.
  ZP-939 ZPushAdmin::GetDeviceDetails() should load all states (also the hierarchy cache), mark the KOE GAB folder as gab in the overview of folders of z-push-admin, show folder name of currently synchronizing folders.
parents d8dc78ba cf877ef6
......@@ -106,8 +106,8 @@ class ZPushAdmin {
$sc = new SyncCollections();
$sc->SetStateManager($stateManager);
// load all collections of device without loading states, checking permissions or loading the hierarchy
$sc->LoadAllCollections(true, false, false, false);
// load all collections of device also loading states and loading hierarchy, but not checking permissions
$sc->LoadAllCollections(true, true, false, true);
if ($sc->GetLastSyncTime())
$device->SetLastSyncTime($sc->GetLastSyncTime());
......
......@@ -772,10 +772,16 @@ class ZPushAdminCLI {
if ($device->GetFolderUUID($folderid)) {
$synchedFolders++;
$type = $device->GetFolderType($folderid);
$name = $device->GetHierarchyCache()->GetFolder($folderid)->displayname;
switch($type) {
case SYNC_FOLDER_TYPE_APPOINTMENT:
case SYNC_FOLDER_TYPE_USER_APPOINTMENT:
if (KOE_GAB_NAME != "" && $name == KOE_GAB_NAME) {
$gentype = "GAB";
}
else {
$gentype = "Calendars";
}
break;
case SYNC_FOLDER_TYPE_CONTACT:
case SYNC_FOLDER_TYPE_USER_CONTACT:
......@@ -800,8 +806,7 @@ class ZPushAdminCLI {
// set the folder name for all folders which are not fully synchronized yet
$fstatus = $device->GetFolderSyncStatus($folderid);
if ($fstatus !== false && is_array($fstatus)) {
// TODO would be nice if we could see the real name of the folder, right now we use the folder type as name
$fstatus['name'] = $gentype;
$fstatus['name'] = $name ? $name : $gentype;
$device->SetFolderSyncStatus($folderid, $fstatus);
$syncedFoldersInProgress++;
}
......@@ -859,7 +864,10 @@ class ZPushAdminCLI {
$percent = round($d['done']*100/$d['total']);
$status = sprintf("Status: %s%d%% (%d/%d)", ($percent < 10)?" ":"", $percent, $d['done'], $d['total']);
}
printf("\tFolder: %s%s Sync: %s %s\n", $d['name'], str_repeat(" ", 12-strlen($d['name'])), $d['status'], $status);
if (strlen($d['name']) > 20) {
$d['name'] = substr($d['name'], 0, 18) . "..";
}
printf("\tFolder: %s Sync: %s %s\n", str_pad($d['name'], 20), str_pad($d['status'], 13), $status);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment